diff --git a/.gitignore b/.gitignore index c027f5873c8..05f981a0ace 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,5 @@ node_modules/ built/* -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/test262/* tests/cases/perf/* diff --git a/AUTHORS.md b/AUTHORS.md index 0ade4c31221..486a15bf47f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,6 +8,7 @@ TypeScript is authored by: * Basarat Ali Syed * Ben Duffield * Bill Ticehurst +* Brett Mayen * Bryan Forbes * Caitlin Potter * Chris Bubernak @@ -17,11 +18,14 @@ TypeScript is authored by: * Dan Quirk * Daniel Rosenwasser * David Li -* Dick van den Brink -* Dirk Bäumer +* Denis Nedelyaev +* Dick van den Brink +* Dirk Bäumer +* Eyas Sharaiha * Frank Wallis * Gabriel Isenberg * Gilad Peleg +* Graeme Wicksted * Guillaume Salles * Harald Niesche * Ingvar Stepanyan @@ -31,30 +35,39 @@ TypeScript is authored by: * Jason Ramsay * Jed Mao * Johannes Rieken +* John Vilk * Jonathan Bond-Caron * Jonathan Park * Jonathan Turner * Josh Kalderimis +* Julian Williams * Kagami Sascha Rosylight * Keith Mashinter +* Ken Howard * Kenji Imamula * Lorant Pinter +* Martin VÅ¡etiÄka * Masahiro Wakame * Max Deepfield * Micah Zoltu * Mohamed Hegazy +* Nathan Shively-Sanders * Oleg Mihailik * Oleksandr Chekhovskyi * Paul van Brenk * Pedro Maltez * Philip Bulley * piloopin +* @progre +* Punya Biswal * Ron Buckton * Ryan Cavanaugh +* Ryohei Ikegami +* Sébastien Arod * Sheetal Nandi * Shengping Zhong * Shyyko Serhiy -* Simon Hürlimann +* Simon Hürlimann * Solal Pirelli * Stan Thomas * Steve Lucco @@ -63,8 +76,10 @@ TypeScript is authored by: * togru * Tomas Grubliauskas * TruongSinh Tran-Nguyen +* Viliv Vane * Vladimir Matveev * Wesley Wigham +* York Yao * Yui Tanglertsampan * Zev Spitz -* Zhengbo Li \ No newline at end of file +* Zhengbo Li diff --git a/Jakefile.js b/Jakefile.js index 14bf047cf21..5dfbcc26d74 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -228,7 +228,7 @@ var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename); function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations, outDir, preserveConstEnums, keepComments, noResolve, stripInternal, callback) { file(outFile, prereqs, function() { var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler; - var options = "--module commonjs --noImplicitAny --noEmitOnError --pretty"; + var options = "--noImplicitAny --noEmitOnError --pretty"; // Keep comments when specifically requested // or when in debug mode. @@ -251,6 +251,9 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu if (!noOutFile) { options += " --out " + outFile; } + else { + options += " --module commonjs" + } if(noResolve) { options += " --noResolve"; diff --git a/README.md b/README.md index e27e7a99fa7..13e1f3e4786 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) -[![npm version](https://badge.fury.io/js/typescript.svg)](http://badge.fury.io/js/typescript) -[![Downloads](http://img.shields.io/npm/dm/TypeScript.svg)](https://npmjs.org/package/typescript) +[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) +[![Downloads](https://img.shields.io/npm/dm/TypeScript.svg)](https://www.npmjs.com/package/typescript) # TypeScript diff --git a/lib/tsc.js b/lib/tsc.js index bbbcedf0f47..87a413af729 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -665,7 +665,7 @@ var ts; } ts.fileExtensionIs = fileExtensionIs; ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.moduleFileExtensions = ts.supportedExtensions; + ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); function isSupportedSourceFileName(fileName) { if (!fileName) { return false; @@ -716,17 +716,16 @@ var ts; } function Signature(checker) { } + function Node(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0; + this.parent = undefined; + } ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0; - this.parent = undefined; - } - Node.prototype = { kind: kind }; - return Node; - }, + getNodeConstructor: function () { return Node; }, + getSourceFileConstructor: function () { return Node; }, getSymbolConstructor: function () { return Symbol; }, getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } @@ -1003,7 +1002,16 @@ var ts; if (writeByteOrderMark) { data = "\uFEFF" + data; } - _fs.writeFileSync(fileName, data, "utf8"); + var fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync(fd, data, undefined, "utf8"); + } + finally { + if (fd !== undefined) { + _fs.closeSync(fd); + } + } } function getCanonicalPath(path) { return useCaseSensitiveFileNames ? path.toLowerCase() : path; @@ -1688,6 +1696,7 @@ var ts; Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, + Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -2148,7 +2157,7 @@ var ts; function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; - while (true) { + while (pos < text.length) { var ch = text.charCodeAt(pos); switch (ch) { case 13: @@ -2217,6 +2226,7 @@ var ts; } return result; } + return result; } function getLeadingCommentRanges(text, pos) { return getCommentRanges(text, pos, false); @@ -2312,7 +2322,7 @@ var ts; error(ts.Diagnostics.Digit_expected); } } - return +(text.substring(start, end)); + return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -2704,7 +2714,7 @@ var ts; return pos++, token = 36; case 46: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8; } if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { @@ -2801,7 +2811,7 @@ var ts; case 55: case 56: case 57: - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8; case 58: return pos++, token = 54; @@ -3093,1034 +3103,6 @@ var ts; ts.createScanner = createScanner; })(ts || (ts = {})); var ts; -(function (ts) { - ts.bindTime = 0; - function or(state1, state2) { - return (state1 | state2) & 2 - ? 2 - : (state1 & state2) & 8 - ? 8 - : 4; - } - function getModuleInstanceState(node) { - if (node.kind === 215 || node.kind === 216) { - return 0; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2; - } - else if ((node.kind === 222 || node.kind === 221) && !(node.flags & 2)) { - return 0; - } - else if (node.kind === 219) { - var state = 0; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0: - return false; - case 2: - state = 2; - return false; - case 1: - state = 1; - return true; - } - }); - return state; - } - else if (node.kind === 218) { - return getModuleInstanceState(node.body); - } - else { - return 1; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - var binder = createBinder(); - function bindSourceFile(file, options) { - var start = new Date().getTime(); - binder(file, options); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function createBinder() { - var file; - var options; - var parent; - var container; - var blockScopeContainer; - var lastContainer; - var seenThisKeyword; - var hasExplicitReturn; - var currentReachabilityState; - var labelStack; - var labelIndexMap; - var implicitLabels; - var inStrictMode; - var symbolCount = 0; - var Symbol; - var classifiableNames; - function bindSourceFile(f, opts) { - file = f; - options = opts; - inStrictMode = !!file.externalModuleIndicator; - classifiableNames = {}; - Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - bind(file); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; - } - parent = undefined; - container = undefined; - blockScopeContainer = undefined; - lastContainer = undefined; - seenThisKeyword = false; - hasExplicitReturn = false; - labelStack = undefined; - labelIndexMap = undefined; - implicitLabels = undefined; - } - return bindSourceFile; - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolFlags) { - symbol.flags |= symbolFlags; - node.symbol = symbol; - if (!symbol.declarations) { - symbol.declarations = []; - } - symbol.declarations.push(node); - if (symbolFlags & 1952 && !symbol.exports) { - symbol.exports = {}; - } - if (symbolFlags & 6240 && !symbol.members) { - symbol.members = {}; - } - if (symbolFlags & 107455 && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; - } - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 218 && node.name.kind === 9) { - return "\"" + node.name.text + "\""; - } - if (node.name.kind === 136) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 144: - return "__constructor"; - case 152: - case 147: - return "__call"; - case 153: - case 148: - return "__new"; - case 149: - return "__index"; - case 228: - return "__export"; - case 227: - return node.isExportEquals ? "export=" : "default"; - case 213: - case 214: - return node.flags & 512 ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbolTable, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var isDefaultExport = node.flags & 512; - var name = isDefaultExport && parent ? "default" : getDeclarationName(node); - var symbol; - if (name !== undefined) { - symbol = ts.hasProperty(symbolTable, name) - ? symbolTable[name] - : (symbolTable[name] = createSymbol(0, name)); - if (name && (includes & 788448)) { - classifiableNames[name] = name; - } - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.flags & 512) { - message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; - } - }); - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - return symbol; - } - function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; - if (symbolFlags & 8388608) { - if (node.kind === 230 || (node.kind === 221 && hasExportModifier)) { - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - else { - if (hasExportModifier || container.flags & 131072) { - var exportKind = (symbolFlags & 107455 ? 1048576 : 0) | - (symbolFlags & 793056 ? 2097152 : 0) | - (symbolFlags & 1536 ? 4194304 : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - node.localSymbol = local; - return local; - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - } - function bindChildren(node) { - var saveParent = parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - parent = node; - var containerFlags = getContainerFlags(node); - if (containerFlags & 1) { - container = blockScopeContainer = node; - if (containerFlags & 4) { - container.locals = {}; - } - addToContainerChain(container); - } - else if (containerFlags & 2) { - blockScopeContainer = node; - blockScopeContainer.locals = undefined; - } - var savedReachabilityState; - var savedLabelStack; - var savedLabels; - var savedImplicitLabels; - var savedHasExplicitReturn; - var kind = node.kind; - var flags = node.flags; - flags &= ~1572864; - if (kind === 215) { - seenThisKeyword = false; - } - var saveState = kind === 248 || kind === 219 || ts.isFunctionLikeKind(kind); - if (saveState) { - savedReachabilityState = currentReachabilityState; - savedLabelStack = labelStack; - savedLabels = labelIndexMap; - savedImplicitLabels = implicitLabels; - savedHasExplicitReturn = hasExplicitReturn; - currentReachabilityState = 2; - hasExplicitReturn = false; - labelStack = labelIndexMap = implicitLabels = undefined; - } - bindReachableStatement(node); - if (currentReachabilityState === 2 && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { - flags |= 524288; - if (hasExplicitReturn) { - flags |= 1048576; - } - } - if (kind === 215) { - flags = seenThisKeyword ? flags | 262144 : flags & ~262144; - } - node.flags = flags; - if (saveState) { - hasExplicitReturn = savedHasExplicitReturn; - currentReachabilityState = savedReachabilityState; - labelStack = savedLabelStack; - labelIndexMap = savedLabels; - implicitLabels = savedImplicitLabels; - } - container = saveContainer; - parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - function bindReachableStatement(node) { - if (checkUnreachable(node)) { - ts.forEachChild(node, bind); - return; - } - switch (node.kind) { - case 198: - bindWhileStatement(node); - break; - case 197: - bindDoStatement(node); - break; - case 199: - bindForStatement(node); - break; - case 200: - case 201: - bindForInOrForOfStatement(node); - break; - case 196: - bindIfStatement(node); - break; - case 204: - case 208: - bindReturnOrThrow(node); - break; - case 203: - case 202: - bindBreakOrContinueStatement(node); - break; - case 209: - bindTryStatement(node); - break; - case 206: - bindSwitchStatement(node); - break; - case 220: - bindCaseBlock(node); - break; - case 207: - bindLabeledStatement(node); - break; - default: - ts.forEachChild(node, bind); - break; - } - } - function bindWhileStatement(n) { - var preWhileState = n.expression.kind === 84 ? 4 : currentReachabilityState; - var postWhileState = n.expression.kind === 99 ? 4 : currentReachabilityState; - bind(n.expression); - currentReachabilityState = preWhileState; - var postWhileLabel = pushImplicitLabel(); - bind(n.statement); - popImplicitLabel(postWhileLabel, postWhileState); - } - function bindDoStatement(n) { - var preDoState = currentReachabilityState; - var postDoLabel = pushImplicitLabel(); - bind(n.statement); - var postDoState = n.expression.kind === 99 ? 4 : preDoState; - popImplicitLabel(postDoLabel, postDoState); - bind(n.expression); - } - function bindForStatement(n) { - var preForState = currentReachabilityState; - var postForLabel = pushImplicitLabel(); - bind(n.initializer); - bind(n.condition); - bind(n.incrementor); - bind(n.statement); - var isInfiniteLoop = (!n.condition || n.condition.kind === 99); - var postForState = isInfiniteLoop ? 4 : preForState; - popImplicitLabel(postForLabel, postForState); - } - function bindForInOrForOfStatement(n) { - var preStatementState = currentReachabilityState; - var postStatementLabel = pushImplicitLabel(); - bind(n.initializer); - bind(n.expression); - bind(n.statement); - popImplicitLabel(postStatementLabel, preStatementState); - } - function bindIfStatement(n) { - var ifTrueState = n.expression.kind === 84 ? 4 : currentReachabilityState; - var ifFalseState = n.expression.kind === 99 ? 4 : currentReachabilityState; - currentReachabilityState = ifTrueState; - bind(n.expression); - bind(n.thenStatement); - if (n.elseStatement) { - var preElseState = currentReachabilityState; - currentReachabilityState = ifFalseState; - bind(n.elseStatement); - currentReachabilityState = or(currentReachabilityState, preElseState); - } - else { - currentReachabilityState = or(currentReachabilityState, ifFalseState); - } - } - function bindReturnOrThrow(n) { - bind(n.expression); - if (n.kind === 204) { - hasExplicitReturn = true; - } - currentReachabilityState = 4; - } - function bindBreakOrContinueStatement(n) { - bind(n.label); - var isValidJump = jumpToLabel(n.label, n.kind === 203 ? currentReachabilityState : 4); - if (isValidJump) { - currentReachabilityState = 4; - } - } - function bindTryStatement(n) { - var preTryState = currentReachabilityState; - bind(n.tryBlock); - var postTryState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.catchClause); - var postCatchState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.finallyBlock); - currentReachabilityState = or(postTryState, postCatchState); - } - function bindSwitchStatement(n) { - var preSwitchState = currentReachabilityState; - var postSwitchLabel = pushImplicitLabel(); - bind(n.expression); - bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242; }); - var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; - popImplicitLabel(postSwitchLabel, postSwitchState); - } - function bindCaseBlock(n) { - var startState = currentReachabilityState; - for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { - var clause = _a[_i]; - currentReachabilityState = startState; - bind(clause); - if (clause.statements.length && currentReachabilityState === 2 && options.noFallthroughCasesInSwitch) { - errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); - } - } - } - function bindLabeledStatement(n) { - bind(n.label); - var ok = pushNamedLabel(n.label); - bind(n.statement); - if (ok) { - popNamedLabel(n.label, currentReachabilityState); - } - } - function getContainerFlags(node) { - switch (node.kind) { - case 186: - case 214: - case 215: - case 217: - case 155: - case 165: - return 1; - case 147: - case 148: - case 149: - case 143: - case 142: - case 213: - case 144: - case 145: - case 146: - case 152: - case 153: - case 173: - case 174: - case 218: - case 248: - case 216: - return 5; - case 244: - case 199: - case 200: - case 201: - case 220: - return 2; - case 192: - return ts.isFunctionLike(node.parent) ? 0 : 2; - } - return 0; - } - function addToContainerChain(next) { - if (lastContainer) { - lastContainer.nextContainer = next; - } - lastContainer = next; - } - function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { - declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); - } - function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { - switch (container.kind) { - case 218: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186: - case 214: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 217: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155: - case 165: - case 215: - return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152: - case 153: - case 147: - case 148: - case 149: - case 143: - case 142: - case 144: - case 145: - case 146: - case 213: - case 173: - case 174: - case 216: - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function declareClassMember(node, symbolFlags, symbolExcludes) { - return node.flags & 64 - ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) - : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - } - function declareSourceFileMember(node, symbolFlags, symbolExcludes) { - return ts.isExternalModule(file) - ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); - } - function hasExportDeclarations(node) { - var body = node.kind === 248 ? node : node.body; - if (body.kind === 248 || body.kind === 219) { - for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { - var stat = _a[_i]; - if (stat.kind === 228 || stat.kind === 227) { - return true; - } - } - } - return false; - } - function setExportContextFlag(node) { - if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 131072; - } - else { - node.flags &= ~131072; - } - } - function bindModuleDeclaration(node) { - setExportContextFlag(node); - if (node.name.kind === 9) { - declareSymbolAndAddToSymbolTable(node, 512, 106639); - } - else { - var state = getModuleInstanceState(node); - if (state === 0) { - declareSymbolAndAddToSymbolTable(node, 1024, 0); - } - else { - declareSymbolAndAddToSymbolTable(node, 512, 106639); - if (node.symbol.flags & (16 | 32 | 256)) { - node.symbol.constEnumOnlyModule = false; - } - else { - var currentModuleIsConstEnumOnly = state === 2; - if (node.symbol.constEnumOnlyModule === undefined) { - node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; - } - else { - node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; - } - } - } - } - } - function bindFunctionOrConstructorType(node) { - var symbol = createSymbol(131072, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072); - var typeLiteralSymbol = createSymbol(2048, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048); - typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); - var _a; - } - function bindObjectLiteralExpression(node) { - if (inStrictMode) { - var seen = {}; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; - if (prop.name.kind !== 69) { - continue; - } - var identifier = prop.name; - var currentKind = prop.kind === 245 || prop.kind === 246 || prop.kind === 143 - ? 1 - : 2; - var existingKind = seen[identifier.text]; - if (!existingKind) { - seen[identifier.text] = currentKind; - continue; - } - if (currentKind === 1 && existingKind === 1) { - var span = ts.getErrorSpanForNode(file, identifier); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); - } - } - } - return bindAnonymousDeclaration(node, 4096, "__object"); - } - function bindAnonymousDeclaration(node, symbolFlags, name) { - var symbol = createSymbol(symbolFlags, name); - addDeclarationToSymbol(symbol, node, symbolFlags); - } - function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { - switch (blockScopeContainer.kind) { - case 218: - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - case 248: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - } - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - addToContainerChain(blockScopeContainer); - } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2, 107455); - } - function checkStrictModeIdentifier(node) { - if (inStrictMode && - node.originalKeywordKind >= 106 && - node.originalKeywordKind <= 114 && - !ts.isIdentifierName(node)) { - if (!file.parseDiagnostics.length) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); - } - } - } - function getStrictModeIdentifierMessage(node) { - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; - } - function checkStrictModeBinaryExpression(node) { - if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { - checkStrictModeEvalOrArguments(node, node.left); - } - } - function checkStrictModeCatchClause(node) { - if (inStrictMode && node.variableDeclaration) { - checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); - } - } - function checkStrictModeDeleteExpression(node) { - if (inStrictMode && node.expression.kind === 69) { - var span = ts.getErrorSpanForNode(file, node.expression); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); - } - } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 && - (node.text === "eval" || node.text === "arguments"); - } - function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 69) { - var identifier = name; - if (isEvalOrArgumentsIdentifier(identifier)) { - var span = ts.getErrorSpanForNode(file, name); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); - } - } - } - function getStrictModeEvalOrArgumentsMessage(node) { - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; - } - function checkStrictModeFunctionName(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - } - function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.flags & 32768) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); - } - } - function checkStrictModePostfixUnaryExpression(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - function checkStrictModePrefixUnaryExpression(node) { - if (inStrictMode) { - if (node.operator === 41 || node.operator === 42) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - } - function checkStrictModeWithStatement(node) { - if (inStrictMode) { - errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - function errorOnFirstToken(node, message, arg0, arg1, arg2) { - var span = ts.getSpanOfTokenAtPosition(file, node.pos); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - if (!node) { - return; - } - node.parent = parent; - var savedInStrictMode = inStrictMode; - if (!savedInStrictMode) { - updateStrictMode(node); - } - bindWorker(node); - bindChildren(node); - inStrictMode = savedInStrictMode; - } - function updateStrictMode(node) { - switch (node.kind) { - case 248: - case 219: - updateStrictModeStatementList(node.statements); - return; - case 192: - if (ts.isFunctionLike(node.parent)) { - updateStrictModeStatementList(node.statements); - } - return; - case 214: - case 186: - inStrictMode = true; - return; - } - } - function updateStrictModeStatementList(statements) { - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (!ts.isPrologueDirective(statement)) { - return; - } - if (isUseStrictPrologueDirective(statement)) { - inStrictMode = true; - return; - } - } - } - function isUseStrictPrologueDirective(node) { - var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); - return nodeText === "\"use strict\"" || nodeText === "'use strict'"; - } - function bindWorker(node) { - switch (node.kind) { - case 69: - return checkStrictModeIdentifier(node); - case 181: - return checkStrictModeBinaryExpression(node); - case 244: - return checkStrictModeCatchClause(node); - case 175: - return checkStrictModeDeleteExpression(node); - case 8: - return checkStrictModeNumericLiteral(node); - case 180: - return checkStrictModePostfixUnaryExpression(node); - case 179: - return checkStrictModePrefixUnaryExpression(node); - case 205: - return checkStrictModeWithStatement(node); - case 97: - seenThisKeyword = true; - return; - case 137: - return declareSymbolAndAddToSymbolTable(node, 262144, 530912); - case 138: - return bindParameter(node); - case 211: - case 163: - return bindVariableDeclarationOrBindingElement(node); - case 141: - case 140: - return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); - case 245: - case 246: - return bindPropertyOrMethodOrAccessor(node, 4, 107455); - case 247: - return bindPropertyOrMethodOrAccessor(node, 8, 107455); - case 147: - case 148: - case 149: - return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 143: - case 142: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); - case 213: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16, 106927); - case 144: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); - case 145: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); - case 146: - return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 152: - case 153: - return bindFunctionOrConstructorType(node); - case 155: - return bindAnonymousDeclaration(node, 2048, "__type"); - case 165: - return bindObjectLiteralExpression(node); - case 173: - case 174: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16, bindingName); - case 186: - case 214: - return bindClassLikeDeclaration(node); - case 215: - return bindBlockScopedDeclaration(node, 64, 792960); - case 216: - return bindBlockScopedDeclaration(node, 524288, 793056); - case 217: - return bindEnumDeclaration(node); - case 218: - return bindModuleDeclaration(node); - case 221: - case 224: - case 226: - case 230: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 223: - return bindImportClause(node); - case 228: - return bindExportDeclaration(node); - case 227: - return bindExportAssignment(node); - case 248: - return bindSourceFileIfExternalModule(); - } - } - function bindSourceFileIfExternalModule() { - setExportContextFlag(file); - if (ts.isExternalModule(file)) { - bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); - } - } - function bindExportAssignment(node) { - if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); - } - else if (node.expression.kind === 69) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); - } - } - function bindExportDeclaration(node) { - if (!container.symbol || !container.symbol.exports) { - bindAnonymousDeclaration(node, 1073741824, getDeclarationName(node)); - } - else if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); - } - } - function bindImportClause(node) { - if (node.name) { - declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - } - } - function bindClassLikeDeclaration(node) { - if (node.kind === 214) { - bindBlockScopedDeclaration(node, 32, 899519); - } - else { - var bindingName = node.name ? node.name.text : "__class"; - bindAnonymousDeclaration(node, 32, bindingName); - if (node.name) { - classifiableNames[node.name.text] = node.name.text; - } - } - var symbol = node.symbol; - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - function bindEnumDeclaration(node) { - return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128, 899967) - : bindBlockScopedDeclaration(node, 256, 899327); - } - function bindVariableDeclarationOrBindingElement(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (!ts.isBindingPattern(node.name)) { - if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else if (ts.isParameterDeclaration(node)) { - declareSymbolAndAddToSymbolTable(node, 1, 107455); - } - else { - declareSymbolAndAddToSymbolTable(node, 1, 107454); - } - } - } - function bindParameter(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node)); - } - else { - declareSymbolAndAddToSymbolTable(node, 1, 107455); - } - if (node.flags & 56 && - node.parent.kind === 144 && - ts.isClassLike(node.parent.parent)) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - return ts.hasDynamicName(node) - ? bindAnonymousDeclaration(node, symbolFlags, "__computed") - : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - function pushNamedLabel(name) { - initializeReachabilityStateIfNecessary(); - if (ts.hasProperty(labelIndexMap, name.text)) { - return false; - } - labelIndexMap[name.text] = labelStack.push(1) - 1; - return true; - } - function pushImplicitLabel() { - initializeReachabilityStateIfNecessary(); - var index = labelStack.push(1) - 1; - implicitLabels.push(index); - return index; - } - function popNamedLabel(label, outerState) { - var index = labelIndexMap[label.text]; - ts.Debug.assert(index !== undefined); - ts.Debug.assert(labelStack.length == index + 1); - labelIndexMap[label.text] = undefined; - setCurrentStateAtLabel(labelStack.pop(), outerState, label); - } - function popImplicitLabel(implicitLabelIndex, outerState) { - if (labelStack.length !== implicitLabelIndex + 1) { - ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); - } - var i = implicitLabels.pop(); - if (implicitLabelIndex !== i) { - ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); - } - setCurrentStateAtLabel(labelStack.pop(), outerState, undefined); - } - function setCurrentStateAtLabel(innerMergedState, outerState, label) { - if (innerMergedState === 1) { - if (label && !options.allowUnusedLabels) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); - } - currentReachabilityState = outerState; - } - else { - currentReachabilityState = or(innerMergedState, outerState); - } - } - function jumpToLabel(label, outerState) { - initializeReachabilityStateIfNecessary(); - var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); - if (index === undefined) { - return false; - } - var stateAtLabel = labelStack[index]; - labelStack[index] = stateAtLabel === 1 ? outerState : or(stateAtLabel, outerState); - return true; - } - function checkUnreachable(node) { - switch (currentReachabilityState) { - case 4: - var reportError = ts.isStatement(node) || - node.kind === 214 || - (node.kind === 218 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 217 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); - if (reportError) { - currentReachabilityState = 8; - var reportUnreachableCode = !options.allowUnreachableCode && - !ts.isInAmbientContext(node) && - (node.kind !== 193 || - ts.getCombinedNodeFlags(node.declarationList) & 24576 || - ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); - if (reportUnreachableCode) { - errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); - } - } - case 8: - return true; - default: - return false; - } - function shouldReportErrorOnModuleDeclaration(node) { - var instanceState = getModuleInstanceState(node); - return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums); - } - } - function initializeReachabilityStateIfNecessary() { - if (labelIndexMap) { - return; - } - currentReachabilityState = 2; - labelIndexMap = {}; - labelStack = []; - implicitLabels = []; - } - } -})(ts || (ts = {})); -var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -4396,6 +3378,10 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isDeclarationFile(file) { return (file.flags & 4096) !== 0; } @@ -4442,18 +3428,26 @@ var ts; return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getLeadingCommentRangesOfNodeFromText(node, text) { + return ts.getLeadingCommentRanges(text, node.pos); + } + ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJsDocComments(node, sourceFileOfNode) { - var commentRanges = (node.kind === 138 || node.kind === 137) ? - ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : - getLeadingCommentRangesOfNode(node, sourceFileOfNode); - return ts.filter(commentRanges, isJsDocComment); - function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; - } + return getJsDocCommentsFromText(node, sourceFileOfNode.text); } ts.getJsDocComments = getJsDocComments; + function getJsDocCommentsFromText(node, text) { + var commentRanges = (node.kind === 138 || node.kind === 137) ? + ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); + return ts.filter(commentRanges, isJsDocComment); + function isJsDocComment(comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 42 && + text.charCodeAt(comment.pos + 3) !== 47; + } + } + ts.getJsDocCommentsFromText = getJsDocCommentsFromText; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { @@ -4982,6 +3976,41 @@ var ts; return node.kind === 221 && node.moduleReference.kind !== 232; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJavaScript(file) { + return isInJavaScriptFile(file); + } + ts.isSourceFileJavaScript = isSourceFileJavaScript; + function isInJavaScriptFile(node) { + return node && !!(node.parserContextFlags & 32); + } + ts.isInJavaScriptFile = isInJavaScriptFile; + function isRequireCall(expression) { + return expression.kind === 168 && + expression.expression.kind === 69 && + expression.expression.text === "require" && + expression.arguments.length === 1 && + expression.arguments[0].kind === 9; + } + ts.isRequireCall = isRequireCall; + function isExportsPropertyAssignment(expression) { + return isInJavaScriptFile(expression) && + (expression.kind === 181) && + (expression.operatorToken.kind === 56) && + (expression.left.kind === 166) && + (expression.left.expression.kind === 69) && + ((expression.left.expression).text === "exports"); + } + ts.isExportsPropertyAssignment = isExportsPropertyAssignment; + function isModuleExportsAssignment(expression) { + return isInJavaScriptFile(expression) && + (expression.kind === 181) && + (expression.operatorToken.kind === 56) && + (expression.left.kind === 166) && + (expression.left.expression.kind === 69) && + ((expression.left.expression).text === "module") && + (expression.left.name.text === "exports"); + } + ts.isModuleExportsAssignment = isModuleExportsAssignment; function getExternalModuleName(node) { if (node.kind === 222) { return node.moduleSpecifier; @@ -5293,8 +4322,8 @@ var ts; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -5336,12 +4365,20 @@ var ts; return isFunctionLike(node) && (node.flags & 256) !== 0 && !isAccessor(node); } ts.isAsyncFunctionLike = isAsyncFunctionLike; + function isStringOrNumericLiteral(kind) { + return kind === 9 || kind === 8; + } + ts.isStringOrNumericLiteral = isStringOrNumericLiteral; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 136 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && isDynamicName(declaration.name); } ts.hasDynamicName = hasDynamicName; + function isDynamicName(name) { + return name.kind === 136 && + !isStringOrNumericLiteral(name.expression.kind) && + !isWellKnownSymbolSyntactically(name.expression); + } + ts.isDynamicName = isDynamicName; function isWellKnownSymbolSyntactically(node) { return isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression); } @@ -5562,11 +4599,11 @@ var ts; } ts.getIndentSize = getIndentSize; function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; + var output; + var indent; + var lineStart; + var lineCount; + var linePos; function write(s) { if (s && s.length) { if (lineStart) { @@ -5576,6 +4613,13 @@ var ts; output += s; } } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } function rawWrite(s) { if (s !== undefined) { if (lineStart) { @@ -5602,9 +4646,10 @@ var ts; lineStart = true; } } - function writeTextOfNode(sourceFile, node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + function writeTextOfNode(text, node) { + write(getTextOfNodeFromSourceText(text, node)); } + reset(); return { write: write, rawWrite: rawWrite, @@ -5617,10 +4662,17 @@ var ts; getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + getText: function () { return output; }, + reset: reset }; } ts.createTextWriter = createTextWriter; + function getExternalModuleNameFromPath(host, fileName) { + var dir = host.getCurrentDirectory(); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, false); + return ts.removeFileExtension(relativePath); + } + ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); var emitOutputFilePathWithoutExtension; @@ -5649,6 +4701,10 @@ var ts; return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; + } + ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { if (member.kind === 144 && nodeIsPresent(member.body)) { @@ -5719,21 +4775,21 @@ var ts; }; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + getLineOfLocalPositionFromLineMap(lineMap, node.pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { writer.writeLine(); } } ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + function emitComments(text, lineMap, writer, comments, trailingSeparator, newLine, writeComment) { var emitLeadingSpace = !trailingSeparator; ts.forEach(comments, function (comment) { if (emitLeadingSpace) { writer.write(" "); emitLeadingSpace = false; } - writeComment(currentSourceFile, writer, comment, newLine); + writeComment(text, lineMap, writer, comment, newLine); if (comment.hasTrailingNewLine) { writer.writeLine(); } @@ -5746,16 +4802,16 @@ var ts; }); } ts.emitComments = emitComments; - function emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, removeComments) { + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); } } else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + leadingComments = ts.getLeadingCommentRanges(text, node.pos); } if (leadingComments) { var detachedComments = []; @@ -5763,8 +4819,8 @@ var ts; for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { var comment = leadingComments_1[_i]; if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); if (commentLine >= lastCommentLine + 2) { break; } @@ -5773,37 +4829,37 @@ var ts; lastComment = comment; } if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments(text, lineMap, writer, detachedComments, true, newLine, writeComment); currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; } } } return currentDetachedCommentInfo; function isPinnedComment(comment) { - return currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; } } ts.emitDetachedComments = emitDetachedComments; - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; + function writeCommentRange(text, lineMap, writer, comment, newLine) { + if (text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, comment.pos); + var lineCount = lineMap.length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : getStartPositionOfLine(currentLine + 1, currentSourceFile); + ? text.length + 1 + : lineMap[currentLine + 1]; if (pos !== comment.pos) { if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], comment.pos); } var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); @@ -5817,40 +4873,40 @@ var ts; writer.rawWrite(""); } } - writeTrimmedCurrentLine(pos, nextLineStart); + writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart); pos = nextLineStart; } } else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ""); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; + writer.write(text.substring(comment.pos, comment.end)); } } ts.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } function modifierToFlag(token) { switch (token) { case 113: return 64; @@ -5944,14 +5000,14 @@ var ts; return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 512) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function isJavaScript(fileName) { - return ts.fileExtensionIs(fileName, ".js"); + function hasJavaScriptFileExtension(fileName) { + return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isJavaScript = isJavaScript; - function isTsx(fileName) { - return ts.fileExtensionIs(fileName, ".tsx"); + ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; + function allowsJsxExpressions(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isTsx = isTsx; + ts.allowsJsxExpressions = allowsJsxExpressions; function getExpandedCharCodes(input) { var output = []; var length = input.length; @@ -6161,14 +5217,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(272); ts.parseTime = 0; - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; + var NodeConstructor; + var SourceFileConstructor; function createNode(kind, pos, end) { - return new (getNodeConstructor(kind))(pos, end); + if (kind === 248) { + return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); + } + else { + return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, pos, end); + } } ts.createNode = createNode; function visitNode(cbNode, node) { @@ -6567,6 +5625,8 @@ var ts; (function (Parser) { var scanner = ts.createScanner(2, true); var disallowInAndDecoratorContext = 1 | 4; + var NodeConstructor; + var SourceFileConstructor; var sourceFile; var parseDiagnostics; var syntaxCursor; @@ -6579,13 +5639,16 @@ var ts; var contextFlags; var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(fileName) || _sourceText.lastIndexOf("// @language=javascript", 0) === 0; + initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); clearState(); return result; } Parser.parseSourceFile = parseSourceFile; - function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor) { + function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { + NodeConstructor = ts.objectAllocator.getNodeConstructor(); + SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); sourceText = _sourceText; syntaxCursor = _syntaxCursor; parseDiagnostics = []; @@ -6593,12 +5656,12 @@ var ts; identifiers = {}; identifierCount = 0; nodeCount = 0; - contextFlags = ts.isJavaScript(fileName) ? 32 : 0; + contextFlags = isJavaScriptFile ? 32 : 0; parseErrorBeforeNextFinishedNode = false; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.isTsx(fileName) ? 1 : 0); + scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 : 0); } function clearState() { scanner.setText(""); @@ -6611,6 +5674,9 @@ var ts; } function parseSourceFileWorker(fileName, languageVersion, setParentNodes) { sourceFile = createSourceFile(fileName, languageVersion); + if (contextFlags & 32) { + sourceFile.parserContextFlags = 32; + } token = nextToken(); processReferenceComments(sourceFile); sourceFile.statements = parseList(0, parseStatement); @@ -6624,7 +5690,7 @@ var ts; if (setParentNodes) { fixupParentReferences(sourceFile); } - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { addJSDocComments(); } return sourceFile; @@ -6670,15 +5736,14 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = createNode(248, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; + var sourceFile = new SourceFileConstructor(248, 0, sourceText.length); + nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 : 0; - sourceFile.languageVariant = ts.isTsx(sourceFile.fileName) ? 1 : 0; + sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 : 0; return sourceFile; } function setContextFlag(val, flag) { @@ -6900,7 +5965,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(pos, pos); + return new NodeConstructor(kind, pos, pos); } function finishNode(node, end) { node.end = end === undefined ? scanner.getStartPos() : end; @@ -7038,7 +6103,7 @@ var ts; case 12: return token === 19 || token === 37 || isLiteralPropertyName(); case 9: - return isLiteralPropertyName(); + return token === 19 || isLiteralPropertyName(); case 7: if (token === 15) { return lookAhead(isValidHeritageClauseObjectLiteral); @@ -7559,9 +6624,7 @@ var ts; } function parseParameterType() { if (parseOptional(54)) { - return token === 9 - ? parseLiteralNode(true) - : parseType(); + return parseType(); } return undefined; } @@ -7818,6 +6881,8 @@ var ts; case 131: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); + case 9: + return parseLiteralNode(true); case 103: case 97: return parseTokenNode(); @@ -7847,6 +6912,7 @@ var ts; case 19: case 25: case 92: + case 9: return true; case 17: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -8360,7 +7426,6 @@ var ts; var unaryOperator = token; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { - var diagnostic; var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); if (simpleUnaryExpression.kind === 171) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); @@ -10024,7 +9089,7 @@ var ts; } JSDocParser.isJSDocType = isJSDocType; function parseJSDocTypeExpressionForTests(content, start, length) { - initializeState("file.js", content, 2, undefined); + initializeState("file.js", content, 2, true, undefined); var jsDocTypeExpression = parseJSDocTypeExpression(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -10275,7 +9340,7 @@ var ts; } } function parseIsolatedJSDocComment(content, start, length) { - initializeState("file.js", content, 2, undefined); + initializeState("file.js", content, 2, true, undefined); var jsDocComment = parseJSDocComment(undefined, start, length); var diagnostics = parseDiagnostics; clearState(); @@ -10794,6 +9859,1075 @@ var ts; })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); var ts; +(function (ts) { + ts.bindTime = 0; + function or(state1, state2) { + return (state1 | state2) & 2 + ? 2 + : (state1 & state2) & 8 + ? 8 + : 4; + } + function getModuleInstanceState(node) { + if (node.kind === 215 || node.kind === 216) { + return 0; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2; + } + else if ((node.kind === 222 || node.kind === 221) && !(node.flags & 2)) { + return 0; + } + else if (node.kind === 219) { + var state = 0; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0: + return false; + case 2: + state = 2; + return false; + case 1: + state = 1; + return true; + } + }); + return state; + } + else if (node.kind === 218) { + return getModuleInstanceState(node.body); + } + else { + return 1; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + var binder = createBinder(); + function bindSourceFile(file, options) { + var start = new Date().getTime(); + binder(file, options); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function createBinder() { + var file; + var options; + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var seenThisKeyword; + var hasExplicitReturn; + var currentReachabilityState; + var labelStack; + var labelIndexMap; + var implicitLabels; + var inStrictMode; + var symbolCount = 0; + var Symbol; + var classifiableNames; + function bindSourceFile(f, opts) { + file = f; + options = opts; + inStrictMode = !!file.externalModuleIndicator; + classifiableNames = {}; + Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + bind(file); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + } + parent = undefined; + container = undefined; + blockScopeContainer = undefined; + lastContainer = undefined; + seenThisKeyword = false; + hasExplicitReturn = false; + labelStack = undefined; + labelIndexMap = undefined; + implicitLabels = undefined; + } + return bindSourceFile; + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function addDeclarationToSymbol(symbol, node, symbolFlags) { + symbol.flags |= symbolFlags; + node.symbol = symbol; + if (!symbol.declarations) { + symbol.declarations = []; + } + symbol.declarations.push(node); + if (symbolFlags & 1952 && !symbol.exports) { + symbol.exports = {}; + } + if (symbolFlags & 6240 && !symbol.members) { + symbol.members = {}; + } + if (symbolFlags & 107455 && !symbol.valueDeclaration) { + symbol.valueDeclaration = node; + } + } + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 218 && node.name.kind === 9) { + return "\"" + node.name.text + "\""; + } + if (node.name.kind === 136) { + var nameExpression = node.name.expression; + if (ts.isStringOrNumericLiteral(nameExpression.kind)) { + return nameExpression.text; + } + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 144: + return "__constructor"; + case 152: + case 147: + return "__call"; + case 153: + case 148: + return "__new"; + case 149: + return "__index"; + case 228: + return "__export"; + case 227: + return node.isExportEquals ? "export=" : "default"; + case 181: + return "export="; + case 213: + case 214: + return node.flags & 512 ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbolTable, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var isDefaultExport = node.flags & 512; + var name = isDefaultExport && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + symbol = ts.hasProperty(symbolTable, name) + ? symbolTable[name] + : (symbolTable[name] = createSymbol(0, name)); + if (name && (includes & 788448)) { + classifiableNames[name] = name; + } + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + var message = symbol.flags & 2 + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.flags & 512) { + message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; + } + }); + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + return symbol; + } + function declareModuleMember(node, symbolFlags, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; + if (symbolFlags & 8388608) { + if (node.kind === 230 || (node.kind === 221 && hasExportModifier)) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + else { + if (hasExportModifier || container.flags & 131072) { + var exportKind = (symbolFlags & 107455 ? 1048576 : 0) | + (symbolFlags & 793056 ? 2097152 : 0) | + (symbolFlags & 1536 ? 4194304 : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + node.localSymbol = local; + return local; + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + } + function bindChildren(node) { + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + parent = node; + var containerFlags = getContainerFlags(node); + if (containerFlags & 1) { + container = blockScopeContainer = node; + if (containerFlags & 4) { + container.locals = {}; + } + addToContainerChain(container); + } + else if (containerFlags & 2) { + blockScopeContainer = node; + blockScopeContainer.locals = undefined; + } + var savedReachabilityState; + var savedLabelStack; + var savedLabels; + var savedImplicitLabels; + var savedHasExplicitReturn; + var kind = node.kind; + var flags = node.flags; + flags &= ~1572864; + if (kind === 215) { + seenThisKeyword = false; + } + var saveState = kind === 248 || kind === 219 || ts.isFunctionLikeKind(kind); + if (saveState) { + savedReachabilityState = currentReachabilityState; + savedLabelStack = labelStack; + savedLabels = labelIndexMap; + savedImplicitLabels = implicitLabels; + savedHasExplicitReturn = hasExplicitReturn; + currentReachabilityState = 2; + hasExplicitReturn = false; + labelStack = labelIndexMap = implicitLabels = undefined; + } + bindReachableStatement(node); + if (currentReachabilityState === 2 && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { + flags |= 524288; + if (hasExplicitReturn) { + flags |= 1048576; + } + } + if (kind === 215) { + flags = seenThisKeyword ? flags | 262144 : flags & ~262144; + } + node.flags = flags; + if (saveState) { + hasExplicitReturn = savedHasExplicitReturn; + currentReachabilityState = savedReachabilityState; + labelStack = savedLabelStack; + labelIndexMap = savedLabels; + implicitLabels = savedImplicitLabels; + } + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindReachableStatement(node) { + if (checkUnreachable(node)) { + ts.forEachChild(node, bind); + return; + } + switch (node.kind) { + case 198: + bindWhileStatement(node); + break; + case 197: + bindDoStatement(node); + break; + case 199: + bindForStatement(node); + break; + case 200: + case 201: + bindForInOrForOfStatement(node); + break; + case 196: + bindIfStatement(node); + break; + case 204: + case 208: + bindReturnOrThrow(node); + break; + case 203: + case 202: + bindBreakOrContinueStatement(node); + break; + case 209: + bindTryStatement(node); + break; + case 206: + bindSwitchStatement(node); + break; + case 220: + bindCaseBlock(node); + break; + case 207: + bindLabeledStatement(node); + break; + default: + ts.forEachChild(node, bind); + break; + } + } + function bindWhileStatement(n) { + var preWhileState = n.expression.kind === 84 ? 4 : currentReachabilityState; + var postWhileState = n.expression.kind === 99 ? 4 : currentReachabilityState; + bind(n.expression); + currentReachabilityState = preWhileState; + var postWhileLabel = pushImplicitLabel(); + bind(n.statement); + popImplicitLabel(postWhileLabel, postWhileState); + } + function bindDoStatement(n) { + var preDoState = currentReachabilityState; + var postDoLabel = pushImplicitLabel(); + bind(n.statement); + var postDoState = n.expression.kind === 99 ? 4 : preDoState; + popImplicitLabel(postDoLabel, postDoState); + bind(n.expression); + } + function bindForStatement(n) { + var preForState = currentReachabilityState; + var postForLabel = pushImplicitLabel(); + bind(n.initializer); + bind(n.condition); + bind(n.incrementor); + bind(n.statement); + var isInfiniteLoop = (!n.condition || n.condition.kind === 99); + var postForState = isInfiniteLoop ? 4 : preForState; + popImplicitLabel(postForLabel, postForState); + } + function bindForInOrForOfStatement(n) { + var preStatementState = currentReachabilityState; + var postStatementLabel = pushImplicitLabel(); + bind(n.initializer); + bind(n.expression); + bind(n.statement); + popImplicitLabel(postStatementLabel, preStatementState); + } + function bindIfStatement(n) { + var ifTrueState = n.expression.kind === 84 ? 4 : currentReachabilityState; + var ifFalseState = n.expression.kind === 99 ? 4 : currentReachabilityState; + currentReachabilityState = ifTrueState; + bind(n.expression); + bind(n.thenStatement); + if (n.elseStatement) { + var preElseState = currentReachabilityState; + currentReachabilityState = ifFalseState; + bind(n.elseStatement); + currentReachabilityState = or(currentReachabilityState, preElseState); + } + else { + currentReachabilityState = or(currentReachabilityState, ifFalseState); + } + } + function bindReturnOrThrow(n) { + bind(n.expression); + if (n.kind === 204) { + hasExplicitReturn = true; + } + currentReachabilityState = 4; + } + function bindBreakOrContinueStatement(n) { + bind(n.label); + var isValidJump = jumpToLabel(n.label, n.kind === 203 ? currentReachabilityState : 4); + if (isValidJump) { + currentReachabilityState = 4; + } + } + function bindTryStatement(n) { + var preTryState = currentReachabilityState; + bind(n.tryBlock); + var postTryState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.catchClause); + var postCatchState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.finallyBlock); + currentReachabilityState = or(postTryState, postCatchState); + } + function bindSwitchStatement(n) { + var preSwitchState = currentReachabilityState; + var postSwitchLabel = pushImplicitLabel(); + bind(n.expression); + bind(n.caseBlock); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242; }); + var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; + popImplicitLabel(postSwitchLabel, postSwitchState); + } + function bindCaseBlock(n) { + var startState = currentReachabilityState; + for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { + var clause = _a[_i]; + currentReachabilityState = startState; + bind(clause); + if (clause.statements.length && currentReachabilityState === 2 && options.noFallthroughCasesInSwitch) { + errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); + } + } + } + function bindLabeledStatement(n) { + bind(n.label); + var ok = pushNamedLabel(n.label); + bind(n.statement); + if (ok) { + popNamedLabel(n.label, currentReachabilityState); + } + } + function getContainerFlags(node) { + switch (node.kind) { + case 186: + case 214: + case 215: + case 217: + case 155: + case 165: + return 1; + case 147: + case 148: + case 149: + case 143: + case 142: + case 213: + case 144: + case 145: + case 146: + case 152: + case 153: + case 173: + case 174: + case 218: + case 248: + case 216: + return 5; + case 244: + case 199: + case 200: + case 201: + case 220: + return 2; + case 192: + return ts.isFunctionLike(node.parent) ? 0 : 2; + } + return 0; + } + function addToContainerChain(next) { + if (lastContainer) { + lastContainer.nextContainer = next; + } + lastContainer = next; + } + function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { + declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); + } + function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { + switch (container.kind) { + case 218: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 248: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 186: + case 214: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 217: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 155: + case 165: + case 215: + return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 152: + case 153: + case 147: + case 148: + case 149: + case 143: + case 142: + case 144: + case 145: + case 146: + case 213: + case 173: + case 174: + case 216: + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function declareClassMember(node, symbolFlags, symbolExcludes) { + return node.flags & 64 + ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) + : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + } + function declareSourceFileMember(node, symbolFlags, symbolExcludes) { + return ts.isExternalModule(file) + ? declareModuleMember(node, symbolFlags, symbolExcludes) + : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + } + function hasExportDeclarations(node) { + var body = node.kind === 248 ? node : node.body; + if (body.kind === 248 || body.kind === 219) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 228 || stat.kind === 227) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 131072; + } + else { + node.flags &= ~131072; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 9) { + declareSymbolAndAddToSymbolTable(node, 512, 106639); + } + else { + var state = getModuleInstanceState(node); + if (state === 0) { + declareSymbolAndAddToSymbolTable(node, 1024, 0); + } + else { + declareSymbolAndAddToSymbolTable(node, 512, 106639); + if (node.symbol.flags & (16 | 32 | 256)) { + node.symbol.constEnumOnlyModule = false; + } + else { + var currentModuleIsConstEnumOnly = state === 2; + if (node.symbol.constEnumOnlyModule === undefined) { + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + } + function bindFunctionOrConstructorType(node) { + var symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072); + var typeLiteralSymbol = createSymbol(2048, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048); + typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); + var _a; + } + function bindObjectLiteralExpression(node) { + if (inStrictMode) { + var seen = {}; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + if (prop.name.kind !== 69) { + continue; + } + var identifier = prop.name; + var currentKind = prop.kind === 245 || prop.kind === 246 || prop.kind === 143 + ? 1 + : 2; + var existingKind = seen[identifier.text]; + if (!existingKind) { + seen[identifier.text] = currentKind; + continue; + } + if (currentKind === 1 && existingKind === 1) { + var span = ts.getErrorSpanForNode(file, identifier); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); + } + } + } + return bindAnonymousDeclaration(node, 4096, "__object"); + } + function bindAnonymousDeclaration(node, symbolFlags, name) { + var symbol = createSymbol(symbolFlags, name); + addDeclarationToSymbol(symbol, node, symbolFlags); + } + function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { + switch (blockScopeContainer.kind) { + case 218: + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + case 248: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); + } + declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2, 107455); + } + function checkStrictModeIdentifier(node) { + if (inStrictMode && + node.originalKeywordKind >= 106 && + node.originalKeywordKind <= 114 && + !ts.isIdentifierName(node)) { + if (!file.parseDiagnostics.length) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); + } + } + } + function getStrictModeIdentifierMessage(node) { + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; + } + function checkStrictModeBinaryExpression(node) { + if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { + checkStrictModeEvalOrArguments(node, node.left); + } + } + function checkStrictModeCatchClause(node) { + if (inStrictMode && node.variableDeclaration) { + checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); + } + } + function checkStrictModeDeleteExpression(node) { + if (inStrictMode && node.expression.kind === 69) { + var span = ts.getErrorSpanForNode(file, node.expression); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); + } + } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 69 && + (node.text === "eval" || node.text === "arguments"); + } + function checkStrictModeEvalOrArguments(contextNode, name) { + if (name && name.kind === 69) { + var identifier = name; + if (isEvalOrArgumentsIdentifier(identifier)) { + var span = ts.getErrorSpanForNode(file, name); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); + } + } + } + function getStrictModeEvalOrArgumentsMessage(node) { + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; + } + function checkStrictModeFunctionName(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + } + function checkStrictModeNumericLiteral(node) { + if (inStrictMode && node.flags & 32768) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); + } + } + function checkStrictModePostfixUnaryExpression(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + function checkStrictModePrefixUnaryExpression(node) { + if (inStrictMode) { + if (node.operator === 41 || node.operator === 42) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + } + function checkStrictModeWithStatement(node) { + if (inStrictMode) { + errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + function errorOnFirstToken(node, message, arg0, arg1, arg2) { + var span = ts.getSpanOfTokenAtPosition(file, node.pos); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + if (!node) { + return; + } + node.parent = parent; + var savedInStrictMode = inStrictMode; + if (!savedInStrictMode) { + updateStrictMode(node); + } + bindWorker(node); + bindChildren(node); + inStrictMode = savedInStrictMode; + } + function updateStrictMode(node) { + switch (node.kind) { + case 248: + case 219: + updateStrictModeStatementList(node.statements); + return; + case 192: + if (ts.isFunctionLike(node.parent)) { + updateStrictModeStatementList(node.statements); + } + return; + case 214: + case 186: + inStrictMode = true; + return; + } + } + function updateStrictModeStatementList(statements) { + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (!ts.isPrologueDirective(statement)) { + return; + } + if (isUseStrictPrologueDirective(statement)) { + inStrictMode = true; + return; + } + } + } + function isUseStrictPrologueDirective(node) { + var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); + return nodeText === "\"use strict\"" || nodeText === "'use strict'"; + } + function bindWorker(node) { + switch (node.kind) { + case 69: + return checkStrictModeIdentifier(node); + case 181: + if (ts.isInJavaScriptFile(node)) { + if (ts.isExportsPropertyAssignment(node)) { + bindExportsPropertyAssignment(node); + } + else if (ts.isModuleExportsAssignment(node)) { + bindModuleExportsAssignment(node); + } + } + return checkStrictModeBinaryExpression(node); + case 244: + return checkStrictModeCatchClause(node); + case 175: + return checkStrictModeDeleteExpression(node); + case 8: + return checkStrictModeNumericLiteral(node); + case 180: + return checkStrictModePostfixUnaryExpression(node); + case 179: + return checkStrictModePrefixUnaryExpression(node); + case 205: + return checkStrictModeWithStatement(node); + case 97: + seenThisKeyword = true; + return; + case 137: + return declareSymbolAndAddToSymbolTable(node, 262144, 530912); + case 138: + return bindParameter(node); + case 211: + case 163: + return bindVariableDeclarationOrBindingElement(node); + case 141: + case 140: + return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); + case 245: + case 246: + return bindPropertyOrMethodOrAccessor(node, 4, 107455); + case 247: + return bindPropertyOrMethodOrAccessor(node, 8, 107455); + case 147: + case 148: + case 149: + return declareSymbolAndAddToSymbolTable(node, 131072, 0); + case 143: + case 142: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); + case 213: + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16, 106927); + case 144: + return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 145: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 146: + return bindPropertyOrMethodOrAccessor(node, 65536, 74687); + case 152: + case 153: + return bindFunctionOrConstructorType(node); + case 155: + return bindAnonymousDeclaration(node, 2048, "__type"); + case 165: + return bindObjectLiteralExpression(node); + case 173: + case 174: + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16, bindingName); + case 168: + if (ts.isInJavaScriptFile(node)) { + bindCallExpression(node); + } + break; + case 186: + case 214: + return bindClassLikeDeclaration(node); + case 215: + return bindBlockScopedDeclaration(node, 64, 792960); + case 216: + return bindBlockScopedDeclaration(node, 524288, 793056); + case 217: + return bindEnumDeclaration(node); + case 218: + return bindModuleDeclaration(node); + case 221: + case 224: + case 226: + case 230: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 223: + return bindImportClause(node); + case 228: + return bindExportDeclaration(node); + case 227: + return bindExportAssignment(node); + case 248: + return bindSourceFileIfExternalModule(); + } + } + function bindSourceFileIfExternalModule() { + setExportContextFlag(file); + if (ts.isExternalModule(file)) { + bindSourceFileAsExternalModule(); + } + } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); + } + function bindExportAssignment(node) { + var boundExpression = node.kind === 227 ? node.expression : node.right; + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); + } + else if (boundExpression.kind === 69) { + declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + } + } + function bindExportDeclaration(node) { + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 1073741824, getDeclarationName(node)); + } + else if (!node.exportClause) { + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + } + } + function bindImportClause(node) { + if (node.name) { + declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + } + } + function setCommonJsModuleIndicator(node) { + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + bindSourceFileAsExternalModule(); + } + } + function bindExportsPropertyAssignment(node) { + setCommonJsModuleIndicator(node); + declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 7340032, 0); + } + function bindModuleExportsAssignment(node) { + setCommonJsModuleIndicator(node); + bindExportAssignment(node); + } + function bindCallExpression(node) { + if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node) { + if (node.kind === 214) { + bindBlockScopedDeclaration(node, 32, 899519); + } + else { + var bindingName = node.name ? node.name.text : "__class"; + bindAnonymousDeclaration(node, 32, bindingName); + if (node.name) { + classifiableNames[node.name.text] = node.name.text; + } + } + var symbol = node.symbol; + var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + function bindEnumDeclaration(node) { + return ts.isConst(node) + ? bindBlockScopedDeclaration(node, 128, 899967) + : bindBlockScopedDeclaration(node, 256, 899327); + } + function bindVariableDeclarationOrBindingElement(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (!ts.isBindingPattern(node.name)) { + if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else if (ts.isParameterDeclaration(node)) { + declareSymbolAndAddToSymbolTable(node, 1, 107455); + } + else { + declareSymbolAndAddToSymbolTable(node, 1, 107454); + } + } + } + function bindParameter(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node)); + } + else { + declareSymbolAndAddToSymbolTable(node, 1, 107455); + } + if (node.flags & 56 && + node.parent.kind === 144 && + ts.isClassLike(node.parent.parent)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + return ts.hasDynamicName(node) + ? bindAnonymousDeclaration(node, symbolFlags, "__computed") + : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + function pushNamedLabel(name) { + initializeReachabilityStateIfNecessary(); + if (ts.hasProperty(labelIndexMap, name.text)) { + return false; + } + labelIndexMap[name.text] = labelStack.push(1) - 1; + return true; + } + function pushImplicitLabel() { + initializeReachabilityStateIfNecessary(); + var index = labelStack.push(1) - 1; + implicitLabels.push(index); + return index; + } + function popNamedLabel(label, outerState) { + var index = labelIndexMap[label.text]; + ts.Debug.assert(index !== undefined); + ts.Debug.assert(labelStack.length == index + 1); + labelIndexMap[label.text] = undefined; + setCurrentStateAtLabel(labelStack.pop(), outerState, label); + } + function popImplicitLabel(implicitLabelIndex, outerState) { + if (labelStack.length !== implicitLabelIndex + 1) { + ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); + } + var i = implicitLabels.pop(); + if (implicitLabelIndex !== i) { + ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); + } + setCurrentStateAtLabel(labelStack.pop(), outerState, undefined); + } + function setCurrentStateAtLabel(innerMergedState, outerState, label) { + if (innerMergedState === 1) { + if (label && !options.allowUnusedLabels) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); + } + currentReachabilityState = outerState; + } + else { + currentReachabilityState = or(innerMergedState, outerState); + } + } + function jumpToLabel(label, outerState) { + initializeReachabilityStateIfNecessary(); + var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); + if (index === undefined) { + return false; + } + var stateAtLabel = labelStack[index]; + labelStack[index] = stateAtLabel === 1 ? outerState : or(stateAtLabel, outerState); + return true; + } + function checkUnreachable(node) { + switch (currentReachabilityState) { + case 4: + var reportError = (ts.isStatement(node) && node.kind !== 194) || + node.kind === 214 || + (node.kind === 218 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 217 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + if (reportError) { + currentReachabilityState = 8; + var reportUnreachableCode = !options.allowUnreachableCode && + !ts.isInAmbientContext(node) && + (node.kind !== 193 || + ts.getCombinedNodeFlags(node.declarationList) & 24576 || + ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); + if (reportUnreachableCode) { + errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); + } + } + case 8: + return true; + default: + return false; + } + function shouldReportErrorOnModuleDeclaration(node) { + var instanceState = getModuleInstanceState(node); + return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums); + } + } + function initializeReachabilityStateIfNecessary() { + if (labelIndexMap) { + return; + } + currentReachabilityState = 2; + labelIndexMap = {}; + labelStack = []; + implicitLabels = []; + } + } +})(ts || (ts = {})); +var ts; (function (ts) { var nextSymbolId = 1; var nextNodeId = 1; @@ -10853,7 +10987,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: getApparentTypeOfContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -11109,7 +11243,7 @@ var ts; return ts.getAncestor(node, 248); } function isGlobalSourceFile(node) { - return node.kind === 248 && !ts.isExternalModule(node); + return node.kind === 248 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -11195,23 +11329,24 @@ var ts; } switch (location.kind) { case 248: - if (!ts.isExternalModule(location)) + if (!ts.isExternalOrCommonJsModule(location)) break; case 218: var moduleExports = getSymbolOfNode(location).exports; if (location.kind === 248 || (location.kind === 218 && location.name.kind === 9)) { + if (result = moduleExports["default"]) { + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { + break loop; + } + result = undefined; + } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && ts.getDeclarationOfKind(moduleExports[name], 230)) { break; } - result = moduleExports["default"]; - var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; } if (result = getSymbol(moduleExports, name, meaning & 8914931)) { break loop; @@ -11569,6 +11704,9 @@ var ts; if (moduleName === undefined) { return; } + if (moduleName.indexOf("!") >= 0) { + moduleName = moduleName.substr(0, moduleName.indexOf("!")); + } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); @@ -11739,7 +11877,7 @@ var ts; } switch (location_1.kind) { case 248: - if (!ts.isExternalModule(location_1)) { + if (!ts.isExternalOrCommonJsModule(location_1)) { break; } case 218: @@ -11866,7 +12004,7 @@ var ts; } function hasExternalModuleSymbol(declaration) { return (declaration.kind === 218 && declaration.name.kind === 9) || - (declaration.kind === 248 && ts.isExternalModule(declaration)); + (declaration.kind === 248 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12064,7 +12202,7 @@ var ts; writeAnonymousType(type, flags); } else if (type.flags & 256) { - writer.writeStringLiteral(type.text); + writer.writeStringLiteral("\"" + ts.escapeString(type.text) + "\""); } else { writePunctuation(writer, 15); @@ -12428,7 +12566,7 @@ var ts; } } else if (node.kind === 248) { - return ts.isExternalModule(node) ? node : undefined; + return ts.isExternalOrCommonJsModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); @@ -12633,6 +12771,23 @@ var ts; var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node); } + function getTextOfPropertyName(name) { + switch (name.kind) { + case 69: + return name.text; + case 9: + case 8: + return name.text; + case 136: + if (ts.isStringOrNumericLiteral(name.expression.kind)) { + return name.expression.text; + } + } + return undefined; + } + function isComputedNonLiteralName(name) { + return name.kind === 136 && !ts.isStringOrNumericLiteral(name.expression.kind); + } function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForBindingElementParent(pattern.parent); @@ -12648,8 +12803,12 @@ var ts; var type; if (pattern.kind === 161) { var name_10 = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, name_10.text) || - isNumericLiteralName(name_10.text) && getIndexTypeOfType(parentType, 1) || + if (isComputedNonLiteralName(name_10)) { + return anyType; + } + var text = getTextOfPropertyName(name_10); + type = getTypeOfPropertyOfType(parentType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { error(name_10, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_10)); @@ -12727,10 +12886,16 @@ var ts; } function getTypeFromObjectBindingPattern(pattern, includePatternInType) { var members = {}; + var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + if (isComputedNonLiteralName(name)) { + hasComputedProperties = true; + return; + } + var text = getTextOfPropertyName(name); + var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType); symbol.bindingElement = e; members[symbol.name] = symbol; @@ -12739,6 +12904,9 @@ var ts; if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= 67108864; + } return result; } function getTypeFromArrayBindingPattern(pattern, includePatternInType) { @@ -12789,6 +12957,12 @@ var ts; if (declaration.kind === 227) { return links.type = checkExpression(declaration.expression); } + if (declaration.kind === 181) { + return links.type = checkExpression(declaration.right); + } + if (declaration.kind === 166) { + return checkExpressionCached(declaration.parent.right); + } if (!pushTypeResolution(symbol, 0)) { return unknownType; } @@ -13038,17 +13212,19 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseContructorType = getBaseConstructorTypeOfClass(type); - if (!(baseContructorType.flags & 80896)) { + var baseConstructorType = getBaseConstructorTypeOfClass(type); + if (!(baseConstructorType.flags & 80896)) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); var baseType; - if (baseContructorType.symbol && baseContructorType.symbol.flags & 32) { - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseContructorType.symbol); + var originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 && + areAllOuterTypeParametersApplied(originalBaseType)) { + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } else { - var constructors = getInstantiatedConstructorsForTypeArguments(baseContructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -13073,6 +13249,15 @@ var ts; type.resolvedBaseTypes.push(baseType); } } + function areAllOuterTypeParametersApplied(type) { + var outerTypeParameters = type.outerTypeParameters; + if (outerTypeParameters) { + var last = outerTypeParameters.length - 1; + var typeArguments = type.typeArguments; + return outerTypeParameters[last].symbol !== typeArguments[last].symbol; + } + return true; + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { @@ -13144,7 +13329,7 @@ var ts; type.typeArguments = type.typeParameters; type.thisType = createType(512 | 33554432); type.thisType.symbol = symbol; - type.thisType.constraint = getTypeWithThisArgument(type); + type.thisType.constraint = type; } } return links.declaredType; @@ -13619,14 +13804,19 @@ var ts; type = getApparentType(type); return type.flags & 49152 ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } + function getApparentTypeOfTypeParameter(type) { + if (!type.resolvedApparentType) { + var constraintType = getConstraintOfTypeParameter(type); + while (constraintType && constraintType.flags & 512) { + constraintType = getConstraintOfTypeParameter(constraintType); + } + type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); + } + return type.resolvedApparentType; + } function getApparentType(type) { if (type.flags & 512) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512); - if (!type) { - type = emptyObjectType; - } + type = getApparentTypeOfTypeParameter(type); } if (type.flags & 258) { type = globalStringType; @@ -13779,7 +13969,7 @@ var ts; if (node.initializer) { var signatureDeclaration = node.parent; var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -13874,6 +14064,16 @@ var ts; } return result; } + function resolveExternalModuleTypeByLiteral(name) { + var moduleSym = resolveExternalModuleName(name, name); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3)) { @@ -14335,11 +14535,12 @@ var ts; return links.resolvedType; } function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; + var text = node.text; + if (ts.hasProperty(stringLiteralTypes, text)) { + return stringLiteralTypes[text]; } - var type = stringLiteralTypes[node.text] = createType(256); - type.text = ts.getTextOfNode(node); + var type = stringLiteralTypes[text] = createType(256); + type.text = text; return type; } function getTypeFromStringLiteral(node) { @@ -14808,7 +15009,7 @@ var ts; return false; } function hasExcessProperties(source, target, reportErrors) { - if (someConstituentTypeHasKind(target, 80896)) { + if (!(target.flags & 67108864) && someConstituentTypeHasKind(target, 80896)) { for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { @@ -14898,9 +15099,6 @@ var ts; return result; } function typeParameterIdenticalTo(source, target) { - if (source.symbol.name !== target.symbol.name) { - return 0; - } if (source.constraint === target.constraint) { return -1; } @@ -15345,18 +15543,24 @@ var ts; } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } + function isMatchingSignature(source, target, partialMatch) { + if (source.parameters.length === target.parameters.length && + source.minArgumentCount === target.minArgumentCount && + source.hasRestParameter === target.hasRestParameter) { + return true; + } + if (partialMatch && source.minArgumentCount <= target.minArgumentCount && (source.hasRestParameter && !target.hasRestParameter || + source.hasRestParameter === target.hasRestParameter && source.parameters.length >= target.parameters.length)) { + return true; + } + return false; + } function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { - if (!partialMatch || - source.parameters.length < target.parameters.length && !source.hasRestParameter || - source.minArgumentCount > target.minArgumentCount) { - return 0; - } + if (!(isMatchingSignature(source, target, partialMatch))) { + return 0; } var result = -1; if (source.typeParameters && target.typeParameters) { @@ -15441,6 +15645,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isStringLiteralType(type) { + return type.flags & 256; + } function isTupleType(type) { return !!(type.flags & 8192); } @@ -16032,7 +16239,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (isTypeAny(type) || !assumeTrue || expr.left.kind !== 69 || getResolvedSymbol(expr.left) !== symbol) { + if (isTypeAny(type) || expr.left.kind !== 69 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -16060,6 +16267,12 @@ var ts; } } if (targetType) { + if (!assumeTrue) { + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); + } + return type; + } return getNarrowedType(type, targetType); } return type; @@ -16471,6 +16684,9 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } + function contextualTypeIsStringLiteralType(type) { + return !!(type.flags & 16384 ? ts.forEach(type.types, isStringLiteralType) : isStringLiteralType(type)); + } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } @@ -16486,7 +16702,7 @@ var ts; } function getContextualTypeForObjectLiteralElement(element) { var objectLiteral = element.parent; - var type = getContextualType(objectLiteral); + var type = getApparentTypeOfContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { var symbolName = getSymbolOfNode(element).name; @@ -16502,7 +16718,7 @@ var ts; } function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); + var type = getApparentTypeOfContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) @@ -16531,11 +16747,11 @@ var ts; } return undefined; } - function getContextualType(node) { - var type = getContextualTypeWorker(node); + function getApparentTypeOfContextualType(node) { + var type = getContextualType(node); return type && getApparentType(type); } - function getContextualTypeWorker(node) { + function getContextualType(node) { if (isInsideWithStatementBody(node)) { return undefined; } @@ -16601,7 +16817,7 @@ var ts; ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + : getApparentTypeOfContextualType(node); if (!type) { return undefined; } @@ -16684,7 +16900,7 @@ var ts; type.pattern = node; return type; } - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; if (pattern && (pattern.kind === 162 || pattern.kind === 164)) { @@ -16739,10 +16955,11 @@ var ts; checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = {}; var propertiesArray = []; - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 161 || contextualType.pattern.kind === 165); var typeFlags = 0; + var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; @@ -16768,8 +16985,11 @@ var ts; if (isOptional) { prop.flags |= 536870912; } + if (ts.hasDynamicName(memberDecl)) { + patternWithComputedProperties = true; + } } - else if (contextualTypeHasPattern) { + else if (contextualTypeHasPattern && !(contextualType.flags & 67108864)) { var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { prop.flags |= impliedProp.flags & 536870912; @@ -16812,7 +17032,7 @@ var ts; var numberIndexType = getIndexType(1); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; - result.flags |= 524288 | 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064); + result.flags |= 524288 | 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064) | (patternWithComputedProperties ? 67108864 : 0); if (inDestructuringPattern) { result.pattern = node; } @@ -18027,6 +18247,9 @@ var ts; return anyType; } } + if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { @@ -18037,7 +18260,9 @@ var ts; var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { + var bothAreStringLike = someConstituentTypeHasKind(targetType, 258) && + someConstituentTypeHasKind(widenedType, 258); + if (!bothAreStringLike && !(isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } @@ -18476,17 +18701,24 @@ var ts; var p = properties_3[_i]; if (p.kind === 245 || p.kind === 246) { var name_13 = p.name; + if (name_13.kind === 136) { + checkComputedPropertyName(name_13); + } + if (isComputedNonLiteralName(name_13)) { + continue; + } + var text = getTextOfPropertyName(name_13); var type = isTypeAny(sourceType) ? sourceType - : getTypeOfPropertyOfType(sourceType, name_13.text) || - isNumericLiteralName(name_13.text) && getIndexTypeOfType(sourceType, 1) || + : getTypeOfPropertyOfType(sourceType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { if (p.kind === 246) { checkDestructuringAssignment(p, type); } else { - checkDestructuringAssignment(p.initializer || name_13, type); + checkDestructuringAssignment(p.initializer, type); } } else { @@ -18664,6 +18896,9 @@ var ts; case 31: case 32: case 33: + if (someConstituentTypeHasKind(leftType, 258) && someConstituentTypeHasKind(rightType, 258)) { + return booleanType; + } if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } @@ -18771,6 +19006,13 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkStringLiteralExpression(node) { + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { + return getStringLiteralType(node); + } + return stringType; + } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { checkExpression(templateSpan.expression); @@ -18809,7 +19051,7 @@ var ts; if (isInferentialContext(contextualMapper)) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { @@ -18861,6 +19103,7 @@ var ts; case 183: return checkTemplateExpression(node); case 9: + return checkStringLiteralExpression(node); case 11: return stringType; case 10: @@ -19922,7 +20165,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 248 && ts.isExternalModule(parent)) { + if (parent.kind === 248 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -19993,6 +20236,11 @@ var ts; checkExpressionCached(node.initializer); } } + if (node.kind === 163) { + if (node.propertyName && node.propertyName.kind === 136) { + checkComputedPropertyName(node.propertyName); + } + } if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } @@ -20351,6 +20599,7 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); + var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { if (clause.kind === 242 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { @@ -20367,6 +20616,9 @@ var ts; if (produceDiagnostics && clause.kind === 241) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); + if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) { + return; + } if (!isTypeAssignableTo(expressionType, caseType)) { checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } @@ -20774,11 +21026,14 @@ var ts; var enumIsConst = ts.isConst(node); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.name.kind === 136) { + if (isComputedNonLiteralName(member.name)) { error(member.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } - else if (isNumericLiteralName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + else { + var text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } } var previousEnumMemberIsNonConstant = autoValue === undefined; var initializer = member.initializer; @@ -21476,8 +21731,10 @@ var ts; function checkSourceFileWorker(node) { var links = getNodeLinks(node); if (!(links.flags & 1)) { - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; + if (compilerOptions.skipDefaultLibCheck) { + if (node.hasNoDefaultLib) { + return; + } } checkGrammarSourceFile(node); emitExtends = false; @@ -21486,7 +21743,7 @@ var ts; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (ts.isExternalModule(node)) { + if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } if (potentialThisCollisions.length) { @@ -21564,7 +21821,7 @@ var ts; } switch (location.kind) { case 248: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalOrCommonJsModule(location)) { break; } case 218: @@ -22123,15 +22380,24 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, - isArgumentsLocalBinding: isArgumentsLocalBinding + isArgumentsLocalBinding: isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; } + function getExternalModuleFileFromDeclaration(declaration) { + var specifier = ts.getExternalModuleName(declaration); + var moduleSymbol = getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return undefined; + } + return ts.getDeclarationOfKind(moduleSymbol, 248); + } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); ts.forEach(host.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { + if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } }); @@ -22808,7 +23074,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 136 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (ts.isDynamicName(node)) { return grammarErrorOnNode(node, message); } } @@ -23122,11 +23388,15 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; - var currentSourceFile; + var currentText; + var currentLineMap; + var currentIdentifiers; + var isCurrentFileExternalModule; var reportedDeclarationError = false; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; + var noDeclare = !root; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; @@ -23162,21 +23432,53 @@ var ts; } else { var emittedReferencedFiles = []; + var prevModuleElementDeclarationEmitInfo = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isDeclarationFile(sourceFile)) { if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } }); } + } + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + noDeclare = false; emitSourceFile(sourceFile); } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 222); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 1); + increaseIndent(); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + decreaseIndent(); + } + }); + setWriter(oldWriter); + } + prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; + } }); + moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); } return { reportedDeclarationError: reportedDeclarationError, @@ -23185,13 +23487,12 @@ var ts; referencePathsOutput: referencePathsOutput }; function hasInternalAnnotation(range) { - var text = currentSourceFile.text; - var comment = text.substring(range.pos, range.end); + var comment = currentText.substring(range.pos, range.end); return comment.indexOf("@internal") >= 0; } function stripInternal(node) { if (node) { - var leadingCommentRanges = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + var leadingCommentRanges = ts.getLeadingCommentRanges(currentText, node.pos); if (ts.forEach(leadingCommentRanges, hasInternalAnnotation)) { return; } @@ -23272,7 +23573,7 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -23336,9 +23637,9 @@ var ts; } function writeJsDocComments(declaration) { if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); + var jsDocComments = ts.getJsDocCommentsFromText(declaration, currentText); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, declaration, jsDocComments); + ts.emitComments(currentText, currentLineMap, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -23355,7 +23656,7 @@ var ts; case 103: case 97: case 9: - return writeTextOfNode(currentSourceFile, type); + return writeTextOfNode(currentText, type); case 188: return emitExpressionWithTypeArguments(type); case 151: @@ -23386,14 +23687,14 @@ var ts; } function writeEntityName(entityName) { if (entityName.kind === 69) { - writeTextOfNode(currentSourceFile, entityName); + writeTextOfNode(currentText, entityName); } else { var left = entityName.kind === 135 ? entityName.left : entityName.expression; var right = entityName.kind === 135 ? entityName.right : entityName.name; writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, right); + writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { @@ -23421,7 +23722,7 @@ var ts; } } function emitTypePredicate(type) { - writeTextOfNode(currentSourceFile, type.parameterName); + writeTextOfNode(currentText, type.parameterName); write(" is "); emitType(type.type); } @@ -23461,20 +23762,23 @@ var ts; } } function emitSourceFile(node) { - currentSourceFile = node; + currentText = node.text; + currentLineMap = ts.getLineStarts(node); + currentIdentifiers = node.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentSourceFile, writer, ts.writeCommentRange, node, newLine, true); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true); emitLines(node.statements); } function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + if (!ts.hasProperty(currentIdentifiers, baseName)) { return baseName; } var count = 0; while (true) { var name_18 = baseName + "_" + (++count); - if (!ts.hasProperty(currentSourceFile.identifiers, name_18)) { + if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } } @@ -23482,7 +23786,7 @@ var ts; function emitExportAssignment(node) { if (node.expression.kind === 69) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + writeTextOfNode(currentText, node.expression); } else { var tempVarName = getExportDefaultTempVariableName(); @@ -23517,7 +23821,7 @@ var ts; writeModuleElement(node); } else if (node.kind === 221 || - (node.parent.kind === 248 && ts.isExternalModule(currentSourceFile))) { + (node.parent.kind === 248 && isCurrentFileExternalModule)) { var isVisible; if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248) { asynchronousSubModuleDeclarationEmitInfo.push({ @@ -23569,14 +23873,14 @@ var ts; } } function emitModuleElementDeclarationFlags(node) { - if (node.parent === currentSourceFile) { + if (node.parent.kind === 248) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 215) { + else if (node.kind !== 215 && !noDeclare) { write("declare "); } } @@ -23601,7 +23905,7 @@ var ts; write("export "); } write("import "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" = "); if (ts.isInternalModuleImportEqualsDeclaration(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); @@ -23609,7 +23913,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentSourceFile, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); write(");"); } writer.writeLine(); @@ -23643,7 +23947,7 @@ var ts; if (node.importClause) { var currentWriterPos = writer.getTextPos(); if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { - writeTextOfNode(currentSourceFile, node.importClause.name); + writeTextOfNode(currentText, node.importClause.name); } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { @@ -23651,7 +23955,7 @@ var ts; } if (node.importClause.namedBindings.kind === 224) { write("* as "); - writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + writeTextOfNode(currentText, node.importClause.namedBindings.name); } else { write("{ "); @@ -23661,16 +23965,28 @@ var ts; } write(" from "); } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier) { + if (moduleSpecifier.kind === 9 && (!root) && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + if (moduleName) { + write("\""); + write(moduleName); + write("\""); + return; + } + } + writeTextOfNode(currentText, moduleSpecifier); + } function emitImportOrExportSpecifier(node) { if (node.propertyName) { - writeTextOfNode(currentSourceFile, node.propertyName); + writeTextOfNode(currentText, node.propertyName); write(" as "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); @@ -23690,7 +24006,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -23704,11 +24020,11 @@ var ts; else { write("module "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); while (node.body.kind !== 219) { node = node.body; write("."); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -23727,7 +24043,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("type "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); emitTypeParameters(node.typeParameters); write(" = "); emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); @@ -23749,7 +24065,7 @@ var ts; write("const "); } write("enum "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" {"); writeLine(); increaseIndent(); @@ -23760,7 +24076,7 @@ var ts; } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var enumMemberValue = resolver.getConstantValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -23777,7 +24093,7 @@ var ts; increaseIndent(); emitJsDocComments(node); decreaseIndent(); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); if (node.parent.kind === 152 || @@ -23887,7 +24203,7 @@ var ts; write("abstract "); } write("class "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -23910,7 +24226,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("interface "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -23940,7 +24256,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if ((node.kind === 141 || node.kind === 140) && ts.hasQuestionToken(node)) { write("?"); } @@ -24014,7 +24330,7 @@ var ts; emitBindingPattern(bindingElement.name); } else { - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); } } @@ -24055,7 +24371,7 @@ var ts; emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (!(node.flags & 16)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); @@ -24136,13 +24452,13 @@ var ts; } if (node.kind === 213) { write("function "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } else if (node.kind === 144) { write("constructor"); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (ts.hasQuestionToken(node)) { write("?"); } @@ -24255,7 +24571,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } if (resolver.isOptionalParameter(node)) { write("?"); @@ -24354,7 +24670,7 @@ var ts; } else if (bindingElement.kind === 163) { if (bindingElement.propertyName) { - writeTextOfNode(currentSourceFile, bindingElement.propertyName); + writeTextOfNode(currentText, bindingElement.propertyName); write(": "); } if (bindingElement.name) { @@ -24366,7 +24682,7 @@ var ts; if (bindingElement.dotDotDotToken) { write("..."); } - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); } } } @@ -24449,6 +24765,18 @@ var ts; return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function getResolvedExternalModuleName(host, file) { + return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); + } + ts.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || ts.isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); + } + ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; var entities = { "quot": 0x0022, "amp": 0x0026, @@ -24718,15 +25046,19 @@ var ts; var newLine = host.getNewLine(); var jsxDesugaring = host.getCompilerOptions().jsx !== 1; var shouldEmitJsx = function (s) { return (s.languageVariant === 1 && !jsxDesugaring); }; + var outFile = compilerOptions.outFile || compilerOptions.out; + var emitJavaScript = createFileEmitter(); if (targetSourceFile === undefined) { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.outFile || compilerOptions.out) { - emitFile(compilerOptions.outFile || compilerOptions.out); + if (outFile) { + emitFile(outFile); + } + else { + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); + emitFile(jsFilePath, sourceFile); + } + }); } } else { @@ -24734,8 +25066,8 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); emitFile(jsFilePath, targetSourceFile); } - else if (!ts.isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) { - emitFile(compilerOptions.outFile || compilerOptions.out); + else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { + emitFile(outFile); } } diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); @@ -24785,20 +25117,26 @@ var ts; } } } - function emitJavaScript(jsFilePath, root) { + function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var currentText; + var currentLineMap; + var currentFileIdentifiers; + var renamedDependencies; + var isEs6Module; + var isCurrentFileExternalModule; var exportFunctionForFile; - var generatedNameSet = {}; - var nodeToGeneratedName = []; + var generatedNameSet; + var nodeToGeneratedName; var computedPropertyNamesToGeneratedNames; var convertedLoopState; - var extendsEmitted = false; - var decorateEmitted = false; - var paramEmitted = false; - var awaiterEmitted = false; - var tempFlags = 0; + var extendsEmitted; + var decorateEmitted; + var paramEmitted; + var awaiterEmitted; + var tempFlags; var tempVariables; var tempParameters; var externalImports; @@ -24815,6 +25153,7 @@ var ts; var scopeEmitStart = function (scopeDeclaration, scopeName) { }; var scopeEmitEnd = function () { }; var sourceMapData; + var root; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, @@ -24824,30 +25163,75 @@ var ts; _a[1] = emitCommonJSModule, _a ); - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - emitSourceFile(root); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); + var bundleEmitDelegates = (_b = {}, + _b[5] = function () { }, + _b[2] = emitAMDModule, + _b[4] = emitSystemModule, + _b[3] = function () { }, + _b[1] = function () { }, + _b + ); + return doEmit; + function doEmit(jsFilePath, rootFile) { + writer.reset(); + currentSourceFile = undefined; + currentText = undefined; + currentLineMap = undefined; + exportFunctionForFile = undefined; + generatedNameSet = {}; + nodeToGeneratedName = []; + computedPropertyNamesToGeneratedNames = undefined; + convertedLoopState = undefined; + extendsEmitted = false; + decorateEmitted = false; + paramEmitted = false; + awaiterEmitted = false; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = undefined; + detachedCommentsInfo = undefined; + sourceMapData = undefined; + isEs6Module = false; + renamedDependencies = undefined; + isCurrentFileExternalModule = false; + root = rootFile; + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { + initializeEmitterWithSourceMaps(jsFilePath, root); + } + if (root) { + emitSourceFile(root); + } + else { + if (modulekind) { + ts.forEach(host.getSourceFiles(), emitEmitHelpers); } - }); + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { + emitSourceFile(sourceFile); + } + }); + } + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, compilerOptions.emitBOM); } - writeLine(); - writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); - return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + currentText = sourceFile.text; + currentLineMap = ts.getLineStarts(sourceFile); exportFunctionForFile = undefined; + isEs6Module = sourceFile.symbol && sourceFile.symbol.exports && !!sourceFile.symbol.exports["___esModule"]; + renamedDependencies = sourceFile.renamedDependencies; + currentFileIdentifiers = sourceFile.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(sourceFile); emit(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(currentFileIdentifiers, name) && !ts.hasProperty(generatedNameSet, name); } function makeTempVariableName(flags) { @@ -24920,7 +25304,7 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps() { + function initializeEmitterWithSourceMaps(jsFilePath, root) { var sourceMapDir; var sourceMapSourceIndex = -1; var sourceMapNameIndexMap = {}; @@ -24989,7 +25373,7 @@ var ts; } } function recordSourceMapSpan(pos) { - var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); sourceLinePos.line++; sourceLinePos.character++; var emittedLine = writer.getLine(); @@ -25017,13 +25401,13 @@ var ts; } } function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); + recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); } function recordEmitNodeEndSpan(node) { recordSourceMapSpan(node.end); } function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + var tokenStartPos = ts.skipTrivia(currentText, startPos); recordSourceMapSpan(tokenStartPos); var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); recordSourceMapSpan(tokenEndPos); @@ -25093,9 +25477,9 @@ var ts; sourceMapNameIndices.pop(); } ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { + function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { @@ -25125,7 +25509,7 @@ var ts; return output; } } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); @@ -25138,7 +25522,7 @@ var ts; ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; } - writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); } var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { @@ -25201,7 +25585,7 @@ var ts; scopeEmitEnd = recordScopeNameEnd; writeComment = writeCommentRangeWithMap; } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function createTempVariable(flags) { @@ -25371,7 +25755,7 @@ var ts; return getQuotedEscapedLiteralText("\"", node.text, "\""); } if (node.parent) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + return ts.getTextOfNodeFromSourceText(currentText, node); } switch (node.kind) { case 9: @@ -25393,7 +25777,7 @@ var ts; return leftQuote + ts.escapeNonAsciiCharacters(ts.escapeString(text)) + rightQuote; } function emitDownlevelRawTemplateLiteral(node) { - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + var text = ts.getTextOfNodeFromSourceText(currentText, node); var isLast = node.kind === 11 || node.kind === 14; text = text.substring(1, text.length - (isLast ? 1 : 2)); text = text.replace(/\r\n?/g, "\n"); @@ -25723,7 +26107,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } write("\""); } @@ -25819,7 +26203,7 @@ var ts; else if (declaration.kind === 226) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name_23); + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -25843,7 +26227,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function isNameOfNestedRedeclaration(node) { @@ -25880,7 +26264,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function emitThis(node) { @@ -26247,8 +26631,8 @@ var ts; return container && container.kind !== 248; } function emitShorthandPropertyAssignment(node) { - writeTextOfNode(currentSourceFile, node.name); - if (languageVersion < 2 || isNamespaceExportReference(node.name)) { + writeTextOfNode(currentText, node.name); + if (modulekind !== 5 || isNamespaceExportReference(node.name)) { write(": "); emit(node.name); } @@ -26298,10 +26682,10 @@ var ts; } emit(node.expression); var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); - var shouldEmitSpace; + var shouldEmitSpace = false; if (!indentedBeforeDot) { if (node.expression.kind === 8) { - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node.expression); + var text = ts.getTextOfNodeFromSourceText(currentText, node.expression); shouldEmitSpace = text.indexOf(ts.tokenToString(21)) < 0; } else { @@ -27307,16 +27691,16 @@ var ts; emitToken(16, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node1.pos)) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { if (node.kind === 241) { @@ -27421,7 +27805,7 @@ var ts; if (node.parent.kind === 248) { ts.Debug.assert(!!(node.flags & 512) || node.kind === 227); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { - if (!currentSourceFile.symbol.exports["___esModule"]) { + if (!isEs6Module) { if (languageVersion === 1) { write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); @@ -27584,12 +27968,18 @@ var ts; return node; } function createPropertyAccessForDestructuringProperty(object, propName) { - var syntheticName = ts.createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== 69) { - return createElementAccessExpression(object, syntheticName); + var index; + var nameIsComputed = propName.kind === 136; + if (nameIsComputed) { + index = ensureIdentifier(propName.expression, false); } - return createPropertyAccessExpression(object, syntheticName); + else { + index = ts.createSynthesizedNode(propName.kind); + index.text = propName.text; + } + return !nameIsComputed && index.kind === 69 + ? createPropertyAccessExpression(object, index) + : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { var call = ts.createSynthesizedNode(168); @@ -28003,7 +28393,6 @@ var ts; var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); var isArrowFunction = node.kind === 174; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; - var args; if (!isArrowFunction) { write(" {"); increaseIndent(); @@ -29177,8 +29566,8 @@ var ts; } } function tryRenameExternalModule(moduleName) { - if (currentSourceFile.renamedDependencies && ts.hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { - return "\"" + currentSourceFile.renamedDependencies[moduleName.text] + "\""; + if (renamedDependencies && ts.hasProperty(renamedDependencies, moduleName.text)) { + return "\"" + renamedDependencies[moduleName.text] + "\""; } return undefined; } @@ -29318,7 +29707,7 @@ var ts; return; } if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + (!isCurrentFileExternalModule && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); var variableDeclarationIsHoisted = shouldHoistVariable(node, true); @@ -29530,7 +29919,7 @@ var ts; function getLocalNameForExternalImport(node) { var namespaceDeclaration = getNamespaceDeclarationNode(node); if (namespaceDeclaration && !isDefaultImport(node)) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } if (node.kind === 222 && node.importClause) { return getGeneratedNameForNode(node); @@ -29803,7 +30192,7 @@ var ts; ts.getEnclosingBlockScopeContainer(node).kind === 248; } function isCurrentFileSystemExternalModule() { - return modulekind === 4 && ts.isExternalModule(currentSourceFile); + return modulekind === 4 && isCurrentFileExternalModule; } function emitSystemModuleBody(node, dependencyGroups, startIndex) { emitVariableDeclarationsForImports(); @@ -29916,15 +30305,19 @@ var ts; writeLine(); write("}"); } - function emitSystemModule(node) { + function writeModuleName(node, emitRelativePathAsModuleName) { + var moduleName = node.moduleName; + if (moduleName || (emitRelativePathAsModuleName && (moduleName = getResolvedExternalModuleName(host, node)))) { + write("\"" + moduleName + "\", "); + } + } + function emitSystemModule(node, emitRelativePathAsModuleName) { collectExternalModuleInfo(node); ts.Debug.assert(!exportFunctionForFile); exportFunctionForFile = makeUniqueName("exports"); writeLine(); write("System.register("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } + writeModuleName(node, emitRelativePathAsModuleName); write("["); var groupIndices = {}; var dependencyGroups = []; @@ -29942,6 +30335,12 @@ var ts; if (i !== 0) { write(", "); } + if (emitRelativePathAsModuleName) { + var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); + if (name_29) { + text = "\"" + name_29 + "\""; + } + } write(text); } write("], function(" + exportFunctionForFile + ") {"); @@ -29955,7 +30354,7 @@ var ts; writeLine(); write("});"); } - function getAMDDependencyNames(node, includeNonAmdDependencies) { + function getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { var aliasedModuleNames = []; var unaliasedModuleNames = []; var importAliasNames = []; @@ -29972,6 +30371,12 @@ var ts; for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; var externalModuleName = getExternalModuleNameText(importNode); + if (emitRelativePathAsModuleName) { + var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_30) { + externalModuleName = "\"" + name_30 + "\""; + } + } var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); @@ -29983,8 +30388,8 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function emitAMDDependencies(node, includeNonAmdDependencies) { - var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies); + function emitAMDDependencies(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { + var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName); emitAMDDependencyList(dependencyNames); write(", "); emitAMDFactoryHeader(dependencyNames); @@ -30011,15 +30416,13 @@ var ts; } write(") {"); } - function emitAMDModule(node) { + function emitAMDModule(node, emitRelativePathAsModuleName) { emitEmitHelpers(node); collectExternalModuleInfo(node); writeLine(); write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, true); + writeModuleName(node, emitRelativePathAsModuleName); + emitAMDDependencies(node, true, emitRelativePathAsModuleName); increaseIndent(); var startIndex = emitDirectivePrologues(node.statements, true); emitExportStarHelper(); @@ -30225,8 +30628,13 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; - emitModule(node); + if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; + emitModule(node); + } + else { + bundleEmitDelegates[modulekind](node, true); + } } else { var startIndex = emitDirectivePrologues(node.statements, false); @@ -30470,7 +30878,7 @@ var ts; return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentText, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -30480,10 +30888,10 @@ var ts; return leadingComments; } function isTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + if (currentText.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47) { - var textSubStr = currentSourceFile.text.substring(comment.pos, comment.end); + currentText.charCodeAt(comment.pos + 2) === 47) { + var textSubStr = currentText.substring(comment.pos, comment.end); return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? true : false; @@ -30497,7 +30905,7 @@ var ts; return getLeadingCommentsWithoutDetachedComments(); } else { - return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNodeFromText(node, currentText); } } } @@ -30505,7 +30913,7 @@ var ts; function getTrailingCommentsToEmit(node) { if (node.parent) { if (node.parent.kind === 248 || node.end !== node.parent.end) { - return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); + return ts.getTrailingCommentRanges(currentText, node.end); } } } @@ -30528,22 +30936,22 @@ var ts; leadingComments = ts.filter(getLeadingCommentsToEmit(node), isTripleSlashComment); } } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { return; } var trailingComments = getTrailingCommentsToEmit(node); - ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, false, newLine, writeComment); } function emitTrailingCommentsOfPosition(pos) { if (compilerOptions.removeComments) { return; } - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, pos); - ts.emitComments(currentSourceFile, writer, trailingComments, true, newLine, writeComment); + var trailingComments = ts.getTrailingCommentRanges(currentText, pos); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, true, newLine, writeComment); } function emitLeadingCommentsOfPositionWorker(pos) { if (compilerOptions.removeComments) { @@ -30554,13 +30962,13 @@ var ts; leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentText, pos); } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, { pos: pos, end: pos }, leadingComments); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, true, newLine, writeComment); } function emitDetachedCommentsAndUpdateCommentsInfo(node) { - var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, compilerOptions.removeComments); + var currentDetachedCommentInfo = ts.emitDetachedComments(currentText, currentLineMap, writer, writeComment, node, newLine, compilerOptions.removeComments); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -30571,12 +30979,12 @@ var ts; } } function emitShebang() { - var shebang = ts.getShebang(currentSourceFile.text); + var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); } } - var _a; + var _a, _b; } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); @@ -30632,11 +31040,11 @@ var ts; if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -30646,8 +31054,8 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(candidate, failedLookupLocation, host) { - return ts.forEach(ts.moduleFileExtensions, tryLoad); + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; if (host.fileExists(fileName)) { @@ -30659,7 +31067,7 @@ var ts; } } } - function loadNodeModuleFromDirectory(candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); if (host.fileExists(packageJsonPath)) { var jsonContent; @@ -30671,7 +31079,7 @@ var ts; jsonContent = { typings: undefined }; } if (jsonContent.typings) { - var result = loadNodeModuleFromFile(ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); if (result) { return result; } @@ -30680,7 +31088,7 @@ var ts; else { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -30690,11 +31098,11 @@ var ts; if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -30719,9 +31127,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; + var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(ts.supportedExtensions, function (extension) { + referencedSourceFile = ts.forEach(extensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { return undefined; } @@ -30749,10 +31158,8 @@ var ts; ts.classicNameResolver = classicNameResolver; ts.defaultInitCompilerOptions = { module: 1, - target: 0, + target: 1, noImplicitAny: false, - outDir: "built", - rootDir: ".", sourceMap: false }; function createCompilerHost(options, setParentNodes) { @@ -31110,35 +31517,47 @@ var ts; if (file.imports) { return; } + var isJavaScriptFile = ts.isSourceFileJavaScript(file); var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, true); + collect(node, true, false); } file.imports = imports || emptyArray; - function collect(node, allowRelativeModuleNames) { - switch (node.kind) { - case 222: - case 221: - case 228: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9) { + return; + function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { + if (!collectOnlyRequireCalls) { + switch (node.kind) { + case 222: + case 221: + case 228: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9) { + break; + } + if (!moduleNameExpr.text) { + break; + } + if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } break; - } - if (!moduleNameExpr.text) { + case 218: + if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { + ts.forEachChild(node.body, function (node) { + collect(node, false, collectOnlyRequireCalls); + }); + } break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } - break; - case 218: - if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { - ts.forEachChild(node.body, function (node) { - collect(node, false); - }); - } - break; + } + } + if (isJavaScriptFile) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, true); }); + } } } } @@ -31225,7 +31644,6 @@ var ts; } processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -31298,6 +31716,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (!commonPathComponents) { + return currentDirectory; + } return ts.getNormalizedPathFromPathComponents(commonPathComponents); } function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { @@ -31380,10 +31801,12 @@ var ts; if (options.module === 5 && languageVersion < 2) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); } + if (outFile && options.module && !(options.module === 2 || options.module === 4)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile")); + } if (options.outDir || options.sourceRoot || - (options.mapRoot && - (!outFile || firstExternalModuleSourceFile !== undefined))) { + options.mapRoot) { if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); } @@ -31862,20 +32285,20 @@ var ts; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); for (var i = 0; i < sysFiles.length; i++) { - var name_29 = sysFiles[i]; - if (ts.fileExtensionIs(name_29, ".d.ts")) { - var baseName = name_29.substr(0, name_29.length - ".d.ts".length); + var name_31 = sysFiles[i]; + if (ts.fileExtensionIs(name_31, ".d.ts")) { + var baseName = name_31.substr(0, name_31.length - ".d.ts".length); if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_29); + fileNames.push(name_31); } } - else if (ts.fileExtensionIs(name_29, ".ts")) { - if (!ts.contains(sysFiles, name_29 + "x")) { - fileNames.push(name_29); + else if (ts.fileExtensionIs(name_31, ".ts")) { + if (!ts.contains(sysFiles, name_31 + "x")) { + fileNames.push(name_31); } } else { - fileNames.push(name_29); + fileNames.push(name_31); } } } @@ -31994,14 +32417,15 @@ var ts; var diagnostic = ts.createCompilerDiagnostic.apply(undefined, arguments); return diagnostic.messageText; } + function getRelativeFileName(fileName, host) { + return host ? ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : fileName; + } function reportDiagnosticSimply(diagnostic, host) { var output = ""; if (diagnostic.file) { var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; - var relativeFileName = host - ? ts.convertToRelativePath(diagnostic.file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) - : diagnostic.file.fileName; - output += diagnostic.file.fileName + "(" + (line + 1) + "," + (character + 1) + "): "; + var relativeFileName = getRelativeFileName(diagnostic.file.fileName, host); + output += relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): "; } var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); output += category + " TS" + diagnostic.code + ": " + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) + ts.sys.newLine; @@ -32030,6 +32454,7 @@ var ts; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; var _b = ts.getLineAndCharacterOfPosition(file, start + length_3), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; + var relativeFileName = getRelativeFileName(file.fileName, host); var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; var gutterWidth = (lastLine + 1 + "").length; if (hasMoreThanFiveLines) { @@ -32065,7 +32490,7 @@ var ts; output += ts.sys.newLine; } output += ts.sys.newLine; - output += file.fileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; } var categoryColor = categoryFormatMap[diagnostic.category]; var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); @@ -32191,8 +32616,19 @@ var ts; return; } } + if (!cachedConfigFileText) { + var error = ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, configFileName); + reportDiagnostics([error], undefined); + ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + return; + } var result = ts.parseConfigFileTextToJson(configFileName, cachedConfigFileText); var configObject = result.config; + if (!configObject) { + reportDiagnostics([result.error], undefined); + ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + return; + } var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, ts.getDirectoryPath(configFileName)); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors, undefined); @@ -32455,10 +32891,10 @@ var ts; function serializeCompilerOptions(options) { var result = {}; var optionsNameMap = ts.getOptionNameMap().optionNameMap; - for (var name_30 in options) { - if (ts.hasProperty(options, name_30)) { - var value = options[name_30]; - switch (name_30) { + for (var name_32 in options) { + if (ts.hasProperty(options, name_32)) { + var value = options[name_32]; + switch (name_32) { case "init": case "watch": case "version": @@ -32466,17 +32902,17 @@ var ts; case "project": break; default: - var optionDefinition = optionsNameMap[name_30.toLowerCase()]; + var optionDefinition = optionsNameMap[name_32.toLowerCase()]; if (optionDefinition) { if (typeof optionDefinition.type === "string") { - result[name_30] = value; + result[name_32] = value; } else { var typeMap = optionDefinition.type; for (var key in typeMap) { if (ts.hasProperty(typeMap, key)) { if (typeMap[key] === value) - result[name_30] = key; + result[name_32] = key; } } } diff --git a/lib/tsserver.js b/lib/tsserver.js index 2893dab82ef..9f0c1674080 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -665,7 +665,7 @@ var ts; } ts.fileExtensionIs = fileExtensionIs; ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.moduleFileExtensions = ts.supportedExtensions; + ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); function isSupportedSourceFileName(fileName) { if (!fileName) { return false; @@ -716,17 +716,16 @@ var ts; } function Signature(checker) { } + function Node(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0; + this.parent = undefined; + } ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0; - this.parent = undefined; - } - Node.prototype = { kind: kind }; - return Node; - }, + getNodeConstructor: function () { return Node; }, + getSourceFileConstructor: function () { return Node; }, getSymbolConstructor: function () { return Symbol; }, getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } @@ -1003,7 +1002,16 @@ var ts; if (writeByteOrderMark) { data = "\uFEFF" + data; } - _fs.writeFileSync(fileName, data, "utf8"); + var fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync(fd, data, undefined, "utf8"); + } + finally { + if (fd !== undefined) { + _fs.closeSync(fd); + } + } } function getCanonicalPath(path) { return useCaseSensitiveFileNames ? path.toLowerCase() : path; @@ -1688,6 +1696,7 @@ var ts; Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, + Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -2148,7 +2157,7 @@ var ts; function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; - while (true) { + while (pos < text.length) { var ch = text.charCodeAt(pos); switch (ch) { case 13: @@ -2217,6 +2226,7 @@ var ts; } return result; } + return result; } function getLeadingCommentRanges(text, pos) { return getCommentRanges(text, pos, false); @@ -2312,7 +2322,7 @@ var ts; error(ts.Diagnostics.Digit_expected); } } - return +(text.substring(start, end)); + return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -2704,7 +2714,7 @@ var ts; return pos++, token = 36; case 46: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8; } if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { @@ -2801,7 +2811,7 @@ var ts; case 55: case 56: case 57: - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8; case 58: return pos++, token = 54; @@ -3879,6 +3889,10 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isDeclarationFile(file) { return (file.flags & 4096) !== 0; } @@ -3925,18 +3939,26 @@ var ts; return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getLeadingCommentRangesOfNodeFromText(node, text) { + return ts.getLeadingCommentRanges(text, node.pos); + } + ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJsDocComments(node, sourceFileOfNode) { - var commentRanges = (node.kind === 138 || node.kind === 137) ? - ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : - getLeadingCommentRangesOfNode(node, sourceFileOfNode); - return ts.filter(commentRanges, isJsDocComment); - function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; - } + return getJsDocCommentsFromText(node, sourceFileOfNode.text); } ts.getJsDocComments = getJsDocComments; + function getJsDocCommentsFromText(node, text) { + var commentRanges = (node.kind === 138 || node.kind === 137) ? + ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); + return ts.filter(commentRanges, isJsDocComment); + function isJsDocComment(comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 42 && + text.charCodeAt(comment.pos + 3) !== 47; + } + } + ts.getJsDocCommentsFromText = getJsDocCommentsFromText; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { @@ -4465,6 +4487,41 @@ var ts; return node.kind === 221 && node.moduleReference.kind !== 232; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJavaScript(file) { + return isInJavaScriptFile(file); + } + ts.isSourceFileJavaScript = isSourceFileJavaScript; + function isInJavaScriptFile(node) { + return node && !!(node.parserContextFlags & 32); + } + ts.isInJavaScriptFile = isInJavaScriptFile; + function isRequireCall(expression) { + return expression.kind === 168 && + expression.expression.kind === 69 && + expression.expression.text === "require" && + expression.arguments.length === 1 && + expression.arguments[0].kind === 9; + } + ts.isRequireCall = isRequireCall; + function isExportsPropertyAssignment(expression) { + return isInJavaScriptFile(expression) && + (expression.kind === 181) && + (expression.operatorToken.kind === 56) && + (expression.left.kind === 166) && + (expression.left.expression.kind === 69) && + ((expression.left.expression).text === "exports"); + } + ts.isExportsPropertyAssignment = isExportsPropertyAssignment; + function isModuleExportsAssignment(expression) { + return isInJavaScriptFile(expression) && + (expression.kind === 181) && + (expression.operatorToken.kind === 56) && + (expression.left.kind === 166) && + (expression.left.expression.kind === 69) && + ((expression.left.expression).text === "module") && + (expression.left.name.text === "exports"); + } + ts.isModuleExportsAssignment = isModuleExportsAssignment; function getExternalModuleName(node) { if (node.kind === 222) { return node.moduleSpecifier; @@ -4776,8 +4833,8 @@ var ts; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -4819,12 +4876,20 @@ var ts; return isFunctionLike(node) && (node.flags & 256) !== 0 && !isAccessor(node); } ts.isAsyncFunctionLike = isAsyncFunctionLike; + function isStringOrNumericLiteral(kind) { + return kind === 9 || kind === 8; + } + ts.isStringOrNumericLiteral = isStringOrNumericLiteral; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 136 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && isDynamicName(declaration.name); } ts.hasDynamicName = hasDynamicName; + function isDynamicName(name) { + return name.kind === 136 && + !isStringOrNumericLiteral(name.expression.kind) && + !isWellKnownSymbolSyntactically(name.expression); + } + ts.isDynamicName = isDynamicName; function isWellKnownSymbolSyntactically(node) { return isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression); } @@ -5045,11 +5110,11 @@ var ts; } ts.getIndentSize = getIndentSize; function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; + var output; + var indent; + var lineStart; + var lineCount; + var linePos; function write(s) { if (s && s.length) { if (lineStart) { @@ -5059,6 +5124,13 @@ var ts; output += s; } } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } function rawWrite(s) { if (s !== undefined) { if (lineStart) { @@ -5085,9 +5157,10 @@ var ts; lineStart = true; } } - function writeTextOfNode(sourceFile, node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + function writeTextOfNode(text, node) { + write(getTextOfNodeFromSourceText(text, node)); } + reset(); return { write: write, rawWrite: rawWrite, @@ -5100,10 +5173,17 @@ var ts; getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + getText: function () { return output; }, + reset: reset }; } ts.createTextWriter = createTextWriter; + function getExternalModuleNameFromPath(host, fileName) { + var dir = host.getCurrentDirectory(); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, false); + return ts.removeFileExtension(relativePath); + } + ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); var emitOutputFilePathWithoutExtension; @@ -5132,6 +5212,10 @@ var ts; return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; + } + ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { if (member.kind === 144 && nodeIsPresent(member.body)) { @@ -5202,21 +5286,21 @@ var ts; }; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + getLineOfLocalPositionFromLineMap(lineMap, node.pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { writer.writeLine(); } } ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + function emitComments(text, lineMap, writer, comments, trailingSeparator, newLine, writeComment) { var emitLeadingSpace = !trailingSeparator; ts.forEach(comments, function (comment) { if (emitLeadingSpace) { writer.write(" "); emitLeadingSpace = false; } - writeComment(currentSourceFile, writer, comment, newLine); + writeComment(text, lineMap, writer, comment, newLine); if (comment.hasTrailingNewLine) { writer.writeLine(); } @@ -5229,16 +5313,16 @@ var ts; }); } ts.emitComments = emitComments; - function emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, removeComments) { + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); } } else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + leadingComments = ts.getLeadingCommentRanges(text, node.pos); } if (leadingComments) { var detachedComments = []; @@ -5246,8 +5330,8 @@ var ts; for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { var comment = leadingComments_1[_i]; if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); if (commentLine >= lastCommentLine + 2) { break; } @@ -5256,37 +5340,37 @@ var ts; lastComment = comment; } if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); if (nodeLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments(text, lineMap, writer, detachedComments, true, newLine, writeComment); currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; } } } return currentDetachedCommentInfo; function isPinnedComment(comment) { - return currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; } } ts.emitDetachedComments = emitDetachedComments; - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; + function writeCommentRange(text, lineMap, writer, comment, newLine) { + if (text.charCodeAt(comment.pos + 1) === 42) { + var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, comment.pos); + var lineCount = lineMap.length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : getStartPositionOfLine(currentLine + 1, currentSourceFile); + ? text.length + 1 + : lineMap[currentLine + 1]; if (pos !== comment.pos) { if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], comment.pos); } var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); @@ -5300,40 +5384,40 @@ var ts; writer.rawWrite(""); } } - writeTrimmedCurrentLine(pos, nextLineStart); + writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart); pos = nextLineStart; } } else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ""); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; + writer.write(text.substring(comment.pos, comment.end)); } } ts.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); + if (currentLineText) { + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + writer.writeLiteral(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + currentLineIndent++; + } + } + return currentLineIndent; + } function modifierToFlag(token) { switch (token) { case 113: return 64; @@ -5427,14 +5511,14 @@ var ts; return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 512) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function isJavaScript(fileName) { - return ts.fileExtensionIs(fileName, ".js"); + function hasJavaScriptFileExtension(fileName) { + return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isJavaScript = isJavaScript; - function isTsx(fileName) { - return ts.fileExtensionIs(fileName, ".tsx"); + ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; + function allowsJsxExpressions(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isTsx = isTsx; + ts.allowsJsxExpressions = allowsJsxExpressions; function getExpandedCharCodes(input) { var output = []; var length = input.length; @@ -5644,14 +5728,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(272); ts.parseTime = 0; - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; + var NodeConstructor; + var SourceFileConstructor; function createNode(kind, pos, end) { - return new (getNodeConstructor(kind))(pos, end); + if (kind === 248) { + return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); + } + else { + return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, pos, end); + } } ts.createNode = createNode; function visitNode(cbNode, node) { @@ -6050,6 +6136,8 @@ var ts; (function (Parser) { var scanner = ts.createScanner(2, true); var disallowInAndDecoratorContext = 1 | 4; + var NodeConstructor; + var SourceFileConstructor; var sourceFile; var parseDiagnostics; var syntaxCursor; @@ -6062,13 +6150,16 @@ var ts; var contextFlags; var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(fileName) || _sourceText.lastIndexOf("// @language=javascript", 0) === 0; + initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); clearState(); return result; } Parser.parseSourceFile = parseSourceFile; - function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor) { + function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { + NodeConstructor = ts.objectAllocator.getNodeConstructor(); + SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); sourceText = _sourceText; syntaxCursor = _syntaxCursor; parseDiagnostics = []; @@ -6076,12 +6167,12 @@ var ts; identifiers = {}; identifierCount = 0; nodeCount = 0; - contextFlags = ts.isJavaScript(fileName) ? 32 : 0; + contextFlags = isJavaScriptFile ? 32 : 0; parseErrorBeforeNextFinishedNode = false; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.isTsx(fileName) ? 1 : 0); + scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 : 0); } function clearState() { scanner.setText(""); @@ -6094,6 +6185,9 @@ var ts; } function parseSourceFileWorker(fileName, languageVersion, setParentNodes) { sourceFile = createSourceFile(fileName, languageVersion); + if (contextFlags & 32) { + sourceFile.parserContextFlags = 32; + } token = nextToken(); processReferenceComments(sourceFile); sourceFile.statements = parseList(0, parseStatement); @@ -6107,7 +6201,7 @@ var ts; if (setParentNodes) { fixupParentReferences(sourceFile); } - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { addJSDocComments(); } return sourceFile; @@ -6153,15 +6247,14 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = createNode(248, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; + var sourceFile = new SourceFileConstructor(248, 0, sourceText.length); + nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 : 0; - sourceFile.languageVariant = ts.isTsx(sourceFile.fileName) ? 1 : 0; + sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 : 0; return sourceFile; } function setContextFlag(val, flag) { @@ -6383,7 +6476,7 @@ var ts; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(pos, pos); + return new NodeConstructor(kind, pos, pos); } function finishNode(node, end) { node.end = end === undefined ? scanner.getStartPos() : end; @@ -6521,7 +6614,7 @@ var ts; case 12: return token === 19 || token === 37 || isLiteralPropertyName(); case 9: - return isLiteralPropertyName(); + return token === 19 || isLiteralPropertyName(); case 7: if (token === 15) { return lookAhead(isValidHeritageClauseObjectLiteral); @@ -7042,9 +7135,7 @@ var ts; } function parseParameterType() { if (parseOptional(54)) { - return token === 9 - ? parseLiteralNode(true) - : parseType(); + return parseType(); } return undefined; } @@ -7301,6 +7392,8 @@ var ts; case 131: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); + case 9: + return parseLiteralNode(true); case 103: case 97: return parseTokenNode(); @@ -7330,6 +7423,7 @@ var ts; case 19: case 25: case 92: + case 9: return true; case 17: return lookAhead(isStartOfParenthesizedOrFunctionType); @@ -7843,7 +7937,6 @@ var ts; var unaryOperator = token; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { - var diagnostic; var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); if (simpleUnaryExpression.kind === 171) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); @@ -9507,7 +9600,7 @@ var ts; } JSDocParser.isJSDocType = isJSDocType; function parseJSDocTypeExpressionForTests(content, start, length) { - initializeState("file.js", content, 2, undefined); + initializeState("file.js", content, 2, true, undefined); var jsDocTypeExpression = parseJSDocTypeExpression(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -9758,7 +9851,7 @@ var ts; } } function parseIsolatedJSDocComment(content, start, length) { - initializeState("file.js", content, 2, undefined); + initializeState("file.js", content, 2, true, undefined); var jsDocComment = parseJSDocComment(undefined, start, length); var diagnostics = parseDiagnostics; clearState(); @@ -10394,6 +10487,9 @@ var ts; } if (node.name.kind === 136) { var nameExpression = node.name.expression; + if (ts.isStringOrNumericLiteral(nameExpression.kind)) { + return nameExpression.text; + } ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); } @@ -10414,6 +10510,8 @@ var ts; return "__export"; case 227: return node.isExportEquals ? "export=" : "default"; + case 181: + return "export="; case 213: case 214: return node.flags & 512 ? "default" : undefined; @@ -11033,6 +11131,14 @@ var ts; case 69: return checkStrictModeIdentifier(node); case 181: + if (ts.isInJavaScriptFile(node)) { + if (ts.isExportsPropertyAssignment(node)) { + bindExportsPropertyAssignment(node); + } + else if (ts.isModuleExportsAssignment(node)) { + bindModuleExportsAssignment(node); + } + } return checkStrictModeBinaryExpression(node); case 244: return checkStrictModeCatchClause(node); @@ -11092,6 +11198,11 @@ var ts; checkStrictModeFunctionName(node); var bindingName = node.name ? node.name.text : "__function"; return bindAnonymousDeclaration(node, 16, bindingName); + case 168: + if (ts.isInJavaScriptFile(node)) { + bindCallExpression(node); + } + break; case 186: case 214: return bindClassLikeDeclaration(node); @@ -11121,14 +11232,18 @@ var ts; function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { - bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); + bindSourceFileAsExternalModule(); } } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); + } function bindExportAssignment(node) { + var boundExpression = node.kind === 227 ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } - else if (node.expression.kind === 69) { + else if (boundExpression.kind === 69) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } else { @@ -11148,6 +11263,25 @@ var ts; declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); } } + function setCommonJsModuleIndicator(node) { + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + bindSourceFileAsExternalModule(); + } + } + function bindExportsPropertyAssignment(node) { + setCommonJsModuleIndicator(node); + declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 7340032, 0); + } + function bindModuleExportsAssignment(node) { + setCommonJsModuleIndicator(node); + bindExportAssignment(node); + } + function bindCallExpression(node) { + if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { + setCommonJsModuleIndicator(node); + } + } function bindClassLikeDeclaration(node) { if (node.kind === 214) { bindBlockScopedDeclaration(node, 32, 899519); @@ -11268,7 +11402,7 @@ var ts; function checkUnreachable(node) { switch (currentReachabilityState) { case 4: - var reportError = ts.isStatement(node) || + var reportError = (ts.isStatement(node) && node.kind !== 194) || node.kind === 214 || (node.kind === 218 && shouldReportErrorOnModuleDeclaration(node)) || (node.kind === 217 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); @@ -11364,7 +11498,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: getApparentTypeOfContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -11620,7 +11754,7 @@ var ts; return ts.getAncestor(node, 248); } function isGlobalSourceFile(node) { - return node.kind === 248 && !ts.isExternalModule(node); + return node.kind === 248 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -11706,23 +11840,24 @@ var ts; } switch (location.kind) { case 248: - if (!ts.isExternalModule(location)) + if (!ts.isExternalOrCommonJsModule(location)) break; case 218: var moduleExports = getSymbolOfNode(location).exports; if (location.kind === 248 || (location.kind === 218 && location.name.kind === 9)) { + if (result = moduleExports["default"]) { + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { + break loop; + } + result = undefined; + } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && ts.getDeclarationOfKind(moduleExports[name], 230)) { break; } - result = moduleExports["default"]; - var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; } if (result = getSymbol(moduleExports, name, meaning & 8914931)) { break loop; @@ -12080,6 +12215,9 @@ var ts; if (moduleName === undefined) { return; } + if (moduleName.indexOf("!") >= 0) { + moduleName = moduleName.substr(0, moduleName.indexOf("!")); + } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); @@ -12250,7 +12388,7 @@ var ts; } switch (location_1.kind) { case 248: - if (!ts.isExternalModule(location_1)) { + if (!ts.isExternalOrCommonJsModule(location_1)) { break; } case 218: @@ -12377,7 +12515,7 @@ var ts; } function hasExternalModuleSymbol(declaration) { return (declaration.kind === 218 && declaration.name.kind === 9) || - (declaration.kind === 248 && ts.isExternalModule(declaration)); + (declaration.kind === 248 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12575,7 +12713,7 @@ var ts; writeAnonymousType(type, flags); } else if (type.flags & 256) { - writer.writeStringLiteral(type.text); + writer.writeStringLiteral("\"" + ts.escapeString(type.text) + "\""); } else { writePunctuation(writer, 15); @@ -12939,7 +13077,7 @@ var ts; } } else if (node.kind === 248) { - return ts.isExternalModule(node) ? node : undefined; + return ts.isExternalOrCommonJsModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); @@ -13144,6 +13282,23 @@ var ts; var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node); } + function getTextOfPropertyName(name) { + switch (name.kind) { + case 69: + return name.text; + case 9: + case 8: + return name.text; + case 136: + if (ts.isStringOrNumericLiteral(name.expression.kind)) { + return name.expression.text; + } + } + return undefined; + } + function isComputedNonLiteralName(name) { + return name.kind === 136 && !ts.isStringOrNumericLiteral(name.expression.kind); + } function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForBindingElementParent(pattern.parent); @@ -13159,8 +13314,12 @@ var ts; var type; if (pattern.kind === 161) { var name_11 = declaration.propertyName || declaration.name; - type = getTypeOfPropertyOfType(parentType, name_11.text) || - isNumericLiteralName(name_11.text) && getIndexTypeOfType(parentType, 1) || + if (isComputedNonLiteralName(name_11)) { + return anyType; + } + var text = getTextOfPropertyName(name_11); + type = getTypeOfPropertyOfType(parentType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { error(name_11, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_11)); @@ -13238,10 +13397,16 @@ var ts; } function getTypeFromObjectBindingPattern(pattern, includePatternInType) { var members = {}; + var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + if (isComputedNonLiteralName(name)) { + hasComputedProperties = true; + return; + } + var text = getTextOfPropertyName(name); + var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType); symbol.bindingElement = e; members[symbol.name] = symbol; @@ -13250,6 +13415,9 @@ var ts; if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= 67108864; + } return result; } function getTypeFromArrayBindingPattern(pattern, includePatternInType) { @@ -13300,6 +13468,12 @@ var ts; if (declaration.kind === 227) { return links.type = checkExpression(declaration.expression); } + if (declaration.kind === 181) { + return links.type = checkExpression(declaration.right); + } + if (declaration.kind === 166) { + return checkExpressionCached(declaration.parent.right); + } if (!pushTypeResolution(symbol, 0)) { return unknownType; } @@ -13549,17 +13723,19 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseContructorType = getBaseConstructorTypeOfClass(type); - if (!(baseContructorType.flags & 80896)) { + var baseConstructorType = getBaseConstructorTypeOfClass(type); + if (!(baseConstructorType.flags & 80896)) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); var baseType; - if (baseContructorType.symbol && baseContructorType.symbol.flags & 32) { - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseContructorType.symbol); + var originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 && + areAllOuterTypeParametersApplied(originalBaseType)) { + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } else { - var constructors = getInstantiatedConstructorsForTypeArguments(baseContructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -13584,6 +13760,15 @@ var ts; type.resolvedBaseTypes.push(baseType); } } + function areAllOuterTypeParametersApplied(type) { + var outerTypeParameters = type.outerTypeParameters; + if (outerTypeParameters) { + var last = outerTypeParameters.length - 1; + var typeArguments = type.typeArguments; + return outerTypeParameters[last].symbol !== typeArguments[last].symbol; + } + return true; + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { @@ -13655,7 +13840,7 @@ var ts; type.typeArguments = type.typeParameters; type.thisType = createType(512 | 33554432); type.thisType.symbol = symbol; - type.thisType.constraint = getTypeWithThisArgument(type); + type.thisType.constraint = type; } } return links.declaredType; @@ -14130,14 +14315,19 @@ var ts; type = getApparentType(type); return type.flags & 49152 ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } + function getApparentTypeOfTypeParameter(type) { + if (!type.resolvedApparentType) { + var constraintType = getConstraintOfTypeParameter(type); + while (constraintType && constraintType.flags & 512) { + constraintType = getConstraintOfTypeParameter(constraintType); + } + type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); + } + return type.resolvedApparentType; + } function getApparentType(type) { if (type.flags & 512) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512); - if (!type) { - type = emptyObjectType; - } + type = getApparentTypeOfTypeParameter(type); } if (type.flags & 258) { type = globalStringType; @@ -14290,7 +14480,7 @@ var ts; if (node.initializer) { var signatureDeclaration = node.parent; var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -14385,6 +14575,16 @@ var ts; } return result; } + function resolveExternalModuleTypeByLiteral(name) { + var moduleSym = resolveExternalModuleName(name, name); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3)) { @@ -14846,11 +15046,12 @@ var ts; return links.resolvedType; } function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; + var text = node.text; + if (ts.hasProperty(stringLiteralTypes, text)) { + return stringLiteralTypes[text]; } - var type = stringLiteralTypes[node.text] = createType(256); - type.text = ts.getTextOfNode(node); + var type = stringLiteralTypes[text] = createType(256); + type.text = text; return type; } function getTypeFromStringLiteral(node) { @@ -15319,7 +15520,7 @@ var ts; return false; } function hasExcessProperties(source, target, reportErrors) { - if (someConstituentTypeHasKind(target, 80896)) { + if (!(target.flags & 67108864) && someConstituentTypeHasKind(target, 80896)) { for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { @@ -15409,9 +15610,6 @@ var ts; return result; } function typeParameterIdenticalTo(source, target) { - if (source.symbol.name !== target.symbol.name) { - return 0; - } if (source.constraint === target.constraint) { return -1; } @@ -15856,18 +16054,24 @@ var ts; } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } + function isMatchingSignature(source, target, partialMatch) { + if (source.parameters.length === target.parameters.length && + source.minArgumentCount === target.minArgumentCount && + source.hasRestParameter === target.hasRestParameter) { + return true; + } + if (partialMatch && source.minArgumentCount <= target.minArgumentCount && (source.hasRestParameter && !target.hasRestParameter || + source.hasRestParameter === target.hasRestParameter && source.parameters.length >= target.parameters.length)) { + return true; + } + return false; + } function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { - if (!partialMatch || - source.parameters.length < target.parameters.length && !source.hasRestParameter || - source.minArgumentCount > target.minArgumentCount) { - return 0; - } + if (!(isMatchingSignature(source, target, partialMatch))) { + return 0; } var result = -1; if (source.typeParameters && target.typeParameters) { @@ -15952,6 +16156,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isStringLiteralType(type) { + return type.flags & 256; + } function isTupleType(type) { return !!(type.flags & 8192); } @@ -16543,7 +16750,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (isTypeAny(type) || !assumeTrue || expr.left.kind !== 69 || getResolvedSymbol(expr.left) !== symbol) { + if (isTypeAny(type) || expr.left.kind !== 69 || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -16571,6 +16778,12 @@ var ts; } } if (targetType) { + if (!assumeTrue) { + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); + } + return type; + } return getNarrowedType(type, targetType); } return type; @@ -16982,6 +17195,9 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } + function contextualTypeIsStringLiteralType(type) { + return !!(type.flags & 16384 ? ts.forEach(type.types, isStringLiteralType) : isStringLiteralType(type)); + } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } @@ -16997,7 +17213,7 @@ var ts; } function getContextualTypeForObjectLiteralElement(element) { var objectLiteral = element.parent; - var type = getContextualType(objectLiteral); + var type = getApparentTypeOfContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { var symbolName = getSymbolOfNode(element).name; @@ -17013,7 +17229,7 @@ var ts; } function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); + var type = getApparentTypeOfContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) @@ -17042,11 +17258,11 @@ var ts; } return undefined; } - function getContextualType(node) { - var type = getContextualTypeWorker(node); + function getApparentTypeOfContextualType(node) { + var type = getContextualType(node); return type && getApparentType(type); } - function getContextualTypeWorker(node) { + function getContextualType(node) { if (isInsideWithStatementBody(node)) { return undefined; } @@ -17112,7 +17328,7 @@ var ts; ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + : getApparentTypeOfContextualType(node); if (!type) { return undefined; } @@ -17195,7 +17411,7 @@ var ts; type.pattern = node; return type; } - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; if (pattern && (pattern.kind === 162 || pattern.kind === 164)) { @@ -17250,10 +17466,11 @@ var ts; checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = {}; var propertiesArray = []; - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 161 || contextualType.pattern.kind === 165); var typeFlags = 0; + var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; @@ -17279,8 +17496,11 @@ var ts; if (isOptional) { prop.flags |= 536870912; } + if (ts.hasDynamicName(memberDecl)) { + patternWithComputedProperties = true; + } } - else if (contextualTypeHasPattern) { + else if (contextualTypeHasPattern && !(contextualType.flags & 67108864)) { var impliedProp = getPropertyOfType(contextualType, member.name); if (impliedProp) { prop.flags |= impliedProp.flags & 536870912; @@ -17323,7 +17543,7 @@ var ts; var numberIndexType = getIndexType(1); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576; - result.flags |= 524288 | 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064); + result.flags |= 524288 | 4194304 | freshObjectLiteralFlag | (typeFlags & 14680064) | (patternWithComputedProperties ? 67108864 : 0); if (inDestructuringPattern) { result.pattern = node; } @@ -18538,6 +18758,9 @@ var ts; return anyType; } } + if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { @@ -18548,7 +18771,9 @@ var ts; var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { + var bothAreStringLike = someConstituentTypeHasKind(targetType, 258) && + someConstituentTypeHasKind(widenedType, 258); + if (!bothAreStringLike && !(isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } @@ -18987,17 +19212,24 @@ var ts; var p = properties_3[_i]; if (p.kind === 245 || p.kind === 246) { var name_14 = p.name; + if (name_14.kind === 136) { + checkComputedPropertyName(name_14); + } + if (isComputedNonLiteralName(name_14)) { + continue; + } + var text = getTextOfPropertyName(name_14); var type = isTypeAny(sourceType) ? sourceType - : getTypeOfPropertyOfType(sourceType, name_14.text) || - isNumericLiteralName(name_14.text) && getIndexTypeOfType(sourceType, 1) || + : getTypeOfPropertyOfType(sourceType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { if (p.kind === 246) { checkDestructuringAssignment(p, type); } else { - checkDestructuringAssignment(p.initializer || name_14, type); + checkDestructuringAssignment(p.initializer, type); } } else { @@ -19175,6 +19407,9 @@ var ts; case 31: case 32: case 33: + if (someConstituentTypeHasKind(leftType, 258) && someConstituentTypeHasKind(rightType, 258)) { + return booleanType; + } if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } @@ -19282,6 +19517,13 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkStringLiteralExpression(node) { + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { + return getStringLiteralType(node); + } + return stringType; + } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { checkExpression(templateSpan.expression); @@ -19320,7 +19562,7 @@ var ts; if (isInferentialContext(contextualMapper)) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { @@ -19372,6 +19614,7 @@ var ts; case 183: return checkTemplateExpression(node); case 9: + return checkStringLiteralExpression(node); case 11: return stringType; case 10: @@ -20433,7 +20676,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 248 && ts.isExternalModule(parent)) { + if (parent.kind === 248 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -20504,6 +20747,11 @@ var ts; checkExpressionCached(node.initializer); } } + if (node.kind === 163) { + if (node.propertyName && node.propertyName.kind === 136) { + checkComputedPropertyName(node.propertyName); + } + } if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } @@ -20862,6 +21110,7 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); + var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { if (clause.kind === 242 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { @@ -20878,6 +21127,9 @@ var ts; if (produceDiagnostics && clause.kind === 241) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); + if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) { + return; + } if (!isTypeAssignableTo(expressionType, caseType)) { checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } @@ -21285,11 +21537,14 @@ var ts; var enumIsConst = ts.isConst(node); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.name.kind === 136) { + if (isComputedNonLiteralName(member.name)) { error(member.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } - else if (isNumericLiteralName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + else { + var text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } } var previousEnumMemberIsNonConstant = autoValue === undefined; var initializer = member.initializer; @@ -21987,8 +22242,10 @@ var ts; function checkSourceFileWorker(node) { var links = getNodeLinks(node); if (!(links.flags & 1)) { - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; + if (compilerOptions.skipDefaultLibCheck) { + if (node.hasNoDefaultLib) { + return; + } } checkGrammarSourceFile(node); emitExtends = false; @@ -21997,7 +22254,7 @@ var ts; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (ts.isExternalModule(node)) { + if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } if (potentialThisCollisions.length) { @@ -22075,7 +22332,7 @@ var ts; } switch (location.kind) { case 248: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalOrCommonJsModule(location)) { break; } case 218: @@ -22634,15 +22891,24 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, - isArgumentsLocalBinding: isArgumentsLocalBinding + isArgumentsLocalBinding: isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; } + function getExternalModuleFileFromDeclaration(declaration) { + var specifier = ts.getExternalModuleName(declaration); + var moduleSymbol = getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return undefined; + } + return ts.getDeclarationOfKind(moduleSymbol, 248); + } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); ts.forEach(host.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { + if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } }); @@ -23319,7 +23585,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 136 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (ts.isDynamicName(node)) { return grammarErrorOnNode(node, message); } } @@ -23633,11 +23899,15 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; - var currentSourceFile; + var currentText; + var currentLineMap; + var currentIdentifiers; + var isCurrentFileExternalModule; var reportedDeclarationError = false; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; + var noDeclare = !root; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; @@ -23673,21 +23943,53 @@ var ts; } else { var emittedReferencedFiles = []; + var prevModuleElementDeclarationEmitInfo = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isDeclarationFile(sourceFile)) { if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } }); } + } + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + noDeclare = false; emitSourceFile(sourceFile); } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 222); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 1); + increaseIndent(); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + decreaseIndent(); + } + }); + setWriter(oldWriter); + } + prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; + } }); + moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); } return { reportedDeclarationError: reportedDeclarationError, @@ -23696,13 +23998,12 @@ var ts; referencePathsOutput: referencePathsOutput }; function hasInternalAnnotation(range) { - var text = currentSourceFile.text; - var comment = text.substring(range.pos, range.end); + var comment = currentText.substring(range.pos, range.end); return comment.indexOf("@internal") >= 0; } function stripInternal(node) { if (node) { - var leadingCommentRanges = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + var leadingCommentRanges = ts.getLeadingCommentRanges(currentText, node.pos); if (ts.forEach(leadingCommentRanges, hasInternalAnnotation)) { return; } @@ -23783,7 +24084,7 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -23847,9 +24148,9 @@ var ts; } function writeJsDocComments(declaration) { if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); + var jsDocComments = ts.getJsDocCommentsFromText(declaration, currentText); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, declaration, jsDocComments); + ts.emitComments(currentText, currentLineMap, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -23866,7 +24167,7 @@ var ts; case 103: case 97: case 9: - return writeTextOfNode(currentSourceFile, type); + return writeTextOfNode(currentText, type); case 188: return emitExpressionWithTypeArguments(type); case 151: @@ -23897,14 +24198,14 @@ var ts; } function writeEntityName(entityName) { if (entityName.kind === 69) { - writeTextOfNode(currentSourceFile, entityName); + writeTextOfNode(currentText, entityName); } else { var left = entityName.kind === 135 ? entityName.left : entityName.expression; var right = entityName.kind === 135 ? entityName.right : entityName.name; writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, right); + writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { @@ -23932,7 +24233,7 @@ var ts; } } function emitTypePredicate(type) { - writeTextOfNode(currentSourceFile, type.parameterName); + writeTextOfNode(currentText, type.parameterName); write(" is "); emitType(type.type); } @@ -23972,20 +24273,23 @@ var ts; } } function emitSourceFile(node) { - currentSourceFile = node; + currentText = node.text; + currentLineMap = ts.getLineStarts(node); + currentIdentifiers = node.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentSourceFile, writer, ts.writeCommentRange, node, newLine, true); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true); emitLines(node.statements); } function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + if (!ts.hasProperty(currentIdentifiers, baseName)) { return baseName; } var count = 0; while (true) { var name_19 = baseName + "_" + (++count); - if (!ts.hasProperty(currentSourceFile.identifiers, name_19)) { + if (!ts.hasProperty(currentIdentifiers, name_19)) { return name_19; } } @@ -23993,7 +24297,7 @@ var ts; function emitExportAssignment(node) { if (node.expression.kind === 69) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + writeTextOfNode(currentText, node.expression); } else { var tempVarName = getExportDefaultTempVariableName(); @@ -24028,7 +24332,7 @@ var ts; writeModuleElement(node); } else if (node.kind === 221 || - (node.parent.kind === 248 && ts.isExternalModule(currentSourceFile))) { + (node.parent.kind === 248 && isCurrentFileExternalModule)) { var isVisible; if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248) { asynchronousSubModuleDeclarationEmitInfo.push({ @@ -24080,14 +24384,14 @@ var ts; } } function emitModuleElementDeclarationFlags(node) { - if (node.parent === currentSourceFile) { + if (node.parent.kind === 248) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 215) { + else if (node.kind !== 215 && !noDeclare) { write("declare "); } } @@ -24112,7 +24416,7 @@ var ts; write("export "); } write("import "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" = "); if (ts.isInternalModuleImportEqualsDeclaration(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); @@ -24120,7 +24424,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentSourceFile, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); write(");"); } writer.writeLine(); @@ -24154,7 +24458,7 @@ var ts; if (node.importClause) { var currentWriterPos = writer.getTextPos(); if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { - writeTextOfNode(currentSourceFile, node.importClause.name); + writeTextOfNode(currentText, node.importClause.name); } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { @@ -24162,7 +24466,7 @@ var ts; } if (node.importClause.namedBindings.kind === 224) { write("* as "); - writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + writeTextOfNode(currentText, node.importClause.namedBindings.name); } else { write("{ "); @@ -24172,16 +24476,28 @@ var ts; } write(" from "); } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier) { + if (moduleSpecifier.kind === 9 && (!root) && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + if (moduleName) { + write("\""); + write(moduleName); + write("\""); + return; + } + } + writeTextOfNode(currentText, moduleSpecifier); + } function emitImportOrExportSpecifier(node) { if (node.propertyName) { - writeTextOfNode(currentSourceFile, node.propertyName); + writeTextOfNode(currentText, node.propertyName); write(" as "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); @@ -24201,7 +24517,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -24215,11 +24531,11 @@ var ts; else { write("module "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); while (node.body.kind !== 219) { node = node.body; write("."); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -24238,7 +24554,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("type "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); emitTypeParameters(node.typeParameters); write(" = "); emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); @@ -24260,7 +24576,7 @@ var ts; write("const "); } write("enum "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" {"); writeLine(); increaseIndent(); @@ -24271,7 +24587,7 @@ var ts; } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var enumMemberValue = resolver.getConstantValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -24288,7 +24604,7 @@ var ts; increaseIndent(); emitJsDocComments(node); decreaseIndent(); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); if (node.parent.kind === 152 || @@ -24398,7 +24714,7 @@ var ts; write("abstract "); } write("class "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -24421,7 +24737,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("interface "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -24451,7 +24767,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if ((node.kind === 141 || node.kind === 140) && ts.hasQuestionToken(node)) { write("?"); } @@ -24525,7 +24841,7 @@ var ts; emitBindingPattern(bindingElement.name); } else { - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); } } @@ -24566,7 +24882,7 @@ var ts; emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (!(node.flags & 16)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); @@ -24647,13 +24963,13 @@ var ts; } if (node.kind === 213) { write("function "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } else if (node.kind === 144) { write("constructor"); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (ts.hasQuestionToken(node)) { write("?"); } @@ -24766,7 +25082,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } if (resolver.isOptionalParameter(node)) { write("?"); @@ -24865,7 +25181,7 @@ var ts; } else if (bindingElement.kind === 163) { if (bindingElement.propertyName) { - writeTextOfNode(currentSourceFile, bindingElement.propertyName); + writeTextOfNode(currentText, bindingElement.propertyName); write(": "); } if (bindingElement.name) { @@ -24877,7 +25193,7 @@ var ts; if (bindingElement.dotDotDotToken) { write("..."); } - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); } } } @@ -24960,6 +25276,18 @@ var ts; return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function getResolvedExternalModuleName(host, file) { + return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); + } + ts.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || ts.isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); + } + ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; var entities = { "quot": 0x0022, "amp": 0x0026, @@ -25229,15 +25557,19 @@ var ts; var newLine = host.getNewLine(); var jsxDesugaring = host.getCompilerOptions().jsx !== 1; var shouldEmitJsx = function (s) { return (s.languageVariant === 1 && !jsxDesugaring); }; + var outFile = compilerOptions.outFile || compilerOptions.out; + var emitJavaScript = createFileEmitter(); if (targetSourceFile === undefined) { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.outFile || compilerOptions.out) { - emitFile(compilerOptions.outFile || compilerOptions.out); + if (outFile) { + emitFile(outFile); + } + else { + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); + emitFile(jsFilePath, sourceFile); + } + }); } } else { @@ -25245,8 +25577,8 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); emitFile(jsFilePath, targetSourceFile); } - else if (!ts.isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) { - emitFile(compilerOptions.outFile || compilerOptions.out); + else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { + emitFile(outFile); } } diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); @@ -25296,20 +25628,26 @@ var ts; } } } - function emitJavaScript(jsFilePath, root) { + function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var currentText; + var currentLineMap; + var currentFileIdentifiers; + var renamedDependencies; + var isEs6Module; + var isCurrentFileExternalModule; var exportFunctionForFile; - var generatedNameSet = {}; - var nodeToGeneratedName = []; + var generatedNameSet; + var nodeToGeneratedName; var computedPropertyNamesToGeneratedNames; var convertedLoopState; - var extendsEmitted = false; - var decorateEmitted = false; - var paramEmitted = false; - var awaiterEmitted = false; - var tempFlags = 0; + var extendsEmitted; + var decorateEmitted; + var paramEmitted; + var awaiterEmitted; + var tempFlags; var tempVariables; var tempParameters; var externalImports; @@ -25326,6 +25664,7 @@ var ts; var scopeEmitStart = function (scopeDeclaration, scopeName) { }; var scopeEmitEnd = function () { }; var sourceMapData; + var root; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, @@ -25335,30 +25674,75 @@ var ts; _a[1] = emitCommonJSModule, _a ); - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - emitSourceFile(root); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); + var bundleEmitDelegates = (_b = {}, + _b[5] = function () { }, + _b[2] = emitAMDModule, + _b[4] = emitSystemModule, + _b[3] = function () { }, + _b[1] = function () { }, + _b + ); + return doEmit; + function doEmit(jsFilePath, rootFile) { + writer.reset(); + currentSourceFile = undefined; + currentText = undefined; + currentLineMap = undefined; + exportFunctionForFile = undefined; + generatedNameSet = {}; + nodeToGeneratedName = []; + computedPropertyNamesToGeneratedNames = undefined; + convertedLoopState = undefined; + extendsEmitted = false; + decorateEmitted = false; + paramEmitted = false; + awaiterEmitted = false; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = undefined; + detachedCommentsInfo = undefined; + sourceMapData = undefined; + isEs6Module = false; + renamedDependencies = undefined; + isCurrentFileExternalModule = false; + root = rootFile; + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { + initializeEmitterWithSourceMaps(jsFilePath, root); + } + if (root) { + emitSourceFile(root); + } + else { + if (modulekind) { + ts.forEach(host.getSourceFiles(), emitEmitHelpers); } - }); + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { + emitSourceFile(sourceFile); + } + }); + } + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, compilerOptions.emitBOM); } - writeLine(); - writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); - return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + currentText = sourceFile.text; + currentLineMap = ts.getLineStarts(sourceFile); exportFunctionForFile = undefined; + isEs6Module = sourceFile.symbol && sourceFile.symbol.exports && !!sourceFile.symbol.exports["___esModule"]; + renamedDependencies = sourceFile.renamedDependencies; + currentFileIdentifiers = sourceFile.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(sourceFile); emit(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(currentFileIdentifiers, name) && !ts.hasProperty(generatedNameSet, name); } function makeTempVariableName(flags) { @@ -25431,7 +25815,7 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps() { + function initializeEmitterWithSourceMaps(jsFilePath, root) { var sourceMapDir; var sourceMapSourceIndex = -1; var sourceMapNameIndexMap = {}; @@ -25500,7 +25884,7 @@ var ts; } } function recordSourceMapSpan(pos) { - var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); sourceLinePos.line++; sourceLinePos.character++; var emittedLine = writer.getLine(); @@ -25528,13 +25912,13 @@ var ts; } } function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); + recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); } function recordEmitNodeEndSpan(node) { recordSourceMapSpan(node.end); } function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + var tokenStartPos = ts.skipTrivia(currentText, startPos); recordSourceMapSpan(tokenStartPos); var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); recordSourceMapSpan(tokenEndPos); @@ -25604,9 +25988,9 @@ var ts; sourceMapNameIndices.pop(); } ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { + function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { @@ -25636,7 +26020,7 @@ var ts; return output; } } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); @@ -25649,7 +26033,7 @@ var ts; ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; } - writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); } var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { @@ -25712,7 +26096,7 @@ var ts; scopeEmitEnd = recordScopeNameEnd; writeComment = writeCommentRangeWithMap; } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function createTempVariable(flags) { @@ -25882,7 +26266,7 @@ var ts; return getQuotedEscapedLiteralText("\"", node.text, "\""); } if (node.parent) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + return ts.getTextOfNodeFromSourceText(currentText, node); } switch (node.kind) { case 9: @@ -25904,7 +26288,7 @@ var ts; return leftQuote + ts.escapeNonAsciiCharacters(ts.escapeString(text)) + rightQuote; } function emitDownlevelRawTemplateLiteral(node) { - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + var text = ts.getTextOfNodeFromSourceText(currentText, node); var isLast = node.kind === 11 || node.kind === 14; text = text.substring(1, text.length - (isLast ? 1 : 2)); text = text.replace(/\r\n?/g, "\n"); @@ -26234,7 +26618,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } write("\""); } @@ -26330,7 +26714,7 @@ var ts; else if (declaration.kind === 226) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); var name_24 = declaration.propertyName || declaration.name; - var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name_24); + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -26354,7 +26738,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function isNameOfNestedRedeclaration(node) { @@ -26391,7 +26775,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function emitThis(node) { @@ -26758,8 +27142,8 @@ var ts; return container && container.kind !== 248; } function emitShorthandPropertyAssignment(node) { - writeTextOfNode(currentSourceFile, node.name); - if (languageVersion < 2 || isNamespaceExportReference(node.name)) { + writeTextOfNode(currentText, node.name); + if (modulekind !== 5 || isNamespaceExportReference(node.name)) { write(": "); emit(node.name); } @@ -26809,10 +27193,10 @@ var ts; } emit(node.expression); var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); - var shouldEmitSpace; + var shouldEmitSpace = false; if (!indentedBeforeDot) { if (node.expression.kind === 8) { - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node.expression); + var text = ts.getTextOfNodeFromSourceText(currentText, node.expression); shouldEmitSpace = text.indexOf(ts.tokenToString(21)) < 0; } else { @@ -27818,16 +28202,16 @@ var ts; emitToken(16, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node1.pos)) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { if (node.kind === 241) { @@ -27932,7 +28316,7 @@ var ts; if (node.parent.kind === 248) { ts.Debug.assert(!!(node.flags & 512) || node.kind === 227); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { - if (!currentSourceFile.symbol.exports["___esModule"]) { + if (!isEs6Module) { if (languageVersion === 1) { write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); @@ -28095,12 +28479,18 @@ var ts; return node; } function createPropertyAccessForDestructuringProperty(object, propName) { - var syntheticName = ts.createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== 69) { - return createElementAccessExpression(object, syntheticName); + var index; + var nameIsComputed = propName.kind === 136; + if (nameIsComputed) { + index = ensureIdentifier(propName.expression, false); } - return createPropertyAccessExpression(object, syntheticName); + else { + index = ts.createSynthesizedNode(propName.kind); + index.text = propName.text; + } + return !nameIsComputed && index.kind === 69 + ? createPropertyAccessExpression(object, index) + : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { var call = ts.createSynthesizedNode(168); @@ -28514,7 +28904,6 @@ var ts; var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); var isArrowFunction = node.kind === 174; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; - var args; if (!isArrowFunction) { write(" {"); increaseIndent(); @@ -29688,8 +30077,8 @@ var ts; } } function tryRenameExternalModule(moduleName) { - if (currentSourceFile.renamedDependencies && ts.hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { - return "\"" + currentSourceFile.renamedDependencies[moduleName.text] + "\""; + if (renamedDependencies && ts.hasProperty(renamedDependencies, moduleName.text)) { + return "\"" + renamedDependencies[moduleName.text] + "\""; } return undefined; } @@ -29829,7 +30218,7 @@ var ts; return; } if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + (!isCurrentFileExternalModule && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); var variableDeclarationIsHoisted = shouldHoistVariable(node, true); @@ -30041,7 +30430,7 @@ var ts; function getLocalNameForExternalImport(node) { var namespaceDeclaration = getNamespaceDeclarationNode(node); if (namespaceDeclaration && !isDefaultImport(node)) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } if (node.kind === 222 && node.importClause) { return getGeneratedNameForNode(node); @@ -30314,7 +30703,7 @@ var ts; ts.getEnclosingBlockScopeContainer(node).kind === 248; } function isCurrentFileSystemExternalModule() { - return modulekind === 4 && ts.isExternalModule(currentSourceFile); + return modulekind === 4 && isCurrentFileExternalModule; } function emitSystemModuleBody(node, dependencyGroups, startIndex) { emitVariableDeclarationsForImports(); @@ -30427,15 +30816,19 @@ var ts; writeLine(); write("}"); } - function emitSystemModule(node) { + function writeModuleName(node, emitRelativePathAsModuleName) { + var moduleName = node.moduleName; + if (moduleName || (emitRelativePathAsModuleName && (moduleName = getResolvedExternalModuleName(host, node)))) { + write("\"" + moduleName + "\", "); + } + } + function emitSystemModule(node, emitRelativePathAsModuleName) { collectExternalModuleInfo(node); ts.Debug.assert(!exportFunctionForFile); exportFunctionForFile = makeUniqueName("exports"); writeLine(); write("System.register("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } + writeModuleName(node, emitRelativePathAsModuleName); write("["); var groupIndices = {}; var dependencyGroups = []; @@ -30453,6 +30846,12 @@ var ts; if (i !== 0) { write(", "); } + if (emitRelativePathAsModuleName) { + var name_30 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); + if (name_30) { + text = "\"" + name_30 + "\""; + } + } write(text); } write("], function(" + exportFunctionForFile + ") {"); @@ -30466,7 +30865,7 @@ var ts; writeLine(); write("});"); } - function getAMDDependencyNames(node, includeNonAmdDependencies) { + function getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { var aliasedModuleNames = []; var unaliasedModuleNames = []; var importAliasNames = []; @@ -30483,6 +30882,12 @@ var ts; for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; var externalModuleName = getExternalModuleNameText(importNode); + if (emitRelativePathAsModuleName) { + var name_31 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_31) { + externalModuleName = "\"" + name_31 + "\""; + } + } var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); @@ -30494,8 +30899,8 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function emitAMDDependencies(node, includeNonAmdDependencies) { - var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies); + function emitAMDDependencies(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { + var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName); emitAMDDependencyList(dependencyNames); write(", "); emitAMDFactoryHeader(dependencyNames); @@ -30522,15 +30927,13 @@ var ts; } write(") {"); } - function emitAMDModule(node) { + function emitAMDModule(node, emitRelativePathAsModuleName) { emitEmitHelpers(node); collectExternalModuleInfo(node); writeLine(); write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, true); + writeModuleName(node, emitRelativePathAsModuleName); + emitAMDDependencies(node, true, emitRelativePathAsModuleName); increaseIndent(); var startIndex = emitDirectivePrologues(node.statements, true); emitExportStarHelper(); @@ -30736,8 +31139,13 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; - emitModule(node); + if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; + emitModule(node); + } + else { + bundleEmitDelegates[modulekind](node, true); + } } else { var startIndex = emitDirectivePrologues(node.statements, false); @@ -30981,7 +31389,7 @@ var ts; return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentText, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -30991,10 +31399,10 @@ var ts; return leadingComments; } function isTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + if (currentText.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47) { - var textSubStr = currentSourceFile.text.substring(comment.pos, comment.end); + currentText.charCodeAt(comment.pos + 2) === 47) { + var textSubStr = currentText.substring(comment.pos, comment.end); return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? true : false; @@ -31008,7 +31416,7 @@ var ts; return getLeadingCommentsWithoutDetachedComments(); } else { - return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNodeFromText(node, currentText); } } } @@ -31016,7 +31424,7 @@ var ts; function getTrailingCommentsToEmit(node) { if (node.parent) { if (node.parent.kind === 248 || node.end !== node.parent.end) { - return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); + return ts.getTrailingCommentRanges(currentText, node.end); } } } @@ -31039,22 +31447,22 @@ var ts; leadingComments = ts.filter(getLeadingCommentsToEmit(node), isTripleSlashComment); } } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { return; } var trailingComments = getTrailingCommentsToEmit(node); - ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, false, newLine, writeComment); } function emitTrailingCommentsOfPosition(pos) { if (compilerOptions.removeComments) { return; } - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, pos); - ts.emitComments(currentSourceFile, writer, trailingComments, true, newLine, writeComment); + var trailingComments = ts.getTrailingCommentRanges(currentText, pos); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, true, newLine, writeComment); } function emitLeadingCommentsOfPositionWorker(pos) { if (compilerOptions.removeComments) { @@ -31065,13 +31473,13 @@ var ts; leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentText, pos); } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, { pos: pos, end: pos }, leadingComments); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, true, newLine, writeComment); } function emitDetachedCommentsAndUpdateCommentsInfo(node) { - var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, compilerOptions.removeComments); + var currentDetachedCommentInfo = ts.emitDetachedComments(currentText, currentLineMap, writer, writeComment, node, newLine, compilerOptions.removeComments); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -31082,12 +31490,12 @@ var ts; } } function emitShebang() { - var shebang = ts.getShebang(currentSourceFile.text); + var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); } } - var _a; + var _a, _b; } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); @@ -31143,11 +31551,11 @@ var ts; if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -31157,8 +31565,8 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(candidate, failedLookupLocation, host) { - return ts.forEach(ts.moduleFileExtensions, tryLoad); + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; if (host.fileExists(fileName)) { @@ -31170,7 +31578,7 @@ var ts; } } } - function loadNodeModuleFromDirectory(candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); if (host.fileExists(packageJsonPath)) { var jsonContent; @@ -31182,7 +31590,7 @@ var ts; jsonContent = { typings: undefined }; } if (jsonContent.typings) { - var result = loadNodeModuleFromFile(ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); if (result) { return result; } @@ -31191,7 +31599,7 @@ var ts; else { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -31201,11 +31609,11 @@ var ts; if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -31230,9 +31638,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; + var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(ts.supportedExtensions, function (extension) { + referencedSourceFile = ts.forEach(extensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { return undefined; } @@ -31260,10 +31669,8 @@ var ts; ts.classicNameResolver = classicNameResolver; ts.defaultInitCompilerOptions = { module: 1, - target: 0, + target: 1, noImplicitAny: false, - outDir: "built", - rootDir: ".", sourceMap: false }; function createCompilerHost(options, setParentNodes) { @@ -31621,35 +32028,47 @@ var ts; if (file.imports) { return; } + var isJavaScriptFile = ts.isSourceFileJavaScript(file); var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, true); + collect(node, true, false); } file.imports = imports || emptyArray; - function collect(node, allowRelativeModuleNames) { - switch (node.kind) { - case 222: - case 221: - case 228: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9) { + return; + function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { + if (!collectOnlyRequireCalls) { + switch (node.kind) { + case 222: + case 221: + case 228: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9) { + break; + } + if (!moduleNameExpr.text) { + break; + } + if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } break; - } - if (!moduleNameExpr.text) { + case 218: + if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { + ts.forEachChild(node.body, function (node) { + collect(node, false, collectOnlyRequireCalls); + }); + } break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } - break; - case 218: - if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { - ts.forEachChild(node.body, function (node) { - collect(node, false); - }); - } - break; + } + } + if (isJavaScriptFile) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, true); }); + } } } } @@ -31736,7 +32155,6 @@ var ts; } processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -31809,6 +32227,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (!commonPathComponents) { + return currentDirectory; + } return ts.getNormalizedPathFromPathComponents(commonPathComponents); } function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { @@ -31891,10 +32312,12 @@ var ts; if (options.module === 5 && languageVersion < 2) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); } + if (outFile && options.module && !(options.module === 2 || options.module === 4)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile")); + } if (options.outDir || options.sourceRoot || - (options.mapRoot && - (!outFile || firstExternalModuleSourceFile !== undefined))) { + options.mapRoot) { if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); } @@ -32448,10 +32871,10 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_30 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_30); + for (var name_32 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_32); if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_30); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); if (!matches) { continue; } @@ -32462,14 +32885,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_30); + matches = patternMatcher.getMatches(containers, name_32); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_30, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -32797,9 +33220,9 @@ var ts; case 211: case 163: var variableDeclarationNode; - var name_31; + var name_33; if (node.kind === 163) { - name_31 = node.name; + name_33 = node.name; variableDeclarationNode = node; while (variableDeclarationNode && variableDeclarationNode.kind !== 211) { variableDeclarationNode = variableDeclarationNode.parent; @@ -32809,16 +33232,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_31 = node.name; + name_33 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); } case 144: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -33425,7 +33848,7 @@ var ts; var resolvedSignature = typeChecker.getResolvedSignature(call, candidates); cancellationToken.throwIfCancellationRequested(); if (!candidates.length) { - if (ts.isJavaScript(sourceFile.fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { return createJavaScriptSignatureHelpItems(argumentInfo); } return undefined; @@ -34941,9 +35364,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_32 in o) { - if (o[name_32] === rule) { - return name_32; + for (var name_34 in o) { + if (o[name_34] === rule) { + return name_34; } } throw new Error("Unknown rule"); @@ -35318,7 +35741,7 @@ var ts; function TokenRangeAccess(from, to, except) { this.tokens = []; for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { + if (ts.indexOf(except, token) < 0) { this.tokens.push(token); } } @@ -36706,13 +37129,18 @@ var ts; ]; var jsDocCompletionEntries; function createNode(kind, pos, end, flags, parent) { - var node = new (ts.getNodeConstructor(kind))(pos, end); + var node = new NodeObject(kind, pos, end); node.flags = flags; node.parent = parent; return node; } var NodeObject = (function () { - function NodeObject() { + function NodeObject(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0; + this.parent = undefined; } NodeObject.prototype.getSourceFile = function () { return ts.getSourceFileOfNode(this); @@ -37151,8 +37579,8 @@ var ts; })(); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); - function SourceFileObject() { - _super.apply(this, arguments); + function SourceFileObject(kind, pos, end) { + _super.call(this, kind, pos, end); } SourceFileObject.prototype.update = function (newText, textChangeRange) { return ts.updateSourceFile(this, newText, textChangeRange); @@ -37421,6 +37849,9 @@ var ts; ClassificationTypeNames.typeAliasName = "type alias name"; ClassificationTypeNames.parameterName = "parameter name"; ClassificationTypeNames.docCommentTagName = "doc comment tag name"; + ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; + ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; + ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -37740,8 +38171,9 @@ var ts; }; } ts.createDocumentRegistry = createDocumentRegistry; - function preProcessFile(sourceText, readImportFiles) { + function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { if (readImportFiles === void 0) { readImportFiles = true; } + if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; } var referencedFiles = []; var importedFiles = []; var ambientExternalModules; @@ -37775,93 +38207,53 @@ var ts; end: pos + importPath.length }); } - function processImport() { - scanner.setText(sourceText); - var token = scanner.scan(); - while (token !== 1) { - if (token === 122) { - token = scanner.scan(); - if (token === 125) { - token = scanner.scan(); - if (token === 9) { - recordAmbientExternalModule(); - continue; - } - } - } - else if (token === 89) { + function tryConsumeDeclare() { + var token = scanner.getToken(); + if (token === 122) { + token = scanner.scan(); + if (token === 125) { token = scanner.scan(); if (token === 9) { - recordModuleName(); - continue; - } - else { - if (token === 69 || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133) { - token = scanner.scan(); - if (token === 9) { - recordModuleName(); - continue; - } - } - else if (token === 56) { - token = scanner.scan(); - if (token === 127) { - token = scanner.scan(); - if (token === 17) { - token = scanner.scan(); - if (token === 9) { - recordModuleName(); - continue; - } - } - } - } - else if (token === 24) { - token = scanner.scan(); - } - else { - continue; - } - } - if (token === 15) { - token = scanner.scan(); - while (token !== 16) { - token = scanner.scan(); - } - if (token === 16) { - token = scanner.scan(); - if (token === 133) { - token = scanner.scan(); - if (token === 9) { - recordModuleName(); - } - } - } - } - else if (token === 37) { - token = scanner.scan(); - if (token === 116) { - token = scanner.scan(); - if (token === 69 || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133) { - token = scanner.scan(); - if (token === 9) { - recordModuleName(); - } - } - } - } - } + recordAmbientExternalModule(); } } - else if (token === 82) { - token = scanner.scan(); + return true; + } + return false; + } + function tryConsumeImport() { + var token = scanner.getToken(); + if (token === 89) { + token = scanner.scan(); + if (token === 9) { + recordModuleName(); + return true; + } + else { + if (token === 69 || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133) { + token = scanner.scan(); + if (token === 9) { + recordModuleName(); + return true; + } + } + else if (token === 56) { + if (tryConsumeRequireCall(true)) { + return true; + } + } + else if (token === 24) { + token = scanner.scan(); + } + else { + return true; + } + } if (token === 15) { token = scanner.scan(); - while (token !== 16) { + while (token !== 16 && token !== 1) { token = scanner.scan(); } if (token === 16) { @@ -37875,6 +38267,35 @@ var ts; } } else if (token === 37) { + token = scanner.scan(); + if (token === 116) { + token = scanner.scan(); + if (token === 69 || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133) { + token = scanner.scan(); + if (token === 9) { + recordModuleName(); + } + } + } + } + } + } + return true; + } + return false; + } + function tryConsumeExport() { + var token = scanner.getToken(); + if (token === 82) { + token = scanner.scan(); + if (token === 15) { + token = scanner.scan(); + while (token !== 16 && token !== 1) { + token = scanner.scan(); + } + if (token === 16) { token = scanner.scan(); if (token === 133) { token = scanner.scan(); @@ -37883,31 +38304,99 @@ var ts; } } } - else if (token === 89) { + } + else if (token === 37) { + token = scanner.scan(); + if (token === 133) { token = scanner.scan(); - if (token === 69 || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 56) { - token = scanner.scan(); - if (token === 127) { - token = scanner.scan(); - if (token === 17) { - token = scanner.scan(); - if (token === 9) { - recordModuleName(); - } - } - } + if (token === 9) { + recordModuleName(); + } + } + } + else if (token === 89) { + token = scanner.scan(); + if (token === 69 || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 56) { + if (tryConsumeRequireCall(true)) { + return true; } } } } + return true; + } + return false; + } + function tryConsumeRequireCall(skipCurrentToken) { + var token = skipCurrentToken ? scanner.scan() : scanner.getToken(); + if (token === 127) { token = scanner.scan(); + if (token === 17) { + token = scanner.scan(); + if (token === 9) { + recordModuleName(); + } + } + return true; + } + return false; + } + function tryConsumeDefine() { + var token = scanner.getToken(); + if (token === 69 && scanner.getTokenValue() === "define") { + token = scanner.scan(); + if (token !== 17) { + return true; + } + token = scanner.scan(); + if (token === 9) { + token = scanner.scan(); + if (token === 24) { + token = scanner.scan(); + } + else { + return true; + } + } + if (token !== 19) { + return true; + } + token = scanner.scan(); + var i = 0; + while (token !== 20 && token !== 1) { + if (token === 9) { + recordModuleName(); + i++; + } + token = scanner.scan(); + } + return true; + } + return false; + } + function processImports() { + scanner.setText(sourceText); + scanner.scan(); + while (true) { + if (scanner.getToken() === 1) { + break; + } + if (tryConsumeDeclare() || + tryConsumeImport() || + tryConsumeExport() || + (detectJavaScriptImports && (tryConsumeRequireCall(false) || tryConsumeDefine()))) { + continue; + } + else { + scanner.scan(); + } } scanner.setText(undefined); } if (readImportFiles) { - processImport(); + processImports(); } processTripleSlashDirectives(); return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientExternalModules }; @@ -38250,7 +38739,7 @@ var ts; function getSemanticDiagnostics(fileName) { synchronizeHostData(); var targetSourceFile = getValidSourceFile(fileName); - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(targetSourceFile)) { return getJavaScriptSemanticDiagnostics(targetSourceFile); } var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); @@ -38442,7 +38931,7 @@ var ts; var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); - var isJavaScriptFile = ts.isJavaScript(fileName); + var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); @@ -38953,8 +39442,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_33 = element.propertyName || element.name; - exisingImportsOrExports[name_33.text] = true; + var name_35 = element.propertyName || element.name; + exisingImportsOrExports[name_35.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -38978,7 +39467,9 @@ var ts; } var existingName = void 0; if (m.kind === 163 && m.propertyName) { - existingName = m.propertyName.text; + if (m.propertyName.kind === 69) { + existingName = m.propertyName.text; + } } else { existingName = m.name.text; @@ -39008,44 +39499,41 @@ var ts; return undefined; } var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot, isJsDocTagName = completionData.isJsDocTagName; - var entries; if (isJsDocTagName) { return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() }; } - if (isRightOfDot && ts.isJavaScript(fileName)) { - entries = getCompletionEntriesFromSymbols(symbols); - ts.addRange(entries, getJavaScriptCompletionEntries()); + var sourceFile = getValidSourceFile(fileName); + var entries = []; + if (isRightOfDot && ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames)); } else { if (!symbols || symbols.length === 0) { return undefined; } - entries = getCompletionEntriesFromSymbols(symbols); + getCompletionEntriesFromSymbols(symbols, entries); } if (!isMemberCompletion && !isJsDocTagName) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries() { + function getJavaScriptCompletionEntries(sourceFile, uniqueNames) { var entries = []; - var allNames = {}; var target = program.getCompilerOptions().target; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - var nameTable = getNameTable(sourceFile); - for (var name_34 in nameTable) { - if (!allNames[name_34]) { - allNames[name_34] = name_34; - var displayName = getCompletionEntryDisplayName(name_34, target, true); - if (displayName) { - var entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } + var nameTable = getNameTable(sourceFile); + for (var name_36 in nameTable) { + if (!uniqueNames[name_36]) { + uniqueNames[name_36] = name_36; + var displayName = getCompletionEntryDisplayName(name_36, target, true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); } } } @@ -39073,25 +39561,24 @@ var ts; sortText: "0" }; } - function getCompletionEntriesFromSymbols(symbols) { + function getCompletionEntriesFromSymbols(symbols, entries) { var start = new Date().getTime(); - var entries = []; + var uniqueNames = {}; if (symbols) { - var nameToSymbol = {}; for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) { var symbol = symbols_3[_i]; var entry = createCompletionEntry(symbol, location); if (entry) { var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(nameToSymbol, id)) { + if (!ts.lookUp(uniqueNames, id)) { entries.push(entry); - nameToSymbol[id] = symbol; + uniqueNames[id] = id; } } } } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); - return entries; + return uniqueNames; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -39272,16 +39759,16 @@ var ts; case ScriptElementKind.letElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(ts.punctuationPart(54)); + displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(92)); + displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); displayParts.push(ts.spacePart()); } - if (!(type.flags & 65536)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); + if (!(type.flags & ts.TypeFlags.Anonymous)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); } - addSignatureDisplayParts(signature, allSignatures, 8); + addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); break; default: addSignatureDisplayParts(signature, allSignatures); @@ -40728,17 +41215,17 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_35 = node.text; + var name_37 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_35); + var unionProperty = contextualType.getProperty(name_37); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_35); + var symbol = t.getProperty(name_37); if (symbol) { result_4.push(symbol); } @@ -40747,7 +41234,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_35); + var symbol_1 = contextualType.getProperty(name_37); if (symbol_1) { return [symbol_1]; } @@ -41105,6 +41592,9 @@ var ts; case 16: return ClassificationTypeNames.typeAliasName; case 17: return ClassificationTypeNames.parameterName; case 18: return ClassificationTypeNames.docCommentTagName; + case 19: return ClassificationTypeNames.jsxOpenTagName; + case 20: return ClassificationTypeNames.jsxCloseTagName; + case 21: return ClassificationTypeNames.jsxSelfClosingTagName; } } function convertClassifications(classifications) { @@ -41344,6 +41834,21 @@ var ts; return 17; } return; + case 235: + if (token.parent.tagName === token) { + return 19; + } + return; + case 237: + if (token.parent.tagName === token) { + return 20; + } + return; + case 234: + if (token.parent.tagName === token) { + return 21; + } + return; } } return 2; @@ -42053,18 +42558,8 @@ var ts; ts.getDefaultLibFilePath = getDefaultLibFilePath; function initializeServices() { ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0; - this.parent = undefined; - } - var proto = kind === 248 ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - Node.prototype = proto; - return Node; - }, + getNodeConstructor: function () { return NodeObject; }, + getSourceFileConstructor: function () { return SourceFileObject; }, getSymbolConstructor: function () { return SymbolObject; }, getTypeConstructor: function () { return TypeObject; }, getSignatureConstructor: function () { return SignatureObject; } @@ -42959,8 +43454,8 @@ var ts; }; Session.prototype.getDiagnosticsForProject = function (delay, fileName) { var _this = this; - var _a = this.getProjectInfo(fileName, true), configFileName = _a.configFileName, fileNamesInProject = _a.fileNames; - fileNamesInProject = fileNamesInProject.filter(function (value, index, array) { return value.indexOf("lib.d.ts") < 0; }); + var _a = this.getProjectInfo(fileName, true), configFileName = _a.configFileName, fileNames = _a.fileNames; + var fileNamesInProject = fileNames.filter(function (value, index, array) { return value.indexOf("lib.d.ts") < 0; }); var highPriorityFiles = []; var mediumPriorityFiles = []; var lowPriorityFiles = []; @@ -43329,6 +43824,9 @@ var ts; this.filenameToSourceFile = {}; this.updateGraphSeq = 0; this.openRefCount = 0; + if (projectOptions && projectOptions.files) { + projectOptions.compilerOptions.allowNonTsExtensions = true; + } this.compilerService = new CompilerService(this, projectOptions && projectOptions.compilerOptions); } Project.prototype.addOpenRef = function () { @@ -43399,6 +43897,7 @@ var ts; Project.prototype.setProjectOptions = function (projectOptions) { this.projectOptions = projectOptions; if (projectOptions.compilerOptions) { + projectOptions.compilerOptions.allowNonTsExtensions = true; this.compilerService.setCompilerOptions(projectOptions.compilerOptions); } }; @@ -43824,7 +44323,6 @@ var ts; } } if (content !== undefined) { - var indentSize; info = new ScriptInfo(this.host, fileName, content, openedByClient); info.setFormatOptions(this.getFormatCodeOptions()); this.filenameToScriptInfo[fileName] = info; @@ -44081,7 +44579,9 @@ var ts; this.setCompilerOptions(opt); } else { - this.setCompilerOptions(ts.getDefaultCompilerOptions()); + var defaultOpts = ts.getDefaultCompilerOptions(); + defaultOpts.allowNonTsExtensions = true; + this.setCompilerOptions(defaultOpts); } this.languageService = ts.createLanguageService(this.host, this.documentRegistry); this.classifier = ts.createClassifier(); @@ -45635,7 +46135,7 @@ var ts; }; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true); var convertResult = { referencedFiles: [], importedFiles: [], @@ -45696,7 +46196,7 @@ var ts; TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { try { if (this.documentRegistry === undefined) { - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var hostAdapter = new LanguageServiceShimHostAdapter(host); var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); @@ -45728,7 +46228,7 @@ var ts; }; TypeScriptServicesFactory.prototype.close = function () { this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); + this.documentRegistry = undefined; }; TypeScriptServicesFactory.prototype.registerShim = function (shim) { this._shims.push(shim); diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 972ebfa472d..32a6dee4623 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -387,6 +387,7 @@ declare namespace ts { right: Identifier; } type EntityName = Identifier | QualifiedName; + type PropertyName = Identifier | LiteralExpression | ComputedPropertyName; type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; interface Declaration extends Node { _declarationBrand: any; @@ -425,7 +426,7 @@ declare namespace ts { initializer?: Expression; } interface BindingElement extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: Identifier | BindingPattern; initializer?: Expression; @@ -452,7 +453,7 @@ declare namespace ts { objectAssignmentInitializer?: Expression; } interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: DeclarationName; questionToken?: Node; @@ -581,7 +582,7 @@ declare namespace ts { asteriskToken?: Node; expression?: Expression; } - interface BinaryExpression extends Expression { + interface BinaryExpression extends Expression, Declaration { left: Expression; operatorToken: Node; right: Expression; @@ -625,7 +626,7 @@ declare namespace ts { interface ObjectLiteralExpression extends PrimaryExpression, Declaration { properties: NodeArray; } - interface PropertyAccessExpression extends MemberExpression { + interface PropertyAccessExpression extends MemberExpression, Declaration { expression: LeftHandSideExpression; dotToken: Node; name: Identifier; @@ -1220,6 +1221,7 @@ declare namespace ts { ObjectLiteral = 524288, ESSymbol = 16777216, ThisType = 33554432, + ObjectLiteralPatternWithComputedProperties = 67108864, StringLike = 258, NumberLike = 132, ObjectType = 80896, @@ -1537,7 +1539,6 @@ declare namespace ts { function getTypeParameterOwner(d: Declaration): Declaration; } declare namespace ts { - function getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node; function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; @@ -2126,6 +2127,9 @@ declare namespace ts { static typeAliasName: string; static parameterName: string; static docCommentTagName: string; + static jsxOpenTagName: string; + static jsxCloseTagName: string; + static jsxSelfClosingTagName: string; } enum ClassificationType { comment = 1, @@ -2146,6 +2150,9 @@ declare namespace ts { typeAliasName = 16, parameterName = 17, docCommentTagName = 18, + jsxOpenTagName = 19, + jsxCloseTagName = 20, + jsxSelfClosingTagName = 21, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; @@ -2171,7 +2178,7 @@ declare namespace ts { function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; + function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; function createClassifier(): Classifier; /** diff --git a/lib/typescript.js b/lib/typescript.js index 8b0ef04f96e..498ddc37860 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -622,6 +622,7 @@ var ts; TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; TypeFlags[TypeFlags["ESSymbol"] = 16777216] = "ESSymbol"; TypeFlags[TypeFlags["ThisType"] = 33554432] = "ThisType"; + TypeFlags[TypeFlags["ObjectLiteralPatternWithComputedProperties"] = 67108864] = "ObjectLiteralPatternWithComputedProperties"; /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 16777343] = "Intrinsic"; /* @internal */ @@ -1530,12 +1531,7 @@ var ts; * List of supported extensions in order of file resolution precedence. */ ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - /** - * List of extensions that will be used to look for external modules. - * This list is kept separate from supportedExtensions to for cases when we'll allow to include .js files in compilation, - * but still would like to load only TypeScript files as modules - */ - ts.moduleFileExtensions = ts.supportedExtensions; + ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); function isSupportedSourceFileName(fileName) { if (!fileName) { return false; @@ -1586,17 +1582,16 @@ var ts; } function Signature(checker) { } + function Node(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0 /* None */; + this.parent = undefined; + } ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0 /* None */; - this.parent = undefined; - } - Node.prototype = { kind: kind }; - return Node; - }, + getNodeConstructor: function () { return Node; }, + getSourceFileConstructor: function () { return Node; }, getSymbolConstructor: function () { return Symbol; }, getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } @@ -1913,7 +1908,16 @@ var ts; if (writeByteOrderMark) { data = "\uFEFF" + data; } - _fs.writeFileSync(fileName, data, "utf8"); + var fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync(fd, data, undefined, "utf8"); + } + finally { + if (fd !== undefined) { + _fs.closeSync(fd); + } + } } function getCanonicalPath(path) { return useCaseSensitiveFileNames ? path.toLowerCase() : path; @@ -2614,6 +2618,7 @@ var ts; Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, + Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3173,7 +3178,7 @@ var ts; function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; - while (true) { + while (pos < text.length) { var ch = text.charCodeAt(pos); switch (ch) { case 13 /* carriageReturn */: @@ -3242,6 +3247,7 @@ var ts; } return result; } + return result; } function getLeadingCommentRanges(text, pos) { return getCommentRanges(text, pos, /*trailing*/ false); @@ -3343,7 +3349,7 @@ var ts; error(ts.Diagnostics.Digit_expected); } } - return +(text.substring(start, end)); + return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -3770,7 +3776,7 @@ var ts; return pos++, token = 36 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { @@ -3873,7 +3879,7 @@ var ts; case 55 /* _7 */: case 56 /* _8 */: case 57 /* _9 */: - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; case 58 /* colon */: return pos++, token = 54 /* ColonToken */; @@ -4177,1321 +4183,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - ts.bindTime = 0; - (function (ModuleInstanceState) { - ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); - var ModuleInstanceState = ts.ModuleInstanceState; - var Reachability; - (function (Reachability) { - Reachability[Reachability["Unintialized"] = 1] = "Unintialized"; - Reachability[Reachability["Reachable"] = 2] = "Reachable"; - Reachability[Reachability["Unreachable"] = 4] = "Unreachable"; - Reachability[Reachability["ReportedUnreachable"] = 8] = "ReportedUnreachable"; - })(Reachability || (Reachability = {})); - function or(state1, state2) { - return (state1 | state2) & 2 /* Reachable */ - ? 2 /* Reachable */ - : (state1 & state2) & 8 /* ReportedUnreachable */ - ? 8 /* ReportedUnreachable */ - : 4 /* Unreachable */; - } - function getModuleInstanceState(node) { - // A module is uninstantiated if it contains only - // 1. interface declarations, type alias declarations - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { - return 0 /* NonInstantiated */; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2 /* ConstEnumOnly */; - } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { - return 0 /* NonInstantiated */; - } - else if (node.kind === 219 /* ModuleBlock */) { - var state = 0 /* NonInstantiated */; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0 /* NonInstantiated */: - // child is non-instantiated - continue searching - return false; - case 2 /* ConstEnumOnly */: - // child is const enum only - record state and continue searching - state = 2 /* ConstEnumOnly */; - return false; - case 1 /* Instantiated */: - // child is instantiated - record state and stop - state = 1 /* Instantiated */; - return true; - } - }); - return state; - } - else if (node.kind === 218 /* ModuleDeclaration */) { - return getModuleInstanceState(node.body); - } - else { - return 1 /* Instantiated */; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - var ContainerFlags; - (function (ContainerFlags) { - // The current node is not a container, and no container manipulation should happen before - // recursing into it. - ContainerFlags[ContainerFlags["None"] = 0] = "None"; - // The current node is a container. It should be set as the current container (and block- - // container) before recursing into it. The current node does not have locals. Examples: - // - // Classes, ObjectLiterals, TypeLiterals, Interfaces... - ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; - // The current node is a block-scoped-container. It should be set as the current block- - // container before recursing into it. Examples: - // - // Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements... - ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; - ContainerFlags[ContainerFlags["HasLocals"] = 4] = "HasLocals"; - // If the current node is a container that also container that also contains locals. Examples: - // - // Functions, Methods, Modules, Source-files. - ContainerFlags[ContainerFlags["IsContainerWithLocals"] = 5] = "IsContainerWithLocals"; - })(ContainerFlags || (ContainerFlags = {})); - var binder = createBinder(); - function bindSourceFile(file, options) { - var start = new Date().getTime(); - binder(file, options); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function createBinder() { - var file; - var options; - var parent; - var container; - var blockScopeContainer; - var lastContainer; - var seenThisKeyword; - // state used by reachability checks - var hasExplicitReturn; - var currentReachabilityState; - var labelStack; - var labelIndexMap; - var implicitLabels; - // If this file is an external module, then it is automatically in strict-mode according to - // ES6. If it is not an external module, then we'll determine if it is in strict mode or - // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). - var inStrictMode; - var symbolCount = 0; - var Symbol; - var classifiableNames; - function bindSourceFile(f, opts) { - file = f; - options = opts; - inStrictMode = !!file.externalModuleIndicator; - classifiableNames = {}; - Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - bind(file); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; - } - parent = undefined; - container = undefined; - blockScopeContainer = undefined; - lastContainer = undefined; - seenThisKeyword = false; - hasExplicitReturn = false; - labelStack = undefined; - labelIndexMap = undefined; - implicitLabels = undefined; - } - return bindSourceFile; - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolFlags) { - symbol.flags |= symbolFlags; - node.symbol = symbol; - if (!symbol.declarations) { - symbol.declarations = []; - } - symbol.declarations.push(node); - if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) { - symbol.exports = {}; - } - if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { - symbol.members = {}; - } - if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; - } - } - // Should not be called on a declaration with a computed property name, - // unless it is a well known Symbol. - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { - return "\"" + node.name.text + "\""; - } - if (node.name.kind === 136 /* ComputedPropertyName */) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 144 /* Constructor */: - return "__constructor"; - case 152 /* FunctionType */: - case 147 /* CallSignature */: - return "__call"; - case 153 /* ConstructorType */: - case 148 /* ConstructSignature */: - return "__new"; - case 149 /* IndexSignature */: - return "__index"; - case 228 /* ExportDeclaration */: - return "__export"; - case 227 /* ExportAssignment */: - return node.isExportEquals ? "export=" : "default"; - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: - return node.flags & 512 /* Default */ ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - /** - * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. - * @param symbolTable - The symbol table which node will be added to. - * @param parent - node's parent declaration. - * @param node - The declaration to be added to the symbol table - * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.) - * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations. - */ - function declareSymbol(symbolTable, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var isDefaultExport = node.flags & 512 /* Default */; - // The exported symbol for an export default function/class node is always named "default" - var name = isDefaultExport && parent ? "default" : getDeclarationName(node); - var symbol; - if (name !== undefined) { - // Check and see if the symbol table already has a symbol with this name. If not, - // create a new symbol with this name and add it to the table. Note that we don't - // give the new symbol any flags *yet*. This ensures that it will not conflict - // with the 'excludes' flags we pass in. - // - // If we do get an existing symbol, see if it conflicts with the new symbol we're - // creating. For example, a 'var' symbol and a 'class' symbol will conflict within - // the same symbol table. If we have a conflict, report the issue on each - // declaration we have for this symbol, and then create a new symbol for this - // declaration. - // - // If we created a new symbol, either because we didn't have a symbol with this name - // in the symbol table, or we conflicted with an existing symbol, then just add this - // node as the sole declaration of the new symbol. - // - // Otherwise, we'll be merging into a compatible existing symbol (for example when - // you have multiple 'vars' with the same name in the same container). In this case - // just add this node into the declarations list of the symbol. - symbol = ts.hasProperty(symbolTable, name) - ? symbolTable[name] - : (symbolTable[name] = createSymbol(0 /* None */, name)); - if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; - } - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - // Report errors every position with duplicate declaration - // Report errors on previous encountered declarations - var message = symbol.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.flags & 512 /* Default */) { - message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; - } - }); - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0 /* None */, name); - } - } - else { - symbol = createSymbol(0 /* None */, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - return symbol; - } - function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; - if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - else { - // 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. - if (hasExportModifier || container.flags & 131072 /* ExportContext */) { - var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | - (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | - (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - node.localSymbol = local; - return local; - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - } - // All container nodes are kept on a linked list in declaration order. This list is used by - // the getLocalNameOfContainer function in the type checker to validate that the local name - // used for a container is unique. - function bindChildren(node) { - // Before we recurse into a node's chilren, we first save the existing parent, container - // and block-container. Then after we pop out of processing the children, we restore - // these saved values. - var saveParent = parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - // This node will now be set as the parent of all of its children as we recurse into them. - parent = node; - // Depending on what kind of node this is, we may have to adjust the current container - // and block-container. If the current node is a container, then it is automatically - // considered the current block-container as well. Also, for containers that we know - // may contain locals, we proactively initialize the .locals field. We do this because - // it's highly likely that the .locals will be needed to place some child in (for example, - // a parameter, or variable declaration). - // - // However, we do not proactively create the .locals for block-containers because it's - // totally normal and common for block-containers to never actually have a block-scoped - // variable in them. We don't want to end up allocating an object for every 'block' we - // run into when most of them won't be necessary. - // - // Finally, if this is a block-container, then we clear out any existing .locals object - // it may contain within it. This happens in incremental scenarios. Because we can be - // reusing a node from a previous compilation, that node may have had 'locals' created - // for it. We must clear this so we don't accidently move any stale data forward from - // a previous compilation. - var containerFlags = getContainerFlags(node); - if (containerFlags & 1 /* IsContainer */) { - container = blockScopeContainer = node; - if (containerFlags & 4 /* HasLocals */) { - container.locals = {}; - } - addToContainerChain(container); - } - else if (containerFlags & 2 /* IsBlockScopedContainer */) { - blockScopeContainer = node; - blockScopeContainer.locals = undefined; - } - var savedReachabilityState; - var savedLabelStack; - var savedLabels; - var savedImplicitLabels; - var savedHasExplicitReturn; - var kind = node.kind; - var flags = node.flags; - // reset all reachability check related flags on node (for incremental scenarios) - flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 215 /* InterfaceDeclaration */) { - seenThisKeyword = false; - } - var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); - if (saveState) { - savedReachabilityState = currentReachabilityState; - savedLabelStack = labelStack; - savedLabels = labelIndexMap; - savedImplicitLabels = implicitLabels; - savedHasExplicitReturn = hasExplicitReturn; - currentReachabilityState = 2 /* Reachable */; - hasExplicitReturn = false; - labelStack = labelIndexMap = implicitLabels = undefined; - } - bindReachableStatement(node); - if (currentReachabilityState === 2 /* Reachable */ && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { - flags |= 524288 /* HasImplicitReturn */; - if (hasExplicitReturn) { - flags |= 1048576 /* HasExplicitReturn */; - } - } - if (kind === 215 /* InterfaceDeclaration */) { - flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; - } - node.flags = flags; - if (saveState) { - hasExplicitReturn = savedHasExplicitReturn; - currentReachabilityState = savedReachabilityState; - labelStack = savedLabelStack; - labelIndexMap = savedLabels; - implicitLabels = savedImplicitLabels; - } - container = saveContainer; - parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - /** - * Returns true if node and its subnodes were successfully traversed. - * Returning false means that node was not examined and caller needs to dive into the node himself. - */ - function bindReachableStatement(node) { - if (checkUnreachable(node)) { - ts.forEachChild(node, bind); - return; - } - switch (node.kind) { - case 198 /* WhileStatement */: - bindWhileStatement(node); - break; - case 197 /* DoStatement */: - bindDoStatement(node); - break; - case 199 /* ForStatement */: - bindForStatement(node); - break; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - bindForInOrForOfStatement(node); - break; - case 196 /* IfStatement */: - bindIfStatement(node); - break; - case 204 /* ReturnStatement */: - case 208 /* ThrowStatement */: - bindReturnOrThrow(node); - break; - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - bindBreakOrContinueStatement(node); - break; - case 209 /* TryStatement */: - bindTryStatement(node); - break; - case 206 /* SwitchStatement */: - bindSwitchStatement(node); - break; - case 220 /* CaseBlock */: - bindCaseBlock(node); - break; - case 207 /* LabeledStatement */: - bindLabeledStatement(node); - break; - default: - ts.forEachChild(node, bind); - break; - } - } - function bindWhileStatement(n) { - var preWhileState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - var postWhileState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - // bind expressions (don't affect reachability) - bind(n.expression); - currentReachabilityState = preWhileState; - var postWhileLabel = pushImplicitLabel(); - bind(n.statement); - popImplicitLabel(postWhileLabel, postWhileState); - } - function bindDoStatement(n) { - var preDoState = currentReachabilityState; - var postDoLabel = pushImplicitLabel(); - bind(n.statement); - var postDoState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : preDoState; - popImplicitLabel(postDoLabel, postDoState); - // bind expressions (don't affect reachability) - bind(n.expression); - } - function bindForStatement(n) { - var preForState = currentReachabilityState; - var postForLabel = pushImplicitLabel(); - // bind expressions (don't affect reachability) - bind(n.initializer); - bind(n.condition); - bind(n.incrementor); - bind(n.statement); - // for statement is considered infinite when it condition is either omitted or is true keyword - // - for(..;;..) - // - for(..;true;..) - var isInfiniteLoop = (!n.condition || n.condition.kind === 99 /* TrueKeyword */); - var postForState = isInfiniteLoop ? 4 /* Unreachable */ : preForState; - popImplicitLabel(postForLabel, postForState); - } - function bindForInOrForOfStatement(n) { - var preStatementState = currentReachabilityState; - var postStatementLabel = pushImplicitLabel(); - // bind expressions (don't affect reachability) - bind(n.initializer); - bind(n.expression); - bind(n.statement); - popImplicitLabel(postStatementLabel, preStatementState); - } - function bindIfStatement(n) { - // denotes reachability state when entering 'thenStatement' part of the if statement: - // i.e. if condition is false then thenStatement is unreachable - var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - // denotes reachability state when entering 'elseStatement': - // i.e. if condition is true then elseStatement is unreachable - var ifFalseState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - currentReachabilityState = ifTrueState; - // bind expression (don't affect reachability) - bind(n.expression); - bind(n.thenStatement); - if (n.elseStatement) { - var preElseState = currentReachabilityState; - currentReachabilityState = ifFalseState; - bind(n.elseStatement); - currentReachabilityState = or(currentReachabilityState, preElseState); - } - else { - currentReachabilityState = or(currentReachabilityState, ifFalseState); - } - } - function bindReturnOrThrow(n) { - // bind expression (don't affect reachability) - bind(n.expression); - if (n.kind === 204 /* ReturnStatement */) { - hasExplicitReturn = true; - } - currentReachabilityState = 4 /* Unreachable */; - } - function bindBreakOrContinueStatement(n) { - // call bind on label (don't affect reachability) - bind(n.label); - // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); - if (isValidJump) { - currentReachabilityState = 4 /* Unreachable */; - } - } - function bindTryStatement(n) { - // catch\finally blocks has the same reachability as try block - var preTryState = currentReachabilityState; - bind(n.tryBlock); - var postTryState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.catchClause); - var postCatchState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.finallyBlock); - // post catch/finally state is reachable if - // - post try state is reachable - control flow can fall out of try block - // - post catch state is reachable - control flow can fall out of catch block - currentReachabilityState = or(postTryState, postCatchState); - } - function bindSwitchStatement(n) { - var preSwitchState = currentReachabilityState; - var postSwitchLabel = pushImplicitLabel(); - // bind expression (don't affect reachability) - bind(n.expression); - bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); - // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case - var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; - popImplicitLabel(postSwitchLabel, postSwitchState); - } - function bindCaseBlock(n) { - var startState = currentReachabilityState; - for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { - var clause = _a[_i]; - currentReachabilityState = startState; - bind(clause); - if (clause.statements.length && currentReachabilityState === 2 /* Reachable */ && options.noFallthroughCasesInSwitch) { - errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); - } - } - } - function bindLabeledStatement(n) { - // call bind on label (don't affect reachability) - bind(n.label); - var ok = pushNamedLabel(n.label); - bind(n.statement); - if (ok) { - popNamedLabel(n.label, currentReachabilityState); - } - } - function getContainerFlags(node) { - switch (node.kind) { - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - return 1 /* IsContainer */; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 218 /* ModuleDeclaration */: - case 248 /* SourceFile */: - case 216 /* TypeAliasDeclaration */: - return 5 /* IsContainerWithLocals */; - case 244 /* CatchClause */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 220 /* CaseBlock */: - return 2 /* IsBlockScopedContainer */; - case 192 /* Block */: - // do not treat blocks directly inside a function as a block-scoped-container. - // Locals that reside in this block should go to the function locals. Othewise 'x' - // would not appear to be a redeclaration of a block scoped local in the following - // example: - // - // function foo() { - // var x; - // let x; - // } - // - // If we placed 'var x' into the function locals and 'let x' into the locals of - // the block, then there would be no collision. - // - // By not creating a new block-scoped-container here, we ensure that both 'var x' - // and 'let x' go into the Function-container's locals, and we do get a collision - // conflict. - return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; - } - return 0 /* None */; - } - function addToContainerChain(next) { - if (lastContainer) { - lastContainer.nextContainer = next; - } - lastContainer = next; - } - function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { - // Just call this directly so that the return type of this function stays "void". - declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); - } - function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { - switch (container.kind) { - // Modules, source files, and classes need specialized handling for how their - // members are declared (for example, a member of a class will go into a specific - // symbol table depending on if it is static or not). We defer to specialized - // handlers to take care of declaring these child members. - case 218 /* ModuleDeclaration */: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248 /* SourceFile */: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 217 /* EnumDeclaration */: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - case 215 /* InterfaceDeclaration */: - // Interface/Object-types always have their children added to the 'members' of - // their container. They are only accessible through an instance of their - // container, and are never in scope otherwise (even inside the body of the - // object / type / interface declaring them). An exception is type parameters, - // which are in scope without qualification (similar to 'locals'). - return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 216 /* TypeAliasDeclaration */: - // All the children of these container types are never visible through another - // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, - // they're only accessed 'lexically' (i.e. from code that exists underneath - // their container in the tree. To accomplish this, we simply add their declared - // symbol to the 'locals' of the container. These symbols can then be found as - // the type checker walks up the containers, checking them for matching names. - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function declareClassMember(node, symbolFlags, symbolExcludes) { - return node.flags & 64 /* Static */ - ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) - : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - } - function declareSourceFileMember(node, symbolFlags, symbolExcludes) { - return ts.isExternalModule(file) - ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); - } - function hasExportDeclarations(node) { - var body = node.kind === 248 /* SourceFile */ ? node : node.body; - if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { - for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { - var stat = _a[_i]; - if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { - return true; - } - } - } - return false; - } - function setExportContextFlag(node) { - // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular - // declarations with export modifiers) is an export context in which declarations are implicitly exported. - if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 131072 /* ExportContext */; - } - else { - node.flags &= ~131072 /* ExportContext */; - } - } - function bindModuleDeclaration(node) { - setExportContextFlag(node); - if (node.name.kind === 9 /* StringLiteral */) { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - } - else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { - // if module was already merged with some function, class or non-const enum - // treat is a non-const-enum-only - node.symbol.constEnumOnlyModule = false; - } - else { - var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; - if (node.symbol.constEnumOnlyModule === undefined) { - // non-merged case - use the current state - node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; - } - else { - // merged case: module is const enum only if all its pieces are non-instantiated or const enum - node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; - } - } - } - } - } - function bindFunctionOrConstructorType(node) { - // For a given function symbol "<...>(...) => T" we want to generate a symbol identical - // to the one we would get for: { <...>(...): T } - // - // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable - // from an actual type literal symbol you would have gotten had you used the long form. - var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072 /* Signature */); - var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); - typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); - var _a; - } - function bindObjectLiteralExpression(node) { - var ElementKind; - (function (ElementKind) { - ElementKind[ElementKind["Property"] = 1] = "Property"; - ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; - })(ElementKind || (ElementKind = {})); - if (inStrictMode) { - var seen = {}; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; - if (prop.name.kind !== 69 /* Identifier */) { - continue; - } - var identifier = prop.name; - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ - ? 1 /* Property */ - : 2 /* Accessor */; - var existingKind = seen[identifier.text]; - if (!existingKind) { - seen[identifier.text] = currentKind; - continue; - } - if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { - var span = ts.getErrorSpanForNode(file, identifier); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); - } - } - } - return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); - } - function bindAnonymousDeclaration(node, symbolFlags, name) { - var symbol = createSymbol(symbolFlags, name); - addDeclarationToSymbol(symbol, node, symbolFlags); - } - function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { - switch (blockScopeContainer.kind) { - case 218 /* ModuleDeclaration */: - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - case 248 /* SourceFile */: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - } - // fall through. - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - addToContainerChain(blockScopeContainer); - } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); - } - // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized - // check for reserved words used as identifiers in strict mode code. - function checkStrictModeIdentifier(node) { - if (inStrictMode && - node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ && - node.originalKeywordKind <= 114 /* LastFutureReservedWord */ && - !ts.isIdentifierName(node)) { - // Report error only if there are no parse errors in file - if (!file.parseDiagnostics.length) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); - } - } - } - function getStrictModeIdentifierMessage(node) { - // Provide specialized messages to help the user understand why we think they're in - // strict mode. - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; - } - function checkStrictModeBinaryExpression(node) { - if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - checkStrictModeEvalOrArguments(node, node.left); - } - } - function checkStrictModeCatchClause(node) { - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - if (inStrictMode && node.variableDeclaration) { - checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); - } - } - function checkStrictModeDeleteExpression(node) { - // Grammar checking - if (inStrictMode && node.expression.kind === 69 /* Identifier */) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - var span = ts.getErrorSpanForNode(file, node.expression); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); - } - } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 /* Identifier */ && - (node.text === "eval" || node.text === "arguments"); - } - function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 69 /* Identifier */) { - var identifier = name; - if (isEvalOrArgumentsIdentifier(identifier)) { - // We check first if the name is inside class declaration or class expression; if so give explicit message - // otherwise report generic error message. - var span = ts.getErrorSpanForNode(file, name); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); - } - } - } - function getStrictModeEvalOrArgumentsMessage(node) { - // Provide specialized messages to help the user understand why we think they're in - // strict mode. - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; - } - function checkStrictModeFunctionName(node) { - if (inStrictMode) { - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) - checkStrictModeEvalOrArguments(node, node.name); - } - } - function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.flags & 32768 /* OctalLiteral */) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); - } - } - function checkStrictModePostfixUnaryExpression(node) { - // Grammar checking - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - function checkStrictModePrefixUnaryExpression(node) { - // Grammar checking - if (inStrictMode) { - if (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - } - function checkStrictModeWithStatement(node) { - // Grammar checking for withStatement - if (inStrictMode) { - errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - function errorOnFirstToken(node, message, arg0, arg1, arg2) { - var span = ts.getSpanOfTokenAtPosition(file, node.pos); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - if (!node) { - return; - } - node.parent = parent; - var savedInStrictMode = inStrictMode; - if (!savedInStrictMode) { - updateStrictMode(node); - } - // First we bind declaration nodes to a symbol if possible. We'll both create a symbol - // and then potentially add the symbol to an appropriate symbol table. Possible - // destination symbol tables are: - // - // 1) The 'exports' table of the current container's symbol. - // 2) The 'members' table of the current container's symbol. - // 3) The 'locals' table of the current container. - // - // However, not all symbols will end up in any of these tables. 'Anonymous' symbols - // (like TypeLiterals for example) will not be put in any table. - bindWorker(node); - // Then we recurse into the children of the node to bind them as well. For certain - // symbols we do specialized work when we recurse. For example, we'll keep track of - // the current 'container' node when it changes. This helps us know which symbol table - // a local should go into for example. - bindChildren(node); - inStrictMode = savedInStrictMode; - } - function updateStrictMode(node) { - switch (node.kind) { - case 248 /* SourceFile */: - case 219 /* ModuleBlock */: - updateStrictModeStatementList(node.statements); - return; - case 192 /* Block */: - if (ts.isFunctionLike(node.parent)) { - updateStrictModeStatementList(node.statements); - } - return; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - // All classes are automatically in strict mode in ES6. - inStrictMode = true; - return; - } - } - function updateStrictModeStatementList(statements) { - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (!ts.isPrologueDirective(statement)) { - return; - } - if (isUseStrictPrologueDirective(statement)) { - inStrictMode = true; - return; - } - } - } - /// Should be called only on prologue directives (isPrologueDirective(node) should be true) - function isUseStrictPrologueDirective(node) { - var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); - // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the - // string to contain unicode escapes (as per ES5). - return nodeText === "\"use strict\"" || nodeText === "'use strict'"; - } - function bindWorker(node) { - switch (node.kind) { - case 69 /* Identifier */: - return checkStrictModeIdentifier(node); - case 181 /* BinaryExpression */: - return checkStrictModeBinaryExpression(node); - case 244 /* CatchClause */: - return checkStrictModeCatchClause(node); - case 175 /* DeleteExpression */: - return checkStrictModeDeleteExpression(node); - case 8 /* NumericLiteral */: - return checkStrictModeNumericLiteral(node); - case 180 /* PostfixUnaryExpression */: - return checkStrictModePostfixUnaryExpression(node); - case 179 /* PrefixUnaryExpression */: - return checkStrictModePrefixUnaryExpression(node); - case 205 /* WithStatement */: - return checkStrictModeWithStatement(node); - case 97 /* ThisKeyword */: - seenThisKeyword = true; - return; - case 137 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); - case 138 /* Parameter */: - return bindParameter(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: - return bindVariableDeclarationOrBindingElement(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 247 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - // If this is an ObjectLiteralExpression method, then it sits in the same space - // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes - // so that it will conflict with any other object literal members with the same - // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 213 /* FunctionDeclaration */: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); - case 144 /* Constructor */: - return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 145 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 146 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - return bindFunctionOrConstructorType(node); - case 155 /* TypeLiteral */: - return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 165 /* ObjectLiteralExpression */: - return bindObjectLiteralExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - return bindClassLikeDeclaration(node); - case 215 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 216 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 217 /* EnumDeclaration */: - return bindEnumDeclaration(node); - case 218 /* ModuleDeclaration */: - return bindModuleDeclaration(node); - case 221 /* ImportEqualsDeclaration */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: - return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 223 /* ImportClause */: - return bindImportClause(node); - case 228 /* ExportDeclaration */: - return bindExportDeclaration(node); - case 227 /* ExportAssignment */: - return bindExportAssignment(node); - case 248 /* SourceFile */: - return bindSourceFileIfExternalModule(); - } - } - function bindSourceFileIfExternalModule() { - setExportContextFlag(file); - if (ts.isExternalModule(file)) { - bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); - } - } - function bindExportAssignment(node) { - if (!container.symbol || !container.symbol.exports) { - // Export assignment in some sort of block construct - bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); - } - else if (node.expression.kind === 69 /* Identifier */) { - // An export default clause with an identifier exports all meanings of that identifier - declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - else { - // An export default clause with an expression exports a value - declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - } - function bindExportDeclaration(node) { - if (!container.symbol || !container.symbol.exports) { - // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); - } - else if (!node.exportClause) { - // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); - } - } - function bindImportClause(node) { - if (node.name) { - declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - } - } - function bindClassLikeDeclaration(node) { - if (node.kind === 214 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); - } - else { - var bindingName = node.name ? node.name.text : "__class"; - bindAnonymousDeclaration(node, 32 /* Class */, bindingName); - // Add name of class expression into the map for semantic classifier - if (node.name) { - classifiableNames[node.name.text] = node.name.text; - } - } - var symbol = node.symbol; - // 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'. - // - // Note: we check for this here because this class may be merging into a module. The - // module might have an exported variable called 'prototype'. We can't allow that as - // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - function bindEnumDeclaration(node) { - return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) - : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); - } - function bindVariableDeclarationOrBindingElement(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (!ts.isBindingPattern(node.name)) { - if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else if (ts.isParameterDeclaration(node)) { - // It is safe to walk up parent chain to find whether the node is a destructing parameter declaration - // because its parent chain has already been set up, since parents are set before descending into children. - // - // If node is a binding element in parameter declaration, we need to use ParameterExcludes. - // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration - // For example: - // function foo([a,a]) {} // Duplicate Identifier error - // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter - // // which correctly set excluded symbols - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); - } - } - } - function bindParameter(node) { - if (inStrictMode) { - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) - checkStrictModeEvalOrArguments(node, node.name); - } - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node)); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - // If this is a property-parameter, then also declare the property symbol into the - // containing class. - if (node.flags & 56 /* AccessibilityModifier */ && - node.parent.kind === 144 /* Constructor */ && - ts.isClassLike(node.parent.parent)) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - return ts.hasDynamicName(node) - ? bindAnonymousDeclaration(node, symbolFlags, "__computed") - : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - // reachability checks - function pushNamedLabel(name) { - initializeReachabilityStateIfNecessary(); - if (ts.hasProperty(labelIndexMap, name.text)) { - return false; - } - labelIndexMap[name.text] = labelStack.push(1 /* Unintialized */) - 1; - return true; - } - function pushImplicitLabel() { - initializeReachabilityStateIfNecessary(); - var index = labelStack.push(1 /* Unintialized */) - 1; - implicitLabels.push(index); - return index; - } - function popNamedLabel(label, outerState) { - var index = labelIndexMap[label.text]; - ts.Debug.assert(index !== undefined); - ts.Debug.assert(labelStack.length == index + 1); - labelIndexMap[label.text] = undefined; - setCurrentStateAtLabel(labelStack.pop(), outerState, label); - } - function popImplicitLabel(implicitLabelIndex, outerState) { - if (labelStack.length !== implicitLabelIndex + 1) { - ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); - } - var i = implicitLabels.pop(); - if (implicitLabelIndex !== i) { - ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); - } - setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); - } - function setCurrentStateAtLabel(innerMergedState, outerState, label) { - if (innerMergedState === 1 /* Unintialized */) { - if (label && !options.allowUnusedLabels) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); - } - currentReachabilityState = outerState; - } - else { - currentReachabilityState = or(innerMergedState, outerState); - } - } - function jumpToLabel(label, outerState) { - initializeReachabilityStateIfNecessary(); - var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); - if (index === undefined) { - // reference to unknown label or - // break/continue used outside of loops - return false; - } - var stateAtLabel = labelStack[index]; - labelStack[index] = stateAtLabel === 1 /* Unintialized */ ? outerState : or(stateAtLabel, outerState); - return true; - } - function checkUnreachable(node) { - switch (currentReachabilityState) { - case 4 /* Unreachable */: - var reportError = - // report error on all statements - ts.isStatement(node) || - // report error on class declarations - node.kind === 214 /* ClassDeclaration */ || - // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || - // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); - if (reportError) { - currentReachabilityState = 8 /* ReportedUnreachable */; - // unreachable code is reported if - // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error - // so we should not report extras) AND - // - node is not variable statement OR - // - node is block scoped variable statement OR - // - node is not block scoped variable statement and at least one variable declaration has initializer - // Rationale: we don't want to report errors on non-initialized var's since they are hoisted - // On the other side we do want to report errors on non-initialized 'lets' because of TDZ - var reportUnreachableCode = !options.allowUnreachableCode && - !ts.isInAmbientContext(node) && - (node.kind !== 193 /* VariableStatement */ || - ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || - ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); - if (reportUnreachableCode) { - errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); - } - } - case 8 /* ReportedUnreachable */: - return true; - default: - return false; - } - function shouldReportErrorOnModuleDeclaration(node) { - var instanceState = getModuleInstanceState(node); - return instanceState === 1 /* Instantiated */ || (instanceState === 2 /* ConstEnumOnly */ && options.preserveConstEnums); - } - } - function initializeReachabilityStateIfNecessary() { - if (labelIndexMap) { - return; - } - currentReachabilityState = 2 /* Reachable */; - labelIndexMap = {}; - labelStack = []; - implicitLabels = []; - } - } -})(ts || (ts = {})); -/// /// /* @internal */ var ts; @@ -5812,6 +4503,10 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isDeclarationFile(file) { return (file.flags & 4096 /* DeclarationFile */) !== 0; } @@ -5865,19 +4560,27 @@ var ts; return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getLeadingCommentRangesOfNodeFromText(node, text) { + return ts.getLeadingCommentRanges(text, node.pos); + } + ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJsDocComments(node, sourceFileOfNode) { + return getJsDocCommentsFromText(node, sourceFileOfNode.text); + } + ts.getJsDocComments = getJsDocComments; + function getJsDocCommentsFromText(node, text) { var commentRanges = (node.kind === 138 /* Parameter */ || node.kind === 137 /* TypeParameter */) ? - ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : - getLeadingCommentRangesOfNode(node, sourceFileOfNode); + ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); function isJsDocComment(comment) { // True if the comment starts with '/**' but not if it is '/**/' - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } } - ts.getJsDocComments = getJsDocComments; + ts.getJsDocCommentsFromText = getJsDocCommentsFromText; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { @@ -6464,6 +5167,57 @@ var ts; return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 232 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJavaScript(file) { + return isInJavaScriptFile(file); + } + ts.isSourceFileJavaScript = isSourceFileJavaScript; + function isInJavaScriptFile(node) { + return node && !!(node.parserContextFlags & 32 /* JavaScriptFile */); + } + ts.isInJavaScriptFile = isInJavaScriptFile; + /** + * Returns true if the node is a CallExpression to the identifier 'require' with + * exactly one string literal argument. + * This function does not test if the node is in a JavaScript file or not. + */ + function isRequireCall(expression) { + // of the form 'require("name")' + return expression.kind === 168 /* CallExpression */ && + expression.expression.kind === 69 /* Identifier */ && + expression.expression.text === "require" && + expression.arguments.length === 1 && + expression.arguments[0].kind === 9 /* StringLiteral */; + } + ts.isRequireCall = isRequireCall; + /** + * Returns true if the node is an assignment to a property on the identifier 'exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + function isExportsPropertyAssignment(expression) { + // of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === 181 /* BinaryExpression */) && + (expression.operatorToken.kind === 56 /* EqualsToken */) && + (expression.left.kind === 166 /* PropertyAccessExpression */) && + (expression.left.expression.kind === 69 /* Identifier */) && + ((expression.left.expression).text === "exports"); + } + ts.isExportsPropertyAssignment = isExportsPropertyAssignment; + /** + * Returns true if the node is an assignment to the property access expression 'module.exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + function isModuleExportsAssignment(expression) { + // of the form 'module.exports = expr' where 'expr' is arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === 181 /* BinaryExpression */) && + (expression.operatorToken.kind === 56 /* EqualsToken */) && + (expression.left.kind === 166 /* PropertyAccessExpression */) && + (expression.left.expression.kind === 69 /* Identifier */) && + ((expression.left.expression).text === "module") && + (expression.left.name.text === "exports"); + } + ts.isModuleExportsAssignment = isModuleExportsAssignment; function getExternalModuleName(node) { if (node.kind === 222 /* ImportDeclaration */) { return node.moduleSpecifier; @@ -6791,8 +5545,8 @@ var ts; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -6834,6 +5588,10 @@ var ts; return isFunctionLike(node) && (node.flags & 256 /* Async */) !== 0 && !isAccessor(node); } ts.isAsyncFunctionLike = isAsyncFunctionLike; + function isStringOrNumericLiteral(kind) { + return kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */; + } + ts.isStringOrNumericLiteral = isStringOrNumericLiteral; /** * A declaration has a dynamic name if both of the following are true: * 1. The declaration has a computed property name @@ -6842,11 +5600,15 @@ var ts; * Symbol. */ function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 136 /* ComputedPropertyName */ && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && isDynamicName(declaration.name); } ts.hasDynamicName = hasDynamicName; + function isDynamicName(name) { + return name.kind === 136 /* ComputedPropertyName */ && + !isStringOrNumericLiteral(name.expression.kind) && + !isWellKnownSymbolSyntactically(name.expression); + } + ts.isDynamicName = isDynamicName; /** * Checks if the expression is of the form: * Symbol.name @@ -7087,11 +5849,11 @@ var ts; } ts.getIndentSize = getIndentSize; function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; + var output; + var indent; + var lineStart; + var lineCount; + var linePos; function write(s) { if (s && s.length) { if (lineStart) { @@ -7101,6 +5863,13 @@ var ts; output += s; } } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } function rawWrite(s) { if (s !== undefined) { if (lineStart) { @@ -7127,9 +5896,10 @@ var ts; lineStart = true; } } - function writeTextOfNode(sourceFile, node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + function writeTextOfNode(text, node) { + write(getTextOfNodeFromSourceText(text, node)); } + reset(); return { write: write, rawWrite: rawWrite, @@ -7142,10 +5912,20 @@ var ts; getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + getText: function () { return output; }, + reset: reset }; } ts.createTextWriter = createTextWriter; + /** + * Resolves a local path to a path which is absolute to the base of the emit + */ + function getExternalModuleNameFromPath(host, fileName) { + var dir = host.getCurrentDirectory(); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, /*isAbsolutePathAnUrl*/ false); + return ts.removeFileExtension(relativePath); + } + ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); var emitOutputFilePathWithoutExtension; @@ -7174,6 +5954,10 @@ var ts; return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; + } + ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { if (member.kind === 144 /* Constructor */ && nodeIsPresent(member.body)) { @@ -7246,22 +6030,22 @@ var ts; }; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { // If the leading comments start on different line than the start of node, write new line if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + getLineOfLocalPositionFromLineMap(lineMap, node.pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { writer.writeLine(); } } ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + function emitComments(text, lineMap, writer, comments, trailingSeparator, newLine, writeComment) { var emitLeadingSpace = !trailingSeparator; ts.forEach(comments, function (comment) { if (emitLeadingSpace) { writer.write(" "); emitLeadingSpace = false; } - writeComment(currentSourceFile, writer, comment, newLine); + writeComment(text, lineMap, writer, comment, newLine); if (comment.hasTrailingNewLine) { writer.writeLine(); } @@ -7279,7 +6063,7 @@ var ts; * Detached comment is a comment at the top of file or function body that is separated from * the next statement by space. */ - function emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, removeComments) { + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { @@ -7289,12 +6073,12 @@ var ts; // // var x = 10; if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); } } else { // removeComments is false, just get detached as normal and bypass the process to filter comment - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + leadingComments = ts.getLeadingCommentRanges(text, node.pos); } if (leadingComments) { var detachedComments = []; @@ -7302,8 +6086,8 @@ var ts; for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { var comment = leadingComments_1[_i]; if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This // comment is not part of the copyright comments. Return what we have so @@ -7318,36 +6102,36 @@ var ts; // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); if (nodeLine >= lastCommentLine + 2) { // Valid detachedComments - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments(text, lineMap, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; } } } return currentDetachedCommentInfo; function isPinnedComment(comment) { - return currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; } } ts.emitDetachedComments = emitDetachedComments; - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; + function writeCommentRange(text, lineMap, writer, comment, newLine) { + if (text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { + var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, comment.pos); + var lineCount = lineMap.length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : getStartPositionOfLine(currentLine + 1, currentSourceFile); + ? text.length + 1 + : lineMap[currentLine + 1]; if (pos !== comment.pos) { // If we are not emitting first line, we need to write the spaces to adjust the alignment if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], comment.pos); } // These are number of spaces writer is going to write at current indent var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); @@ -7365,7 +6149,7 @@ var ts; // More right indented comment */ --4 = 8 - 4 + 11 // class c { } // } - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); @@ -7383,45 +6167,45 @@ var ts; } } // Write the comment line text - writeTrimmedCurrentLine(pos, nextLineStart); + writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart); pos = nextLineStart; } } else { // Single line comment of style //.... - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ""); - if (currentLineText) { - // trimmed forward and ending spaces text - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - return currentLineIndent; + writer.write(text.substring(comment.pos, comment.end)); } } ts.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); + if (currentLineText) { + // trimmed forward and ending spaces text + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + // Empty string - make sure we write empty line + writer.writeLiteral(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9 /* tab */) { + // Tabs = TabSize = indent size and go to next tabStop + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + // Single space + currentLineIndent++; + } + } + return currentLineIndent; + } function modifierToFlag(token) { switch (token) { case 113 /* StaticKeyword */: return 64 /* Static */; @@ -7517,14 +6301,14 @@ var ts; return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 512 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function isJavaScript(fileName) { - return ts.fileExtensionIs(fileName, ".js"); + function hasJavaScriptFileExtension(fileName) { + return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isJavaScript = isJavaScript; - function isTsx(fileName) { - return ts.fileExtensionIs(fileName, ".tsx"); + ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; + function allowsJsxExpressions(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isTsx = isTsx; + ts.allowsJsxExpressions = allowsJsxExpressions; /** * Replace each instance of non-ascii characters by one, two, three, or four escape sequences * representing the UTF-8 encoding of the character, and return the expanded char code list. @@ -7835,18 +6619,20 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; })(ts || (ts = {})); -/// /// +/// var ts; (function (ts) { - var nodeConstructors = new Array(272 /* Count */); /* @internal */ ts.parseTime = 0; - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; + var NodeConstructor; + var SourceFileConstructor; function createNode(kind, pos, end) { - return new (getNodeConstructor(kind))(pos, end); + if (kind === 248 /* SourceFile */) { + return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); + } + else { + return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, pos, end); + } } ts.createNode = createNode; function visitNode(cbNode, node) { @@ -8269,6 +7055,9 @@ var ts; // up by avoiding the cost of creating/compiling scanners over and over again. var scanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ true); var disallowInAndDecoratorContext = 1 /* DisallowIn */ | 4 /* Decorator */; + // capture constructors in 'initializeState' to avoid null checks + var NodeConstructor; + var SourceFileConstructor; var sourceFile; var parseDiagnostics; var syntaxCursor; @@ -8354,13 +7143,16 @@ var ts; // attached to the EOF token. var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(fileName) || _sourceText.lastIndexOf("// @language=javascript", 0) === 0; + initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); clearState(); return result; } Parser.parseSourceFile = parseSourceFile; - function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor) { + function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { + NodeConstructor = ts.objectAllocator.getNodeConstructor(); + SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); sourceText = _sourceText; syntaxCursor = _syntaxCursor; parseDiagnostics = []; @@ -8368,13 +7160,13 @@ var ts; identifiers = {}; identifierCount = 0; nodeCount = 0; - contextFlags = ts.isJavaScript(fileName) ? 32 /* JavaScriptFile */ : 0 /* None */; + contextFlags = isJavaScriptFile ? 32 /* JavaScriptFile */ : 0 /* None */; parseErrorBeforeNextFinishedNode = false; // Initialize and prime the scanner before parsing the source elements. scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.isTsx(fileName) ? 1 /* JSX */ : 0 /* Standard */); + scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 /* JSX */ : 0 /* Standard */); } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. @@ -8389,6 +7181,9 @@ var ts; } function parseSourceFileWorker(fileName, languageVersion, setParentNodes) { sourceFile = createSourceFile(fileName, languageVersion); + if (contextFlags & 32 /* JavaScriptFile */) { + sourceFile.parserContextFlags = 32 /* JavaScriptFile */; + } // Prime the scanner. token = nextToken(); processReferenceComments(sourceFile); @@ -8406,7 +7201,7 @@ var ts; // If this is a javascript file, proactively see if we can get JSDoc comments for // relevant nodes in the file. We'll use these to provide typing informaion if they're // available. - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { addJSDocComments(); } return sourceFile; @@ -8461,15 +7256,16 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = createNode(248 /* SourceFile */, /*pos*/ 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; + // code from createNode is inlined here so createNode won't have to deal with special case of creating source files + // this is quite rare comparing to other nodes and createNode should be as fast as possible + var sourceFile = new SourceFileConstructor(248 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 /* DeclarationFile */ : 0; - sourceFile.languageVariant = ts.isTsx(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; + sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; return sourceFile; } function setContextFlag(val, flag) { @@ -8734,12 +7530,13 @@ var ts; return parseExpected(23 /* SemicolonToken */); } } + // note: this function creates only node function createNode(kind, pos) { nodeCount++; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(pos, pos); + return new NodeConstructor(kind, pos, pos); } function finishNode(node, end) { node.end = end === undefined ? scanner.getStartPos() : end; @@ -8904,7 +7701,7 @@ var ts; case 12 /* ObjectLiteralMembers */: return token === 19 /* OpenBracketToken */ || token === 37 /* AsteriskToken */ || isLiteralPropertyName(); case 9 /* ObjectBindingElements */: - return isLiteralPropertyName(); + return token === 19 /* OpenBracketToken */ || isLiteralPropertyName(); case 7 /* HeritageClauseElement */: // If we see { } then only consume it as an expression if it is followed by , or { // That way we won't consume the body of a class in its heritage clause. @@ -9584,9 +8381,7 @@ var ts; } function parseParameterType() { if (parseOptional(54 /* ColonToken */)) { - return token === 9 /* StringLiteral */ - ? parseLiteralNode(/*internName*/ true) - : parseType(); + return parseType(); } return undefined; } @@ -9917,6 +8712,8 @@ var ts; // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); + case 9 /* StringLiteral */: + return parseLiteralNode(/*internName*/ true); case 103 /* VoidKeyword */: case 97 /* ThisKeyword */: return parseTokenNode(); @@ -9946,6 +8743,7 @@ var ts; case 19 /* OpenBracketToken */: case 25 /* LessThanToken */: case 92 /* NewKeyword */: + case 9 /* StringLiteral */: return true; case 17 /* OpenParenToken */: // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, @@ -10362,7 +9160,7 @@ var ts; return 1 /* True */; } // This *could* be a parenthesized arrow function. - // Return Unknown to let the caller know. + // Return Unknown to const the caller know. return 2 /* Unknown */; } else { @@ -10448,7 +9246,7 @@ var ts; // user meant to supply a block. For example, if the user wrote: // // a => - // let v = 0; + // const v = 0; // } // // they may be missing an open brace. Check to see if that's the case so we can @@ -10664,7 +9462,6 @@ var ts; var unaryOperator = token; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { - var diagnostic; var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); if (simpleUnaryExpression.kind === 171 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); @@ -11868,7 +10665,6 @@ var ts; } function parseObjectBindingElement() { var node = createNode(163 /* BindingElement */); - // TODO(andersh): Handle computed properties var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -12691,7 +11487,7 @@ var ts; } JSDocParser.isJSDocType = isJSDocType; function parseJSDocTypeExpressionForTests(content, start, length) { - initializeState("file.js", content, 2 /* Latest */, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, 2 /* Latest */, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); var jsDocTypeExpression = parseJSDocTypeExpression(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -12786,6 +11582,7 @@ var ts; case 103 /* VoidKeyword */: return parseTokenNode(); } + // TODO (drosen): Parse string literal types in JSDoc as well. return parseJSDocTypeReference(); } function parseJSDocThisType() { @@ -12957,7 +11754,7 @@ var ts; } } function parseIsolatedJSDocComment(content, start, length) { - initializeState("file.js", content, 2 /* Latest */, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, 2 /* Latest */, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); var jsDocComment = parseJSDocComment(/*parent:*/ undefined, start, length); var diagnostics = parseDiagnostics; clearState(); @@ -13682,6 +12479,1372 @@ var ts; })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); +/// +/// +/* @internal */ +var ts; +(function (ts) { + ts.bindTime = 0; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); + var ModuleInstanceState = ts.ModuleInstanceState; + var Reachability; + (function (Reachability) { + Reachability[Reachability["Unintialized"] = 1] = "Unintialized"; + Reachability[Reachability["Reachable"] = 2] = "Reachable"; + Reachability[Reachability["Unreachable"] = 4] = "Unreachable"; + Reachability[Reachability["ReportedUnreachable"] = 8] = "ReportedUnreachable"; + })(Reachability || (Reachability = {})); + function or(state1, state2) { + return (state1 | state2) & 2 /* Reachable */ + ? 2 /* Reachable */ + : (state1 & state2) & 8 /* ReportedUnreachable */ + ? 8 /* ReportedUnreachable */ + : 4 /* Unreachable */; + } + function getModuleInstanceState(node) { + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { + return 0 /* NonInstantiated */; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; + } + else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + return 0 /* NonInstantiated */; + } + else if (node.kind === 219 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + // child is non-instantiated - continue searching + return false; + case 2 /* ConstEnumOnly */: + // child is const enum only - record state and continue searching + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + // child is instantiated - record state and stop + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 218 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); + } + else { + return 1 /* Instantiated */; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + var ContainerFlags; + (function (ContainerFlags) { + // The current node is not a container, and no container manipulation should happen before + // recursing into it. + ContainerFlags[ContainerFlags["None"] = 0] = "None"; + // The current node is a container. It should be set as the current container (and block- + // container) before recursing into it. The current node does not have locals. Examples: + // + // Classes, ObjectLiterals, TypeLiterals, Interfaces... + ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; + // The current node is a block-scoped-container. It should be set as the current block- + // container before recursing into it. Examples: + // + // Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements... + ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags[ContainerFlags["HasLocals"] = 4] = "HasLocals"; + // If the current node is a container that also container that also contains locals. Examples: + // + // Functions, Methods, Modules, Source-files. + ContainerFlags[ContainerFlags["IsContainerWithLocals"] = 5] = "IsContainerWithLocals"; + })(ContainerFlags || (ContainerFlags = {})); + var binder = createBinder(); + function bindSourceFile(file, options) { + var start = new Date().getTime(); + binder(file, options); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function createBinder() { + var file; + var options; + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var seenThisKeyword; + // state used by reachability checks + var hasExplicitReturn; + var currentReachabilityState; + var labelStack; + var labelIndexMap; + var implicitLabels; + // If this file is an external module, then it is automatically in strict-mode according to + // ES6. If it is not an external module, then we'll determine if it is in strict mode or + // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). + var inStrictMode; + var symbolCount = 0; + var Symbol; + var classifiableNames; + function bindSourceFile(f, opts) { + file = f; + options = opts; + inStrictMode = !!file.externalModuleIndicator; + classifiableNames = {}; + Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + bind(file); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + } + parent = undefined; + container = undefined; + blockScopeContainer = undefined; + lastContainer = undefined; + seenThisKeyword = false; + hasExplicitReturn = false; + labelStack = undefined; + labelIndexMap = undefined; + implicitLabels = undefined; + } + return bindSourceFile; + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function addDeclarationToSymbol(symbol, node, symbolFlags) { + symbol.flags |= symbolFlags; + node.symbol = symbol; + if (!symbol.declarations) { + symbol.declarations = []; + } + symbol.declarations.push(node); + if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) { + symbol.exports = {}; + } + if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { + symbol.members = {}; + } + if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { + symbol.valueDeclaration = node; + } + } + // Should not be called on a declaration with a computed property name, + // unless it is a well known Symbol. + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + return "\"" + node.name.text + "\""; + } + if (node.name.kind === 136 /* ComputedPropertyName */) { + var nameExpression = node.name.expression; + // treat computed property names where expression is string/numeric literal as just string/numeric literal + if (ts.isStringOrNumericLiteral(nameExpression.kind)) { + return nameExpression.text; + } + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 144 /* Constructor */: + return "__constructor"; + case 152 /* FunctionType */: + case 147 /* CallSignature */: + return "__call"; + case 153 /* ConstructorType */: + case 148 /* ConstructSignature */: + return "__new"; + case 149 /* IndexSignature */: + return "__index"; + case 228 /* ExportDeclaration */: + return "__export"; + case 227 /* ExportAssignment */: + return node.isExportEquals ? "export=" : "default"; + case 181 /* BinaryExpression */: + // Binary expression case is for JS module 'module.exports = expr' + return "export="; + case 213 /* FunctionDeclaration */: + case 214 /* ClassDeclaration */: + return node.flags & 512 /* Default */ ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + /** + * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. + * @param symbolTable - The symbol table which node will be added to. + * @param parent - node's parent declaration. + * @param node - The declaration to be added to the symbol table + * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.) + * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations. + */ + function declareSymbol(symbolTable, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var isDefaultExport = node.flags & 512 /* Default */; + // The exported symbol for an export default function/class node is always named "default" + var name = isDefaultExport && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + // Check and see if the symbol table already has a symbol with this name. If not, + // create a new symbol with this name and add it to the table. Note that we don't + // give the new symbol any flags *yet*. This ensures that it will not conflict + // with the 'excludes' flags we pass in. + // + // If we do get an existing symbol, see if it conflicts with the new symbol we're + // creating. For example, a 'var' symbol and a 'class' symbol will conflict within + // the same symbol table. If we have a conflict, report the issue on each + // declaration we have for this symbol, and then create a new symbol for this + // declaration. + // + // If we created a new symbol, either because we didn't have a symbol with this name + // in the symbol table, or we conflicted with an existing symbol, then just add this + // node as the sole declaration of the new symbol. + // + // Otherwise, we'll be merging into a compatible existing symbol (for example when + // you have multiple 'vars' with the same name in the same container). In this case + // just add this node into the declarations list of the symbol. + symbol = ts.hasProperty(symbolTable, name) + ? symbolTable[name] + : (symbolTable[name] = createSymbol(0 /* None */, name)); + if (name && (includes & 788448 /* Classifiable */)) { + classifiableNames[name] = name; + } + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + // Report errors every position with duplicate declaration + // Report errors on previous encountered declarations + var message = symbol.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.flags & 512 /* Default */) { + message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; + } + }); + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0 /* None */, name); + } + } + else { + symbol = createSymbol(0 /* None */, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + return symbol; + } + function declareModuleMember(node, symbolFlags, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; + if (symbolFlags & 8388608 /* Alias */) { + if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + else { + // 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. + if (hasExportModifier || container.flags & 131072 /* ExportContext */) { + var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | + (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | + (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + node.localSymbol = local; + return local; + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + } + // All container nodes are kept on a linked list in declaration order. This list is used by + // the getLocalNameOfContainer function in the type checker to validate that the local name + // used for a container is unique. + function bindChildren(node) { + // Before we recurse into a node's chilren, we first save the existing parent, container + // and block-container. Then after we pop out of processing the children, we restore + // these saved values. + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + // This node will now be set as the parent of all of its children as we recurse into them. + parent = node; + // Depending on what kind of node this is, we may have to adjust the current container + // and block-container. If the current node is a container, then it is automatically + // considered the current block-container as well. Also, for containers that we know + // may contain locals, we proactively initialize the .locals field. We do this because + // it's highly likely that the .locals will be needed to place some child in (for example, + // a parameter, or variable declaration). + // + // However, we do not proactively create the .locals for block-containers because it's + // totally normal and common for block-containers to never actually have a block-scoped + // variable in them. We don't want to end up allocating an object for every 'block' we + // run into when most of them won't be necessary. + // + // Finally, if this is a block-container, then we clear out any existing .locals object + // it may contain within it. This happens in incremental scenarios. Because we can be + // reusing a node from a previous compilation, that node may have had 'locals' created + // for it. We must clear this so we don't accidently move any stale data forward from + // a previous compilation. + var containerFlags = getContainerFlags(node); + if (containerFlags & 1 /* IsContainer */) { + container = blockScopeContainer = node; + if (containerFlags & 4 /* HasLocals */) { + container.locals = {}; + } + addToContainerChain(container); + } + else if (containerFlags & 2 /* IsBlockScopedContainer */) { + blockScopeContainer = node; + blockScopeContainer.locals = undefined; + } + var savedReachabilityState; + var savedLabelStack; + var savedLabels; + var savedImplicitLabels; + var savedHasExplicitReturn; + var kind = node.kind; + var flags = node.flags; + // reset all reachability check related flags on node (for incremental scenarios) + flags &= ~1572864 /* ReachabilityCheckFlags */; + if (kind === 215 /* InterfaceDeclaration */) { + seenThisKeyword = false; + } + var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + if (saveState) { + savedReachabilityState = currentReachabilityState; + savedLabelStack = labelStack; + savedLabels = labelIndexMap; + savedImplicitLabels = implicitLabels; + savedHasExplicitReturn = hasExplicitReturn; + currentReachabilityState = 2 /* Reachable */; + hasExplicitReturn = false; + labelStack = labelIndexMap = implicitLabels = undefined; + } + bindReachableStatement(node); + if (currentReachabilityState === 2 /* Reachable */ && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { + flags |= 524288 /* HasImplicitReturn */; + if (hasExplicitReturn) { + flags |= 1048576 /* HasExplicitReturn */; + } + } + if (kind === 215 /* InterfaceDeclaration */) { + flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; + } + node.flags = flags; + if (saveState) { + hasExplicitReturn = savedHasExplicitReturn; + currentReachabilityState = savedReachabilityState; + labelStack = savedLabelStack; + labelIndexMap = savedLabels; + implicitLabels = savedImplicitLabels; + } + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + /** + * Returns true if node and its subnodes were successfully traversed. + * Returning false means that node was not examined and caller needs to dive into the node himself. + */ + function bindReachableStatement(node) { + if (checkUnreachable(node)) { + ts.forEachChild(node, bind); + return; + } + switch (node.kind) { + case 198 /* WhileStatement */: + bindWhileStatement(node); + break; + case 197 /* DoStatement */: + bindDoStatement(node); + break; + case 199 /* ForStatement */: + bindForStatement(node); + break; + case 200 /* ForInStatement */: + case 201 /* ForOfStatement */: + bindForInOrForOfStatement(node); + break; + case 196 /* IfStatement */: + bindIfStatement(node); + break; + case 204 /* ReturnStatement */: + case 208 /* ThrowStatement */: + bindReturnOrThrow(node); + break; + case 203 /* BreakStatement */: + case 202 /* ContinueStatement */: + bindBreakOrContinueStatement(node); + break; + case 209 /* TryStatement */: + bindTryStatement(node); + break; + case 206 /* SwitchStatement */: + bindSwitchStatement(node); + break; + case 220 /* CaseBlock */: + bindCaseBlock(node); + break; + case 207 /* LabeledStatement */: + bindLabeledStatement(node); + break; + default: + ts.forEachChild(node, bind); + break; + } + } + function bindWhileStatement(n) { + var preWhileState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + var postWhileState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + // bind expressions (don't affect reachability) + bind(n.expression); + currentReachabilityState = preWhileState; + var postWhileLabel = pushImplicitLabel(); + bind(n.statement); + popImplicitLabel(postWhileLabel, postWhileState); + } + function bindDoStatement(n) { + var preDoState = currentReachabilityState; + var postDoLabel = pushImplicitLabel(); + bind(n.statement); + var postDoState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : preDoState; + popImplicitLabel(postDoLabel, postDoState); + // bind expressions (don't affect reachability) + bind(n.expression); + } + function bindForStatement(n) { + var preForState = currentReachabilityState; + var postForLabel = pushImplicitLabel(); + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.condition); + bind(n.incrementor); + bind(n.statement); + // for statement is considered infinite when it condition is either omitted or is true keyword + // - for(..;;..) + // - for(..;true;..) + var isInfiniteLoop = (!n.condition || n.condition.kind === 99 /* TrueKeyword */); + var postForState = isInfiniteLoop ? 4 /* Unreachable */ : preForState; + popImplicitLabel(postForLabel, postForState); + } + function bindForInOrForOfStatement(n) { + var preStatementState = currentReachabilityState; + var postStatementLabel = pushImplicitLabel(); + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.expression); + bind(n.statement); + popImplicitLabel(postStatementLabel, preStatementState); + } + function bindIfStatement(n) { + // denotes reachability state when entering 'thenStatement' part of the if statement: + // i.e. if condition is false then thenStatement is unreachable + var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + // denotes reachability state when entering 'elseStatement': + // i.e. if condition is true then elseStatement is unreachable + var ifFalseState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + currentReachabilityState = ifTrueState; + // bind expression (don't affect reachability) + bind(n.expression); + bind(n.thenStatement); + if (n.elseStatement) { + var preElseState = currentReachabilityState; + currentReachabilityState = ifFalseState; + bind(n.elseStatement); + currentReachabilityState = or(currentReachabilityState, preElseState); + } + else { + currentReachabilityState = or(currentReachabilityState, ifFalseState); + } + } + function bindReturnOrThrow(n) { + // bind expression (don't affect reachability) + bind(n.expression); + if (n.kind === 204 /* ReturnStatement */) { + hasExplicitReturn = true; + } + currentReachabilityState = 4 /* Unreachable */; + } + function bindBreakOrContinueStatement(n) { + // call bind on label (don't affect reachability) + bind(n.label); + // for continue case touch label so it will be marked a used + var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + if (isValidJump) { + currentReachabilityState = 4 /* Unreachable */; + } + } + function bindTryStatement(n) { + // catch\finally blocks has the same reachability as try block + var preTryState = currentReachabilityState; + bind(n.tryBlock); + var postTryState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.catchClause); + var postCatchState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.finallyBlock); + // post catch/finally state is reachable if + // - post try state is reachable - control flow can fall out of try block + // - post catch state is reachable - control flow can fall out of catch block + currentReachabilityState = or(postTryState, postCatchState); + } + function bindSwitchStatement(n) { + var preSwitchState = currentReachabilityState; + var postSwitchLabel = pushImplicitLabel(); + // bind expression (don't affect reachability) + bind(n.expression); + bind(n.caseBlock); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); + // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case + var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; + popImplicitLabel(postSwitchLabel, postSwitchState); + } + function bindCaseBlock(n) { + var startState = currentReachabilityState; + for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { + var clause = _a[_i]; + currentReachabilityState = startState; + bind(clause); + if (clause.statements.length && currentReachabilityState === 2 /* Reachable */ && options.noFallthroughCasesInSwitch) { + errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); + } + } + } + function bindLabeledStatement(n) { + // call bind on label (don't affect reachability) + bind(n.label); + var ok = pushNamedLabel(n.label); + bind(n.statement); + if (ok) { + popNamedLabel(n.label, currentReachabilityState); + } + } + function getContainerFlags(node) { + switch (node.kind) { + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + case 215 /* InterfaceDeclaration */: + case 217 /* EnumDeclaration */: + case 155 /* TypeLiteral */: + case 165 /* ObjectLiteralExpression */: + return 1 /* IsContainer */; + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 213 /* FunctionDeclaration */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + case 218 /* ModuleDeclaration */: + case 248 /* SourceFile */: + case 216 /* TypeAliasDeclaration */: + return 5 /* IsContainerWithLocals */; + case 244 /* CatchClause */: + case 199 /* ForStatement */: + case 200 /* ForInStatement */: + case 201 /* ForOfStatement */: + case 220 /* CaseBlock */: + return 2 /* IsBlockScopedContainer */; + case 192 /* Block */: + // do not treat blocks directly inside a function as a block-scoped-container. + // Locals that reside in this block should go to the function locals. Othewise 'x' + // would not appear to be a redeclaration of a block scoped local in the following + // example: + // + // function foo() { + // var x; + // let x; + // } + // + // If we placed 'var x' into the function locals and 'let x' into the locals of + // the block, then there would be no collision. + // + // By not creating a new block-scoped-container here, we ensure that both 'var x' + // and 'let x' go into the Function-container's locals, and we do get a collision + // conflict. + return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; + } + return 0 /* None */; + } + function addToContainerChain(next) { + if (lastContainer) { + lastContainer.nextContainer = next; + } + lastContainer = next; + } + function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { + // Just call this directly so that the return type of this function stays "void". + declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); + } + function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { + switch (container.kind) { + // Modules, source files, and classes need specialized handling for how their + // members are declared (for example, a member of a class will go into a specific + // symbol table depending on if it is static or not). We defer to specialized + // handlers to take care of declaring these child members. + case 218 /* ModuleDeclaration */: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 248 /* SourceFile */: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 217 /* EnumDeclaration */: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 155 /* TypeLiteral */: + case 165 /* ObjectLiteralExpression */: + case 215 /* InterfaceDeclaration */: + // Interface/Object-types always have their children added to the 'members' of + // their container. They are only accessible through an instance of their + // container, and are never in scope otherwise (even inside the body of the + // object / type / interface declaring them). An exception is type parameters, + // which are in scope without qualification (similar to 'locals'). + return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 213 /* FunctionDeclaration */: + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + case 216 /* TypeAliasDeclaration */: + // All the children of these container types are never visible through another + // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, + // they're only accessed 'lexically' (i.e. from code that exists underneath + // their container in the tree. To accomplish this, we simply add their declared + // symbol to the 'locals' of the container. These symbols can then be found as + // the type checker walks up the containers, checking them for matching names. + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function declareClassMember(node, symbolFlags, symbolExcludes) { + return node.flags & 64 /* Static */ + ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) + : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + } + function declareSourceFileMember(node, symbolFlags, symbolExcludes) { + return ts.isExternalModule(file) + ? declareModuleMember(node, symbolFlags, symbolExcludes) + : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + } + function hasExportDeclarations(node) { + var body = node.kind === 248 /* SourceFile */ ? node : node.body; + if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular + // declarations with export modifiers) is an export context in which declarations are implicitly exported. + if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 131072 /* ExportContext */; + } + else { + node.flags &= ~131072 /* ExportContext */; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 9 /* StringLiteral */) { + declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + } + else { + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + } + else { + declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { + // if module was already merged with some function, class or non-const enum + // treat is a non-const-enum-only + node.symbol.constEnumOnlyModule = false; + } + else { + var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; + if (node.symbol.constEnumOnlyModule === undefined) { + // non-merged case - use the current state + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + // merged case: module is const enum only if all its pieces are non-instantiated or const enum + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + } + function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072 /* Signature */); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); + var _a; + } + function bindObjectLiteralExpression(node) { + var ElementKind; + (function (ElementKind) { + ElementKind[ElementKind["Property"] = 1] = "Property"; + ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; + })(ElementKind || (ElementKind = {})); + if (inStrictMode) { + var seen = {}; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + if (prop.name.kind !== 69 /* Identifier */) { + continue; + } + var identifier = prop.name; + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields + var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + ? 1 /* Property */ + : 2 /* Accessor */; + var existingKind = seen[identifier.text]; + if (!existingKind) { + seen[identifier.text] = currentKind; + continue; + } + if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { + var span = ts.getErrorSpanForNode(file, identifier); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); + } + } + } + return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); + } + function bindAnonymousDeclaration(node, symbolFlags, name) { + var symbol = createSymbol(symbolFlags, name); + addDeclarationToSymbol(symbol, node, symbolFlags); + } + function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { + switch (blockScopeContainer.kind) { + case 218 /* ModuleDeclaration */: + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + case 248 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + } + // fall through. + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); + } + declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized + // check for reserved words used as identifiers in strict mode code. + function checkStrictModeIdentifier(node) { + if (inStrictMode && + node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ && + node.originalKeywordKind <= 114 /* LastFutureReservedWord */ && + !ts.isIdentifierName(node)) { + // Report error only if there are no parse errors in file + if (!file.parseDiagnostics.length) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); + } + } + } + function getStrictModeIdentifierMessage(node) { + // Provide specialized messages to help the user understand why we think they're in + // strict mode. + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; + } + function checkStrictModeBinaryExpression(node) { + if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) + checkStrictModeEvalOrArguments(node, node.left); + } + } + function checkStrictModeCatchClause(node) { + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments + if (inStrictMode && node.variableDeclaration) { + checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); + } + } + function checkStrictModeDeleteExpression(node) { + // Grammar checking + if (inStrictMode && node.expression.kind === 69 /* Identifier */) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name + var span = ts.getErrorSpanForNode(file, node.expression); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); + } + } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 69 /* Identifier */ && + (node.text === "eval" || node.text === "arguments"); + } + function checkStrictModeEvalOrArguments(contextNode, name) { + if (name && name.kind === 69 /* Identifier */) { + var identifier = name; + if (isEvalOrArgumentsIdentifier(identifier)) { + // We check first if the name is inside class declaration or class expression; if so give explicit message + // otherwise report generic error message. + var span = ts.getErrorSpanForNode(file, name); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); + } + } + } + function getStrictModeEvalOrArgumentsMessage(node) { + // Provide specialized messages to help the user understand why we think they're in + // strict mode. + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; + } + function checkStrictModeFunctionName(node) { + if (inStrictMode) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) + checkStrictModeEvalOrArguments(node, node.name); + } + } + function checkStrictModeNumericLiteral(node) { + if (inStrictMode && node.flags & 32768 /* OctalLiteral */) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); + } + } + function checkStrictModePostfixUnaryExpression(node) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + function checkStrictModePrefixUnaryExpression(node) { + // Grammar checking + if (inStrictMode) { + if (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + } + function checkStrictModeWithStatement(node) { + // Grammar checking for withStatement + if (inStrictMode) { + errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + function errorOnFirstToken(node, message, arg0, arg1, arg2) { + var span = ts.getSpanOfTokenAtPosition(file, node.pos); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + if (!node) { + return; + } + node.parent = parent; + var savedInStrictMode = inStrictMode; + if (!savedInStrictMode) { + updateStrictMode(node); + } + // First we bind declaration nodes to a symbol if possible. We'll both create a symbol + // and then potentially add the symbol to an appropriate symbol table. Possible + // destination symbol tables are: + // + // 1) The 'exports' table of the current container's symbol. + // 2) The 'members' table of the current container's symbol. + // 3) The 'locals' table of the current container. + // + // However, not all symbols will end up in any of these tables. 'Anonymous' symbols + // (like TypeLiterals for example) will not be put in any table. + bindWorker(node); + // Then we recurse into the children of the node to bind them as well. For certain + // symbols we do specialized work when we recurse. For example, we'll keep track of + // the current 'container' node when it changes. This helps us know which symbol table + // a local should go into for example. + bindChildren(node); + inStrictMode = savedInStrictMode; + } + function updateStrictMode(node) { + switch (node.kind) { + case 248 /* SourceFile */: + case 219 /* ModuleBlock */: + updateStrictModeStatementList(node.statements); + return; + case 192 /* Block */: + if (ts.isFunctionLike(node.parent)) { + updateStrictModeStatementList(node.statements); + } + return; + case 214 /* ClassDeclaration */: + case 186 /* ClassExpression */: + // All classes are automatically in strict mode in ES6. + inStrictMode = true; + return; + } + } + function updateStrictModeStatementList(statements) { + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (!ts.isPrologueDirective(statement)) { + return; + } + if (isUseStrictPrologueDirective(statement)) { + inStrictMode = true; + return; + } + } + } + /// Should be called only on prologue directives (isPrologueDirective(node) should be true) + function isUseStrictPrologueDirective(node) { + var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); + // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the + // string to contain unicode escapes (as per ES5). + return nodeText === "\"use strict\"" || nodeText === "'use strict'"; + } + function bindWorker(node) { + switch (node.kind) { + /* Strict mode checks */ + case 69 /* Identifier */: + return checkStrictModeIdentifier(node); + case 181 /* BinaryExpression */: + if (ts.isInJavaScriptFile(node)) { + if (ts.isExportsPropertyAssignment(node)) { + bindExportsPropertyAssignment(node); + } + else if (ts.isModuleExportsAssignment(node)) { + bindModuleExportsAssignment(node); + } + } + return checkStrictModeBinaryExpression(node); + case 244 /* CatchClause */: + return checkStrictModeCatchClause(node); + case 175 /* DeleteExpression */: + return checkStrictModeDeleteExpression(node); + case 8 /* NumericLiteral */: + return checkStrictModeNumericLiteral(node); + case 180 /* PostfixUnaryExpression */: + return checkStrictModePostfixUnaryExpression(node); + case 179 /* PrefixUnaryExpression */: + return checkStrictModePrefixUnaryExpression(node); + case 205 /* WithStatement */: + return checkStrictModeWithStatement(node); + case 97 /* ThisKeyword */: + seenThisKeyword = true; + return; + case 137 /* TypeParameter */: + return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); + case 138 /* Parameter */: + return bindParameter(node); + case 211 /* VariableDeclaration */: + case 163 /* BindingElement */: + return bindVariableDeclarationOrBindingElement(node); + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); + case 245 /* PropertyAssignment */: + case 246 /* ShorthandPropertyAssignment */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); + case 247 /* EnumMember */: + return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + // If this is an ObjectLiteralExpression method, then it sits in the same space + // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes + // so that it will conflict with any other object literal members with the same + // name. + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); + case 213 /* FunctionDeclaration */: + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + case 144 /* Constructor */: + return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); + case 145 /* GetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); + case 146 /* SetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + return bindFunctionOrConstructorType(node); + case 155 /* TypeLiteral */: + return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); + case 165 /* ObjectLiteralExpression */: + return bindObjectLiteralExpression(node); + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); + case 168 /* CallExpression */: + if (ts.isInJavaScriptFile(node)) { + bindCallExpression(node); + } + break; + // Members of classes, interfaces, and modules + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + return bindClassLikeDeclaration(node); + case 215 /* InterfaceDeclaration */: + return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); + case 216 /* TypeAliasDeclaration */: + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); + case 217 /* EnumDeclaration */: + return bindEnumDeclaration(node); + case 218 /* ModuleDeclaration */: + return bindModuleDeclaration(node); + // Imports and exports + case 221 /* ImportEqualsDeclaration */: + case 224 /* NamespaceImport */: + case 226 /* ImportSpecifier */: + case 230 /* ExportSpecifier */: + return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); + case 223 /* ImportClause */: + return bindImportClause(node); + case 228 /* ExportDeclaration */: + return bindExportDeclaration(node); + case 227 /* ExportAssignment */: + return bindExportAssignment(node); + case 248 /* SourceFile */: + return bindSourceFileIfExternalModule(); + } + } + function bindSourceFileIfExternalModule() { + setExportContextFlag(file); + if (ts.isExternalModule(file)) { + bindSourceFileAsExternalModule(); + } + } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); + } + function bindExportAssignment(node) { + var boundExpression = node.kind === 227 /* ExportAssignment */ ? node.expression : node.right; + if (!container.symbol || !container.symbol.exports) { + // Export assignment in some sort of block construct + bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); + } + else if (boundExpression.kind === 69 /* Identifier */) { + // An export default clause with an identifier exports all meanings of that identifier + declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); + } + else { + // An export default clause with an expression exports a value + declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); + } + } + function bindExportDeclaration(node) { + if (!container.symbol || !container.symbol.exports) { + // Export * in some sort of block construct + bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); + } + else if (!node.exportClause) { + // All export * declarations are collected in an __export symbol + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); + } + } + function bindImportClause(node) { + if (node.name) { + declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); + } + } + function setCommonJsModuleIndicator(node) { + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + bindSourceFileAsExternalModule(); + } + } + function bindExportsPropertyAssignment(node) { + // When we create a property via 'exports.foo = bar', the 'exports.foo' property access + // expression is the declaration + setCommonJsModuleIndicator(node); + declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 7340032 /* Export */, 0 /* None */); + } + function bindModuleExportsAssignment(node) { + // 'module.exports = expr' assignment + setCommonJsModuleIndicator(node); + bindExportAssignment(node); + } + function bindCallExpression(node) { + // We're only inspecting call expressions to detect CommonJS modules, so we can skip + // this check if we've already seen the module indicator + if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node) { + if (node.kind === 214 /* ClassDeclaration */) { + bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); + } + else { + var bindingName = node.name ? node.name.text : "__class"; + bindAnonymousDeclaration(node, 32 /* Class */, bindingName); + // Add name of class expression into the map for semantic classifier + if (node.name) { + classifiableNames[node.name.text] = node.name.text; + } + } + var symbol = node.symbol; + // 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'. + // + // Note: we check for this here because this class may be merging into a module. The + // module might have an exported variable called 'prototype'. We can't allow that as + // that would clash with the built-in 'prototype' for the class. + var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + function bindEnumDeclaration(node) { + return ts.isConst(node) + ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) + : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); + } + function bindVariableDeclarationOrBindingElement(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (!ts.isBindingPattern(node.name)) { + if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else if (ts.isParameterDeclaration(node)) { + // It is safe to walk up parent chain to find whether the node is a destructing parameter declaration + // because its parent chain has already been set up, since parents are set before descending into children. + // + // If node is a binding element in parameter declaration, we need to use ParameterExcludes. + // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration + // For example: + // function foo([a,a]) {} // Duplicate Identifier error + // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter + // // which correctly set excluded symbols + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + } + else { + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); + } + } + } + function bindParameter(node) { + if (inStrictMode) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkStrictModeEvalOrArguments(node, node.name); + } + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node)); + } + else { + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + } + // If this is a property-parameter, then also declare the property symbol into the + // containing class. + if (node.flags & 56 /* AccessibilityModifier */ && + node.parent.kind === 144 /* Constructor */ && + ts.isClassLike(node.parent.parent)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + return ts.hasDynamicName(node) + ? bindAnonymousDeclaration(node, symbolFlags, "__computed") + : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + // reachability checks + function pushNamedLabel(name) { + initializeReachabilityStateIfNecessary(); + if (ts.hasProperty(labelIndexMap, name.text)) { + return false; + } + labelIndexMap[name.text] = labelStack.push(1 /* Unintialized */) - 1; + return true; + } + function pushImplicitLabel() { + initializeReachabilityStateIfNecessary(); + var index = labelStack.push(1 /* Unintialized */) - 1; + implicitLabels.push(index); + return index; + } + function popNamedLabel(label, outerState) { + var index = labelIndexMap[label.text]; + ts.Debug.assert(index !== undefined); + ts.Debug.assert(labelStack.length == index + 1); + labelIndexMap[label.text] = undefined; + setCurrentStateAtLabel(labelStack.pop(), outerState, label); + } + function popImplicitLabel(implicitLabelIndex, outerState) { + if (labelStack.length !== implicitLabelIndex + 1) { + ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); + } + var i = implicitLabels.pop(); + if (implicitLabelIndex !== i) { + ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); + } + setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); + } + function setCurrentStateAtLabel(innerMergedState, outerState, label) { + if (innerMergedState === 1 /* Unintialized */) { + if (label && !options.allowUnusedLabels) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); + } + currentReachabilityState = outerState; + } + else { + currentReachabilityState = or(innerMergedState, outerState); + } + } + function jumpToLabel(label, outerState) { + initializeReachabilityStateIfNecessary(); + var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); + if (index === undefined) { + // reference to unknown label or + // break/continue used outside of loops + return false; + } + var stateAtLabel = labelStack[index]; + labelStack[index] = stateAtLabel === 1 /* Unintialized */ ? outerState : or(stateAtLabel, outerState); + return true; + } + function checkUnreachable(node) { + switch (currentReachabilityState) { + case 4 /* Unreachable */: + var reportError = + // report error on all statements except empty ones + (ts.isStatement(node) && node.kind !== 194 /* EmptyStatement */) || + // report error on class declarations + node.kind === 214 /* ClassDeclaration */ || + // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + // report error on regular enums and const enums if preserveConstEnums is set + (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + if (reportError) { + currentReachabilityState = 8 /* ReportedUnreachable */; + // unreachable code is reported if + // - user has explicitly asked about it AND + // - statement is in not ambient context (statements in ambient context is already an error + // so we should not report extras) AND + // - node is not variable statement OR + // - node is block scoped variable statement OR + // - node is not block scoped variable statement and at least one variable declaration has initializer + // Rationale: we don't want to report errors on non-initialized var's since they are hoisted + // On the other side we do want to report errors on non-initialized 'lets' because of TDZ + var reportUnreachableCode = !options.allowUnreachableCode && + !ts.isInAmbientContext(node) && + (node.kind !== 193 /* VariableStatement */ || + ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || + ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); + if (reportUnreachableCode) { + errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); + } + } + case 8 /* ReportedUnreachable */: + return true; + default: + return false; + } + function shouldReportErrorOnModuleDeclaration(node) { + var instanceState = getModuleInstanceState(node); + return instanceState === 1 /* Instantiated */ || (instanceState === 2 /* ConstEnumOnly */ && options.preserveConstEnums); + } + } + function initializeReachabilityStateIfNecessary() { + if (labelIndexMap) { + return; + } + currentReachabilityState = 2 /* Reachable */; + labelIndexMap = {}; + labelStack = []; + implicitLabels = []; + } + } +})(ts || (ts = {})); /// /* @internal */ var ts; @@ -13755,7 +13918,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: getApparentTypeOfContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -14025,7 +14188,7 @@ var ts; return ts.getAncestor(node, 248 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 248 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 248 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14127,15 +14290,24 @@ var ts; } switch (location.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location)) + if (!ts.isExternalOrCommonJsModule(location)) break; case 218 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; if (location.kind === 248 /* SourceFile */ || (location.kind === 218 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { - // It's an external module. Because of module/namespace merging, a module's exports are in scope, - // yet we never want to treat an export specifier as putting a member in scope. Therefore, - // if the name we find is purely an export specifier, it is not actually considered in scope. + // It's an external module. First see if the module has an export default and if the local + // name of that export default matches. + if (result = moduleExports["default"]) { + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { + break loop; + } + result = undefined; + } + // Because of module/namespace merging, a module's exports are in scope, + // yet we never want to treat an export specifier as putting a member in scope. + // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope. // Two things to note about this: // 1. We have to check this without calling getSymbol. The problem with calling getSymbol // on an export specifier is that it might find the export specifier itself, and try to @@ -14149,12 +14321,6 @@ var ts; ts.getDeclarationOfKind(moduleExports[name], 230 /* ExportSpecifier */)) { break; } - result = moduleExports["default"]; - var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; } if (result = getSymbol(moduleExports, name, meaning & 8914931 /* ModuleMember */)) { break loop; @@ -14297,7 +14463,7 @@ var ts; // declare module foo { // interface bar {} // } - // let foo/*1*/: foo/*2*/.bar; + // const foo/*1*/: foo/*2*/.bar; // The foo at /*1*/ and /*2*/ will share same symbol with two meaning // block - scope variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, @@ -14601,6 +14767,9 @@ var ts; if (moduleName === undefined) { return; } + if (moduleName.indexOf("!") >= 0) { + moduleName = moduleName.substr(0, moduleName.indexOf("!")); + } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); @@ -14788,7 +14957,7 @@ var ts; } switch (location_1.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location_1)) { + if (!ts.isExternalOrCommonJsModule(location_1)) { break; } case 218 /* ModuleDeclaration */: @@ -14910,7 +15079,7 @@ var ts; // export class c { // } // } - // let x: typeof m.c + // const x: typeof m.c // In the above example when we start with checking if typeof m.c symbol is accessible, // we are going to see if c can be accessed in scope directly. // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible @@ -14949,7 +15118,7 @@ var ts; } function hasExternalModuleSymbol(declaration) { return (declaration.kind === 218 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 248 /* SourceFile */ && ts.isExternalModule(declaration)); + (declaration.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15100,7 +15269,7 @@ var ts; parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses + // const the writer know we just wrote out a symbol. The declaration emitter writer uses // this to determine if an import it has previously seen (and not written out) needs // to be written to the file once the walk of the tree is complete. // @@ -15181,7 +15350,7 @@ var ts; writeAnonymousType(type, flags); } else if (type.flags & 256 /* StringLiteral */) { - writer.writeStringLiteral(type.text); + writer.writeStringLiteral("\"" + ts.escapeString(type.text) + "\""); } else { // Should never get here @@ -15568,7 +15737,7 @@ var ts; } } else if (node.kind === 248 /* SourceFile */) { - return ts.isExternalModule(node) ? node : undefined; + return ts.isExternalOrCommonJsModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); @@ -15650,7 +15819,7 @@ var ts; // Private/protected properties/methods are not visible return false; } - // Public properties/methods are visible if its parents are visible, so let it fall into next case statement + // Public properties/methods are visible if its parents are visible, so const it fall into next case statement case 144 /* Constructor */: case 148 /* ConstructSignature */: case 147 /* CallSignature */: @@ -15678,7 +15847,7 @@ var ts; // Source file is always visible case 248 /* SourceFile */: return true; - // Export assignements do not create name bindings outside the module + // Export assignments do not create name bindings outside the module case 227 /* ExportAssignment */: return false; default: @@ -15814,6 +15983,23 @@ var ts; var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node); } + function getTextOfPropertyName(name) { + switch (name.kind) { + case 69 /* Identifier */: + return name.text; + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + return name.text; + case 136 /* ComputedPropertyName */: + if (ts.isStringOrNumericLiteral(name.expression.kind)) { + return name.expression.text; + } + } + return undefined; + } + function isComputedNonLiteralName(name) { + return name.kind === 136 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); + } // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -15835,10 +16021,15 @@ var ts; if (pattern.kind === 161 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name_10)) { + // computed properties with non-literal names are treated as 'any' + return anyType; + } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - type = getTypeOfPropertyOfType(parentType, name_10.text) || - isNumericLiteralName(name_10.text) && getIndexTypeOfType(parentType, 1 /* Number */) || + var text = getTextOfPropertyName(name_10); + type = getTypeOfPropertyOfType(parentType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); if (!type) { error(name_10, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_10)); @@ -15938,10 +16129,17 @@ var ts; // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern, includePatternInType) { var members = {}; + var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + if (isComputedNonLiteralName(name)) { + // do not include computed properties in the implied type + hasComputedProperties = true; + return; + } + var text = getTextOfPropertyName(name); + var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); + var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType); symbol.bindingElement = e; members[symbol.name] = symbol; @@ -15950,6 +16148,9 @@ var ts; if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= 67108864 /* ObjectLiteralPatternWithComputedProperties */; + } return result; } // Return the type implied by an array binding pattern @@ -16026,6 +16227,14 @@ var ts; if (declaration.kind === 227 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } + // Handle module.exports = expr + if (declaration.kind === 181 /* BinaryExpression */) { + return links.type = checkExpression(declaration.right); + } + // Handle exports.p = expr + if (declaration.kind === 166 /* PropertyAccessExpression */) { + return checkExpressionCached(declaration.parent.right); + } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { return unknownType; @@ -16304,23 +16513,25 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseContructorType = getBaseConstructorTypeOfClass(type); - if (!(baseContructorType.flags & 80896 /* ObjectType */)) { + var baseConstructorType = getBaseConstructorTypeOfClass(type); + if (!(baseConstructorType.flags & 80896 /* ObjectType */)) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); var baseType; - if (baseContructorType.symbol && baseContructorType.symbol.flags & 32 /* Class */) { - // When base constructor type is a class we know that the constructors all have the same type parameters as the + var originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 /* Class */ && + areAllOuterTypeParametersApplied(originalBaseType)) { + // When base constructor type is a class with no captured type arguments we know that the constructors all have the same type parameters as the // class and all return the instance type of the class. There is no need for further checks and we can apply the // type arguments in the same manner as a type reference to get the same error reporting experience. - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseContructorType.symbol); + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - var constructors = getInstantiatedConstructorsForTypeArguments(baseContructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -16345,6 +16556,17 @@ var ts; type.resolvedBaseTypes.push(baseType); } } + function areAllOuterTypeParametersApplied(type) { + // An unapplied type parameter has its symbol still the same as the matching argument symbol. + // Since parameters are applied outer-to-inner, only the last outer parameter needs to be checked. + var outerTypeParameters = type.outerTypeParameters; + if (outerTypeParameters) { + var last = outerTypeParameters.length - 1; + var typeArguments = type.typeArguments; + return outerTypeParameters[last].symbol !== typeArguments[last].symbol; + } + return true; + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { @@ -16424,7 +16646,7 @@ var ts; type.typeArguments = type.typeParameters; type.thisType = createType(512 /* TypeParameter */ | 33554432 /* ThisType */); type.thisType.symbol = symbol; - type.thisType.constraint = getTypeWithThisArgument(type); + type.thisType.constraint = type; } } return links.declaredType; @@ -16939,6 +17161,20 @@ var ts; type = getApparentType(type); return type.flags & 49152 /* UnionOrIntersection */ ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } + /** + * The apparent type of a type parameter is the base constraint instantiated with the type parameter + * as the type argument for the 'this' type. + */ + function getApparentTypeOfTypeParameter(type) { + if (!type.resolvedApparentType) { + var constraintType = getConstraintOfTypeParameter(type); + while (constraintType && constraintType.flags & 512 /* TypeParameter */) { + constraintType = getConstraintOfTypeParameter(constraintType); + } + type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); + } + return type.resolvedApparentType; + } /** * For a type parameter, return the base constraint of the type parameter. For the string, number, * boolean, and symbol primitive types, return the corresponding object types. Otherwise return the @@ -16946,12 +17182,7 @@ var ts; */ function getApparentType(type) { if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) { - type = emptyObjectType; - } + type = getApparentTypeOfTypeParameter(type); } if (type.flags & 258 /* StringLike */) { type = globalStringType; @@ -17116,7 +17347,7 @@ var ts; if (node.initializer) { var signatureDeclaration = node.parent; var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -17217,6 +17448,16 @@ var ts; } return result; } + function resolveExternalModuleTypeByLiteral(name) { + var moduleSym = resolveExternalModuleName(name, name); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { @@ -17740,11 +17981,12 @@ var ts; return links.resolvedType; } function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; + var text = node.text; + if (ts.hasProperty(stringLiteralTypes, text)) { + return stringLiteralTypes[text]; } - var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getTextOfNode(node); + var type = stringLiteralTypes[text] = createType(256 /* StringLiteral */); + type.text = text; return type; } function getTypeFromStringLiteral(node) { @@ -18265,7 +18507,7 @@ var ts; return false; } function hasExcessProperties(source, target, reportErrors) { - if (someConstituentTypeHasKind(target, 80896 /* ObjectType */)) { + if (!(target.flags & 67108864 /* ObjectLiteralPatternWithComputedProperties */) && someConstituentTypeHasKind(target, 80896 /* ObjectType */)) { for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { @@ -18358,9 +18600,6 @@ var ts; return result; } function typeParameterIdenticalTo(source, target) { - if (source.symbol.name !== target.symbol.name) { - return 0 /* False */; - } // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { return -1 /* True */; @@ -18852,18 +19091,29 @@ var ts; } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } + function isMatchingSignature(source, target, partialMatch) { + // A source signature matches a target signature if the two signatures have the same number of required, + // optional, and rest parameters. + if (source.parameters.length === target.parameters.length && + source.minArgumentCount === target.minArgumentCount && + source.hasRestParameter === target.hasRestParameter) { + return true; + } + // A source signature partially matches a target signature if the target signature has no fewer required + // parameters and no more overall parameters than the source signature (where a signature with a rest + // parameter is always considered to have more overall parameters than one without). + if (partialMatch && source.minArgumentCount <= target.minArgumentCount && (source.hasRestParameter && !target.hasRestParameter || + source.hasRestParameter === target.hasRestParameter && source.parameters.length >= target.parameters.length)) { + return true; + } + return false; + } function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1 /* True */; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { - if (!partialMatch || - source.parameters.length < target.parameters.length && !source.hasRestParameter || - source.minArgumentCount > target.minArgumentCount) { - return 0 /* False */; - } + if (!(isMatchingSignature(source, target, partialMatch))) { + return 0 /* False */; } var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { @@ -18957,6 +19207,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isStringLiteralType(type) { + return type.flags & 256 /* StringLiteral */; + } /** * Check if a Type was written as a tuple type literal. * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. @@ -19629,7 +19882,7 @@ var ts; } function narrowTypeByInstanceof(type, expr, assumeTrue) { // Check that type is not any, assumed result is true, and we have variable symbol on the left - if (isTypeAny(type) || !assumeTrue || expr.left.kind !== 69 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (isTypeAny(type) || expr.left.kind !== 69 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } // Check that right operand is a function type with a prototype property @@ -19660,6 +19913,12 @@ var ts; } } if (targetType) { + if (!assumeTrue) { + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); + } + return type; + } return getNarrowedType(type, targetType); } return type; @@ -20129,6 +20388,9 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } + function contextualTypeIsStringLiteralType(type) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isStringLiteralType) : isStringLiteralType(type)); + } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -20150,7 +20412,7 @@ var ts; } function getContextualTypeForObjectLiteralElement(element) { var objectLiteral = element.parent; - var type = getContextualType(objectLiteral); + var type = getApparentTypeOfContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { // For a (non-symbol) computed property, there is no reason to look up the name @@ -20173,7 +20435,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); + var type = getApparentTypeOfContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) @@ -20206,11 +20468,28 @@ var ts; } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. - function getContextualType(node) { - var type = getContextualTypeWorker(node); + function getApparentTypeOfContextualType(node) { + var type = getContextualType(node); return type && getApparentType(type); } - function getContextualTypeWorker(node) { + /** + * Woah! Do you really want to use this function? + * + * Unless you're trying to get the *non-apparent* type for a + * value-literal type or you're authoring relevant portions of this algorithm, + * you probably meant to use 'getApparentTypeOfContextualType'. + * Otherwise this may not be very useful. + * + * In cases where you *are* working on this function, you should understand + * when it is appropriate to use 'getContextualType' and 'getApparentTypeOfContetxualType'. + * + * - Use 'getContextualType' when you are simply going to propagate the result to the expression. + * - Use 'getApparentTypeOfContextualType' when you're going to need the members of the type. + * + * @param node the expression whose contextual type will be returned. + * @returns the contextual type of an expression. + */ + function getContextualType(node) { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; @@ -20285,7 +20564,7 @@ var ts; ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + : getApparentTypeOfContextualType(node); if (!type) { return undefined; } @@ -20411,7 +20690,7 @@ var ts; type.pattern = node; return type; } - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting @@ -20494,10 +20773,11 @@ var ts; checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = {}; var propertiesArray = []; - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 161 /* ObjectBindingPattern */ || contextualType.pattern.kind === 165 /* ObjectLiteralExpression */); var typeFlags = 0; + var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; @@ -20525,8 +20805,11 @@ var ts; if (isOptional) { prop.flags |= 536870912 /* Optional */; } + if (ts.hasDynamicName(memberDecl)) { + patternWithComputedProperties = true; + } } - else if (contextualTypeHasPattern) { + else if (contextualTypeHasPattern && !(contextualType.flags & 67108864 /* ObjectLiteralPatternWithComputedProperties */)) { // If object literal is contextually typed by the implied type of a binding pattern, and if the // binding pattern specifies a default value for the property, make the property optional. var impliedProp = getPropertyOfType(contextualType, member.name); @@ -20578,7 +20861,7 @@ var ts; var numberIndexType = getIndexType(1 /* Number */); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshObjectLiteral */; - result.flags |= 524288 /* ObjectLiteral */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */); + result.flags |= 524288 /* ObjectLiteral */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */) | (patternWithComputedProperties ? 67108864 /* ObjectLiteralPatternWithComputedProperties */ : 0); if (inDestructuringPattern) { result.pattern = node; } @@ -21289,7 +21572,7 @@ var ts; // so order how inherited signatures are processed is still preserved. // interface A { (x: string): void } // interface B extends A { (x: 'foo'): string } - // let b: B; + // const b: B; // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] function reorderCandidates(signatures, result) { var lastParent; @@ -22247,6 +22530,10 @@ var ts; return anyType; } } + // In JavaScript files, calls to any identifier 'require' are treated as external module imports + if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { @@ -22257,7 +22544,10 @@ var ts; var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { + // Permit 'number[] | "foo"' to be asserted to 'string'. + var bothAreStringLike = someConstituentTypeHasKind(targetType, 258 /* StringLike */) && + someConstituentTypeHasKind(widenedType, 258 /* StringLike */); + if (!bothAreStringLike && !(isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } @@ -22801,19 +23091,26 @@ var ts; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { - // TODO(andersh): Computed property support var name_13 = p.name; + if (name_13.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(name_13); + } + if (isComputedNonLiteralName(name_13)) { + continue; + } + var text = getTextOfPropertyName(name_13); var type = isTypeAny(sourceType) ? sourceType - : getTypeOfPropertyOfType(sourceType, name_13.text) || - isNumericLiteralName(name_13.text) && getIndexTypeOfType(sourceType, 1 /* Number */) || + : getTypeOfPropertyOfType(sourceType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { if (p.kind === 246 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { - checkDestructuringAssignment(p.initializer || name_13, type); + // non-shorthand property assignments should always have initializers + checkDestructuringAssignment(p.initializer, type); } } else { @@ -23014,6 +23311,10 @@ var ts; case 31 /* ExclamationEqualsToken */: case 32 /* EqualsEqualsEqualsToken */: case 33 /* ExclamationEqualsEqualsToken */: + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (someConstituentTypeHasKind(leftType, 258 /* StringLike */) && someConstituentTypeHasKind(rightType, 258 /* StringLike */)) { + return booleanType; + } if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } @@ -23137,6 +23438,13 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkStringLiteralExpression(node) { + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { + return getStringLiteralType(node); + } + return stringType; + } function checkTemplateExpression(node) { // We just want to check each expressions, but we are unconcerned with // the type of each expression, as any value may be coerced into a string. @@ -23187,7 +23495,7 @@ var ts; if (isInferentialContext(contextualMapper)) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { @@ -23251,6 +23559,7 @@ var ts; case 183 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: + return checkStringLiteralExpression(node); case 11 /* NoSubstitutionTemplateLiteral */: return stringType; case 10 /* RegularExpressionLiteral */: @@ -24580,7 +24889,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 248 /* SourceFile */ && ts.isExternalModule(parent)) { + if (parent.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -24598,15 +24907,15 @@ var ts; // A non-initialized declaration is a no-op as the block declaration will resolve before the var // declaration. the problem is if the declaration has an initializer. this will act as a write to the // block declared value. this is fine for let, but not const. - // Only consider declarations with initializers, uninitialized let declarations will not + // Only consider declarations with initializers, uninitialized const declarations will not // step on a let/const variable. - // Do not consider let and const declarations, as duplicate block-scoped declarations + // Do not consider const and const declarations, as duplicate block-scoped declarations // are handled by the binder. - // We are only looking for let declarations that step on let\const declarations from a + // We are only looking for const declarations that step on let\const declarations from a // different scope. e.g.: // { // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration - // let x = 0; // symbol for this declaration will be 'symbol' + // const x = 0; // symbol for this declaration will be 'symbol' // } // skip block-scoped variables and parameters if ((ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) !== 0 || ts.isParameterDeclaration(node)) { @@ -24693,6 +25002,12 @@ var ts; checkExpressionCached(node.initializer); } } + if (node.kind === 163 /* BindingElement */) { + // check computed properties inside property names of binding elements + if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(node.propertyName); + } + } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); @@ -25176,6 +25491,7 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); + var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause if (clause.kind === 242 /* DefaultClause */ && !hasDuplicateDefaultClause) { @@ -25195,6 +25511,10 @@ var ts; // 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(caseClause.expression); + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) { + return; + } if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined); @@ -25659,11 +25979,14 @@ var ts; var enumIsConst = ts.isConst(node); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.name.kind === 136 /* ComputedPropertyName */) { + if (isComputedNonLiteralName(member.name)) { error(member.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } - else if (isNumericLiteralName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + else { + var text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } } var previousEnumMemberIsNonConstant = autoValue === undefined; var initializer = member.initializer; @@ -26305,8 +26628,8 @@ var ts; } // Function and class expression bodies are checked after all statements in the enclosing body. This is // to ensure constructs like the following are permitted: - // let foo = function () { - // let s = foo(); + // const foo = function () { + // const s = foo(); // return "hello"; // } // Here, performing a full type check of the body of the function expression whilst in the process of @@ -26421,8 +26744,12 @@ var ts; if (!(links.flags & 1 /* TypeChecked */)) { // Check whether the file has declared it is the default lib, // and whether the user has specifically chosen to avoid checking it. - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; + if (compilerOptions.skipDefaultLibCheck) { + // If the user specified '--noLib' and a file has a '/// ', + // then we should treat that file as a default lib. + if (node.hasNoDefaultLib) { + return; + } } // Grammar checking checkGrammarSourceFile(node); @@ -26432,7 +26759,7 @@ var ts; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (ts.isExternalModule(node)) { + if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } if (potentialThisCollisions.length) { @@ -26515,7 +26842,7 @@ var ts; } switch (location.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalOrCommonJsModule(location)) { break; } case 218 /* ModuleDeclaration */: @@ -27153,9 +27480,18 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, - isArgumentsLocalBinding: isArgumentsLocalBinding + isArgumentsLocalBinding: isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; } + function getExternalModuleFileFromDeclaration(declaration) { + var specifier = ts.getExternalModuleName(declaration); + var moduleSymbol = getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return undefined; + } + return ts.getDeclarationOfKind(moduleSymbol, 248 /* SourceFile */); + } function initializeTypeChecker() { // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { @@ -27163,11 +27499,10 @@ var ts; }); // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { + if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } }); - // Initialize special symbols getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; @@ -27866,7 +28201,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 136 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (ts.isDynamicName(node)) { return grammarErrorOnNode(node, message); } } @@ -28225,11 +28560,15 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; - var currentSourceFile; + var currentText; + var currentLineMap; + var currentIdentifiers; + var isCurrentFileExternalModule; var reportedDeclarationError = false; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; + var noDeclare = !root; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; // Contains the reference paths that needs to go in the declaration file. @@ -28272,23 +28611,56 @@ var ts; else { // Emit references corresponding to this file var emittedReferencedFiles = []; + var prevModuleElementDeclarationEmitInfo = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isDeclarationFile(sourceFile)) { // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && + // If the reference file is a declaration file, emit that reference + if (referencedFile && (ts.isDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } }); } + } + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + noDeclare = false; emitSourceFile(sourceFile); } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + // create asynchronous output for the importDeclarations + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 1); + increaseIndent(); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + decreaseIndent(); + } + }); + setWriter(oldWriter); + } + prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; + } }); + moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); } return { reportedDeclarationError: reportedDeclarationError, @@ -28297,13 +28669,12 @@ var ts; referencePathsOutput: referencePathsOutput }; function hasInternalAnnotation(range) { - var text = currentSourceFile.text; - var comment = text.substring(range.pos, range.end); + var comment = currentText.substring(range.pos, range.end); return comment.indexOf("@internal") >= 0; } function stripInternal(node) { if (node) { - var leadingCommentRanges = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + var leadingCommentRanges = ts.getLeadingCommentRanges(currentText, node.pos); if (ts.forEach(leadingCommentRanges, hasInternalAnnotation)) { return; } @@ -28395,7 +28766,7 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -28461,10 +28832,10 @@ var ts; } function writeJsDocComments(declaration) { if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + var jsDocComments = ts.getJsDocCommentsFromText(declaration, currentText); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, declaration, jsDocComments); // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, jsDocComments, /*trailingSeparator*/ true, newLine, ts.writeCommentRange); + ts.emitComments(currentText, currentLineMap, writer, jsDocComments, /*trailingSeparator*/ true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -28481,7 +28852,7 @@ var ts; case 103 /* VoidKeyword */: case 97 /* ThisKeyword */: case 9 /* StringLiteral */: - return writeTextOfNode(currentSourceFile, type); + return writeTextOfNode(currentText, type); case 188 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); case 151 /* TypeReference */: @@ -28512,14 +28883,14 @@ var ts; } function writeEntityName(entityName) { if (entityName.kind === 69 /* Identifier */) { - writeTextOfNode(currentSourceFile, entityName); + writeTextOfNode(currentText, entityName); } else { var left = entityName.kind === 135 /* QualifiedName */ ? entityName.left : entityName.expression; var right = entityName.kind === 135 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, right); + writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { @@ -28549,7 +28920,7 @@ var ts; } } function emitTypePredicate(type) { - writeTextOfNode(currentSourceFile, type.parameterName); + writeTextOfNode(currentText, type.parameterName); write(" is "); emitType(type.type); } @@ -28590,9 +28961,12 @@ var ts; } } function emitSourceFile(node) { - currentSourceFile = node; + currentText = node.text; + currentLineMap = ts.getLineStarts(node); + currentIdentifiers = node.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentSourceFile, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); emitLines(node.statements); } // Return a temp variable name to be used in `export default` statements. @@ -28601,13 +28975,13 @@ var ts; // do not need to keep track of created temp names. function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + if (!ts.hasProperty(currentIdentifiers, baseName)) { return baseName; } var count = 0; while (true) { var name_18 = baseName + "_" + (++count); - if (!ts.hasProperty(currentSourceFile.identifiers, name_18)) { + if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } } @@ -28615,7 +28989,7 @@ var ts; function emitExportAssignment(node) { if (node.expression.kind === 69 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + writeTextOfNode(currentText, node.expression); } else { // Expression @@ -28653,7 +29027,7 @@ var ts; writeModuleElement(node); } else if (node.kind === 221 /* ImportEqualsDeclaration */ || - (node.parent.kind === 248 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { + (node.parent.kind === 248 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot @@ -28707,7 +29081,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent === currentSourceFile) { + if (node.parent.kind === 248 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -28715,7 +29089,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 215 /* InterfaceDeclaration */) { + else if (node.kind !== 215 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -28742,7 +29116,7 @@ var ts; write("export "); } write("import "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" = "); if (ts.isInternalModuleImportEqualsDeclaration(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); @@ -28750,7 +29124,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentSourceFile, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); write(");"); } writer.writeLine(); @@ -28785,7 +29159,7 @@ var ts; if (node.importClause) { var currentWriterPos = writer.getTextPos(); if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { - writeTextOfNode(currentSourceFile, node.importClause.name); + writeTextOfNode(currentText, node.importClause.name); } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { @@ -28794,7 +29168,7 @@ var ts; } if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { write("* as "); - writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + writeTextOfNode(currentText, node.importClause.namedBindings.name); } else { write("{ "); @@ -28804,16 +29178,28 @@ var ts; } write(" from "); } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier) { + if (moduleSpecifier.kind === 9 /* StringLiteral */ && (!root) && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + if (moduleName) { + write("\""); + write(moduleName); + write("\""); + return; + } + } + writeTextOfNode(currentText, moduleSpecifier); + } function emitImportOrExportSpecifier(node) { if (node.propertyName) { - writeTextOfNode(currentSourceFile, node.propertyName); + writeTextOfNode(currentText, node.propertyName); write(" as "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); @@ -28835,7 +29221,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -28849,11 +29235,11 @@ var ts; else { write("module "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); while (node.body.kind !== 219 /* ModuleBlock */) { node = node.body; write("."); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -28872,7 +29258,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("type "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); emitTypeParameters(node.typeParameters); write(" = "); emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); @@ -28894,7 +29280,7 @@ var ts; write("const "); } write("enum "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" {"); writeLine(); increaseIndent(); @@ -28905,7 +29291,7 @@ var ts; } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var enumMemberValue = resolver.getConstantValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -28922,7 +29308,7 @@ var ts; increaseIndent(); emitJsDocComments(node); decreaseIndent(); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); @@ -29037,7 +29423,7 @@ var ts; write("abstract "); } write("class "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -29060,7 +29446,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("interface "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -29095,7 +29481,7 @@ var ts; // If this node is a computed name, it can only be a symbol, because we've already skipped // it if it's not a well known symbol. In that case, the text of the name will be exactly // what we want, namely the name expression enclosed in brackets. - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If optional property emit ? if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); @@ -29177,7 +29563,7 @@ var ts; emitBindingPattern(bindingElement.name); } else { - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); writeTypeOfDeclaration(bindingElement, /*type*/ undefined, getBindingElementTypeVisibilityError); } } @@ -29221,7 +29607,7 @@ var ts; emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (!(node.flags & 16 /* Private */)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); @@ -29307,13 +29693,13 @@ var ts; } if (node.kind === 213 /* FunctionDeclaration */) { write("function "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } else if (node.kind === 144 /* Constructor */) { write("constructor"); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (ts.hasQuestionToken(node)) { write("?"); } @@ -29437,7 +29823,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } if (resolver.isOptionalParameter(node)) { write("?"); @@ -29552,7 +29938,7 @@ var ts; // Example: // original: function foo({y: [a,b,c]}) {} // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; - writeTextOfNode(currentSourceFile, bindingElement.propertyName); + writeTextOfNode(currentText, bindingElement.propertyName); write(": "); } if (bindingElement.name) { @@ -29575,7 +29961,7 @@ var ts; if (bindingElement.dotDotDotToken) { write("..."); } - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); } } } @@ -29667,6 +30053,18 @@ var ts; return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function getResolvedExternalModuleName(host, file) { + return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); + } + ts.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || ts.isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); + } + ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; var Jump; (function (Jump) { Jump[Jump["Break"] = 2] = "Break"; @@ -29954,15 +30352,19 @@ var ts; var newLine = host.getNewLine(); var jsxDesugaring = host.getCompilerOptions().jsx !== 1 /* Preserve */; var shouldEmitJsx = function (s) { return (s.languageVariant === 1 /* JSX */ && !jsxDesugaring); }; + var outFile = compilerOptions.outFile || compilerOptions.out; + var emitJavaScript = createFileEmitter(); if (targetSourceFile === undefined) { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.outFile || compilerOptions.out) { - emitFile(compilerOptions.outFile || compilerOptions.out); + if (outFile) { + emitFile(outFile); + } + else { + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); + emitFile(jsFilePath, sourceFile); + } + }); } } else { @@ -29971,8 +30373,8 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); emitFile(jsFilePath, targetSourceFile); } - else if (!ts.isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) { - emitFile(compilerOptions.outFile || compilerOptions.out); + else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { + emitFile(outFile); } } // Sort and make the unique list of diagnostics @@ -30024,10 +30426,16 @@ var ts; } } } - function emitJavaScript(jsFilePath, root) { + function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var currentText; + var currentLineMap; + var currentFileIdentifiers; + var renamedDependencies; + var isEs6Module; + var isCurrentFileExternalModule; // name of an exporter function if file is a System external module // System.register([...], function () {...}) // exporting in System modules looks like: @@ -30035,15 +30443,15 @@ var ts; // => // var x;... exporter("x", x = 1) var exportFunctionForFile; - var generatedNameSet = {}; - var nodeToGeneratedName = []; + var generatedNameSet; + var nodeToGeneratedName; var computedPropertyNamesToGeneratedNames; var convertedLoopState; - var extendsEmitted = false; - var decorateEmitted = false; - var paramEmitted = false; - var awaiterEmitted = false; - var tempFlags = 0; + var extendsEmitted; + var decorateEmitted; + var paramEmitted; + var awaiterEmitted; + var tempFlags; var tempVariables; var tempParameters; var externalImports; @@ -30075,6 +30483,8 @@ var ts; var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; + /** The root file passed to the emit function (if present) */ + var root; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, @@ -30085,31 +30495,77 @@ var ts; _a[1 /* CommonJS */] = emitCommonJSModule, _a ); - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); + var bundleEmitDelegates = (_b = {}, + _b[5 /* ES6 */] = function () { }, + _b[2 /* AMD */] = emitAMDModule, + _b[4 /* System */] = emitSystemModule, + _b[3 /* UMD */] = function () { }, + _b[1 /* CommonJS */] = function () { }, + _b + ); + return doEmit; + function doEmit(jsFilePath, rootFile) { + // reset the state + writer.reset(); + currentSourceFile = undefined; + currentText = undefined; + currentLineMap = undefined; + exportFunctionForFile = undefined; + generatedNameSet = {}; + nodeToGeneratedName = []; + computedPropertyNamesToGeneratedNames = undefined; + convertedLoopState = undefined; + extendsEmitted = false; + decorateEmitted = false; + paramEmitted = false; + awaiterEmitted = false; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = undefined; + detachedCommentsInfo = undefined; + sourceMapData = undefined; + isEs6Module = false; + renamedDependencies = undefined; + isCurrentFileExternalModule = false; + root = rootFile; + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { + initializeEmitterWithSourceMaps(jsFilePath, root); + } + if (root) { + // Do not call emit directly. It does not set the currentSourceFile. + emitSourceFile(root); + } + else { + if (modulekind) { + ts.forEach(host.getSourceFiles(), emitEmitHelpers); } - }); + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { + emitSourceFile(sourceFile); + } + }); + } + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); } - writeLine(); - writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM); - return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + currentText = sourceFile.text; + currentLineMap = ts.getLineStarts(sourceFile); exportFunctionForFile = undefined; + isEs6Module = sourceFile.symbol && sourceFile.symbol.exports && !!sourceFile.symbol.exports["___esModule"]; + renamedDependencies = sourceFile.renamedDependencies; + currentFileIdentifiers = sourceFile.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(sourceFile); emit(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(currentFileIdentifiers, name) && !ts.hasProperty(generatedNameSet, name); } // Return the next available name in the pattern _a ... _z, _0, _1, ... @@ -30192,7 +30648,7 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps() { + function initializeEmitterWithSourceMaps(jsFilePath, root) { var sourceMapDir; // The directory in which sourcemap will be // Current source map file and its index in the sources list var sourceMapSourceIndex = -1; @@ -30280,7 +30736,7 @@ var ts; } } function recordSourceMapSpan(pos) { - var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); // Convert the location to be one-based. sourceLinePos.line++; sourceLinePos.character++; @@ -30314,13 +30770,13 @@ var ts; } function recordEmitNodeStartSpan(node) { // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); + recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); } function recordEmitNodeEndSpan(node) { recordSourceMapSpan(node.end); } function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + var tokenStartPos = ts.skipTrivia(currentText, startPos); recordSourceMapSpan(tokenStartPos); var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); recordSourceMapSpan(tokenEndPos); @@ -30402,9 +30858,9 @@ var ts; sourceMapNameIndices.pop(); } ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { + function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { @@ -30434,7 +30890,7 @@ var ts; return output; } } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); @@ -30450,7 +30906,7 @@ var ts; sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; } // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); } // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); @@ -30522,7 +30978,7 @@ var ts; scopeEmitEnd = recordScopeNameEnd; writeComment = writeCommentRangeWithMap; } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } // Create a temporary variable with a unique unused name. @@ -30702,7 +31158,7 @@ var ts; // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. if (node.parent) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + return ts.getTextOfNodeFromSourceText(currentText, node); } // If we can't reach the original source text, use the canonical form if it's a number, // or an escaped quoted form of the original text if it's string-like. @@ -30729,7 +31185,7 @@ var ts; // Find original source text, since we need to emit the raw strings of the tagged template. // The raw strings contain the (escaped) strings of what the user wrote. // Examples: `\n` is converted to "\\n", a template string with a newline to "\n". - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + var text = ts.getTextOfNodeFromSourceText(currentText, node); // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"), // thus we need to remove those characters. // First template piece starts with "`", others with "}" @@ -31146,7 +31602,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } write("\""); } @@ -31246,7 +31702,7 @@ var ts; // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name_23); + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -31270,7 +31726,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function isNameOfNestedRedeclaration(node) { @@ -31308,7 +31764,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function emitThis(node) { @@ -31712,7 +32168,7 @@ var ts; function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here // we manually emit the identifier to avoid rewriting. - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If emitting pre-ES6 code, or if the name requires rewriting when resolved as an expression identifier, // we emit a normal property assignment. For example: // module m { @@ -31722,7 +32178,7 @@ var ts; // let obj = { y }; // } // Here we need to emit obj = { y : m.y } regardless of the output target. - if (languageVersion < 2 /* ES6 */ || isNamespaceExportReference(node.name)) { + if (modulekind !== 5 /* ES6 */ || isNamespaceExportReference(node.name)) { // Emit identifier as an identifier write(": "); emit(node.name); @@ -31779,11 +32235,11 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); // 1 .toString is a valid property access, emit a space after the literal // Also emit a space if expression is a integer const enum value - it will appear in generated code as numeric literal - var shouldEmitSpace; + var shouldEmitSpace = false; if (!indentedBeforeDot) { if (node.expression.kind === 8 /* NumericLiteral */) { // check if numeric literal was originally written with a dot - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node.expression); + var text = ts.getTextOfNodeFromSourceText(currentText, node.expression); shouldEmitSpace = text.indexOf(ts.tokenToString(21 /* DotToken */)) < 0; } else { @@ -32962,16 +33418,16 @@ var ts; emitToken(16 /* CloseBraceToken */, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node1.pos)) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { if (node.kind === 241 /* CaseClause */) { @@ -33077,7 +33533,7 @@ var ts; ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 227 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { - if (!currentSourceFile.symbol.exports["___esModule"]) { + if (!isEs6Module) { if (languageVersion === 1 /* ES5 */) { // default value of configurable, enumerable, writable are `false`. write("Object.defineProperty(exports, \"__esModule\", { value: true });"); @@ -33272,14 +33728,20 @@ var ts; return node; } function createPropertyAccessForDestructuringProperty(object, propName) { - // We create a synthetic copy of the identifier in order to avoid the rewriting that might - // otherwise occur when the identifier is emitted. - var syntheticName = ts.createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== 69 /* Identifier */) { - return createElementAccessExpression(object, syntheticName); + var index; + var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; + if (nameIsComputed) { + index = ensureIdentifier(propName.expression, /* reuseIdentifierExpression */ false); } - return createPropertyAccessExpression(object, syntheticName); + else { + // We create a synthetic copy of the identifier in order to avoid the rewriting that might + // otherwise occur when the identifier is emitted. + index = ts.createSynthesizedNode(propName.kind); + index.text = propName.text; + } + return !nameIsComputed && index.kind === 69 /* Identifier */ + ? createPropertyAccessExpression(object, index) + : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { var call = ts.createSynthesizedNode(168 /* CallExpression */); @@ -33742,7 +34204,6 @@ var ts; var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); var isArrowFunction = node.kind === 174 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; - var args; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current // `this` and `arguments` objects to `__awaiter`. The generator function @@ -35197,8 +35658,8 @@ var ts; * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName) { - if (currentSourceFile.renamedDependencies && ts.hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { - return "\"" + currentSourceFile.renamedDependencies[moduleName.text] + "\""; + if (renamedDependencies && ts.hasProperty(renamedDependencies, moduleName.text)) { + return "\"" + renamedDependencies[moduleName.text] + "\""; } return undefined; } @@ -35351,7 +35812,7 @@ var ts; // - current file is not external module // - import declaration is top level and target is value imported by entity name if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + (!isCurrentFileExternalModule && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); // variable declaration for import-equals declaration can be hoisted in system modules @@ -35579,7 +36040,7 @@ var ts; function getLocalNameForExternalImport(node) { var namespaceDeclaration = getNamespaceDeclarationNode(node); if (namespaceDeclaration && !isDefaultImport(node)) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } if (node.kind === 222 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); @@ -35884,7 +36345,7 @@ var ts; ts.getEnclosingBlockScopeContainer(node).kind === 248 /* SourceFile */; } function isCurrentFileSystemExternalModule() { - return modulekind === 4 /* System */ && ts.isExternalModule(currentSourceFile); + return modulekind === 4 /* System */ && isCurrentFileExternalModule; } function emitSystemModuleBody(node, dependencyGroups, startIndex) { // shape of the body in system modules: @@ -36054,7 +36515,13 @@ var ts; writeLine(); write("}"); // execute } - function emitSystemModule(node) { + function writeModuleName(node, emitRelativePathAsModuleName) { + var moduleName = node.moduleName; + if (moduleName || (emitRelativePathAsModuleName && (moduleName = getResolvedExternalModuleName(host, node)))) { + write("\"" + moduleName + "\", "); + } + } + function emitSystemModule(node, emitRelativePathAsModuleName) { collectExternalModuleInfo(node); // System modules has the following shape // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) @@ -36069,9 +36536,7 @@ var ts; exportFunctionForFile = makeUniqueName("exports"); writeLine(); write("System.register("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } + writeModuleName(node, emitRelativePathAsModuleName); write("["); var groupIndices = {}; var dependencyGroups = []; @@ -36090,6 +36555,12 @@ var ts; if (i !== 0) { write(", "); } + if (emitRelativePathAsModuleName) { + var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); + if (name_29) { + text = "\"" + name_29 + "\""; + } + } write(text); } write("], function(" + exportFunctionForFile + ") {"); @@ -36103,7 +36574,7 @@ var ts; writeLine(); write("});"); } - function getAMDDependencyNames(node, includeNonAmdDependencies) { + function getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { // names of modules with corresponding parameter in the factory function var aliasedModuleNames = []; // names of modules with no corresponding parameters in factory function @@ -36126,6 +36597,12 @@ var ts; var importNode = externalImports_4[_c]; // Find the name of the external module var externalModuleName = getExternalModuleNameText(importNode); + if (emitRelativePathAsModuleName) { + var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_30) { + externalModuleName = "\"" + name_30 + "\""; + } + } // Find the name of the module alias, if there is one var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { @@ -36138,7 +36615,7 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function emitAMDDependencies(node, includeNonAmdDependencies) { + function emitAMDDependencies(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // @@ -36150,7 +36627,7 @@ var ts; // To ensure this is true in cases of modules with no aliases, e.g.: // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies); + var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName); emitAMDDependencyList(dependencyNames); write(", "); emitAMDFactoryHeader(dependencyNames); @@ -36177,15 +36654,13 @@ var ts; } write(") {"); } - function emitAMDModule(node) { + function emitAMDModule(node, emitRelativePathAsModuleName) { emitEmitHelpers(node); collectExternalModuleInfo(node); writeLine(); write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, /*includeNonAmdDependencies*/ true); + writeModuleName(node, emitRelativePathAsModuleName); + emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName); increaseIndent(); var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); emitExportStarHelper(); @@ -36404,8 +36879,13 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; - emitModule(node); + if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; + emitModule(node); + } + else { + bundleEmitDelegates[modulekind](node, /*emitRelativePathAsModuleName*/ true); + } } else { // emit prologue directives prior to __extends @@ -36666,7 +37146,7 @@ var ts; } function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentText, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -36683,10 +37163,10 @@ var ts; function isTripleSlashComment(comment) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && + if (currentText.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */) { - var textSubStr = currentSourceFile.text.substring(comment.pos, comment.end); + currentText.charCodeAt(comment.pos + 2) === 47 /* slash */) { + var textSubStr = currentText.substring(comment.pos, comment.end); return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? true : false; @@ -36703,7 +37183,7 @@ var ts; } else { // get the leading comments from the node - return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNodeFromText(node, currentText); } } } @@ -36712,7 +37192,7 @@ var ts; // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { if (node.parent.kind === 248 /* SourceFile */ || node.end !== node.parent.end) { - return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); + return ts.getTrailingCommentRanges(currentText, node.end); } } } @@ -36746,9 +37226,9 @@ var ts; leadingComments = ts.filter(getLeadingCommentsToEmit(node), isTripleSlashComment); } } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { @@ -36757,7 +37237,7 @@ var ts; // Emit the trailing comments only if the parent's end doesn't match var trailingComments = getTrailingCommentsToEmit(node); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - ts.emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); } /** * Emit trailing comments at the position. The term trailing comment is used here to describe following comment: @@ -36768,9 +37248,9 @@ var ts; if (compilerOptions.removeComments) { return; } - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, pos); + var trailingComments = ts.getTrailingCommentRanges(currentText, pos); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - ts.emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitLeadingCommentsOfPositionWorker(pos) { if (compilerOptions.removeComments) { @@ -36783,14 +37263,14 @@ var ts; } else { // get the leading comments from the node - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentText, pos); } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAndUpdateCommentsInfo(node) { - var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, compilerOptions.removeComments); + var currentDetachedCommentInfo = ts.emitDetachedComments(currentText, currentLineMap, writer, writeComment, node, newLine, compilerOptions.removeComments); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -36801,12 +37281,12 @@ var ts; } } function emitShebang() { - var shebang = ts.getShebang(currentSourceFile.text); + var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); } } - var _a; + var _a, _b; } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); @@ -36866,11 +37346,11 @@ var ts; if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -36880,8 +37360,8 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(candidate, failedLookupLocation, host) { - return ts.forEach(ts.moduleFileExtensions, tryLoad); + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; if (host.fileExists(fileName)) { @@ -36893,7 +37373,7 @@ var ts; } } } - function loadNodeModuleFromDirectory(candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); if (host.fileExists(packageJsonPath)) { var jsonContent; @@ -36906,7 +37386,7 @@ var ts; jsonContent = { typings: undefined }; } if (jsonContent.typings) { - var result = loadNodeModuleFromFile(ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); if (result) { return result; } @@ -36916,7 +37396,7 @@ var ts; // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -36926,11 +37406,11 @@ var ts; if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -36956,9 +37436,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; + var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(ts.supportedExtensions, function (extension) { + referencedSourceFile = ts.forEach(extensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { // resolve .tsx files only if jsx support is enabled // 'logical not' handles both undefined and None cases @@ -36989,10 +37470,8 @@ var ts; /* @internal */ ts.defaultInitCompilerOptions = { module: 1 /* CommonJS */, - target: 0 /* ES3 */, + target: 1 /* ES5 */, noImplicitAny: false, - outDir: "built", - rootDir: ".", sourceMap: false }; function createCompilerHost(options, setParentNodes) { @@ -37397,43 +37876,55 @@ var ts; if (file.imports) { return; } + var isJavaScriptFile = ts.isSourceFileJavaScript(file); var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /* allowRelativeModuleNames */ true); + collect(node, /* allowRelativeModuleNames */ true, /* collectOnlyRequireCalls */ false); } file.imports = imports || emptyArray; - function collect(node, allowRelativeModuleNames) { - switch (node.kind) { - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { + return; + function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { + if (!collectOnlyRequireCalls) { + switch (node.kind) { + case 222 /* ImportDeclaration */: + case 221 /* ImportEqualsDeclaration */: + case 228 /* ExportDeclaration */: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { + break; + } + if (!moduleNameExpr.text) { + break; + } + if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } - break; - case 218 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { - // 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 - ts.forEachChild(node.body, function (node) { + case 218 /* ModuleDeclaration */: + if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { // 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. - collect(node, /* allowRelativeModuleNames */ false); - }); - } - break; + // 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 + ts.forEachChild(node.body, function (node) { + // 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. + collect(node, /* allowRelativeModuleNames */ false, collectOnlyRequireCalls); + }); + } + break; + } + } + if (isJavaScriptFile) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /* collectOnlyRequireCalls */ true); }); + } } } } @@ -37526,7 +38017,6 @@ var ts; // always process imported modules to record module name resolutions processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -37604,6 +38094,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (!commonPathComponents) { + return currentDirectory; + } return ts.getNormalizedPathFromPathComponents(commonPathComponents); } function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { @@ -37689,12 +38182,15 @@ var ts; if (options.module === 5 /* ES6 */ && languageVersion < 2 /* ES6 */) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); } + // Cannot specify module gen that isn't amd or system with --out + if (outFile && options.module && !(options.module === 2 /* AMD */ || options.module === 4 /* System */)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile")); + } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted if (options.outDir || options.sourceRoot || - (options.mapRoot && - (!outFile || firstExternalModuleSourceFile !== undefined))) { + options.mapRoot) { if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); @@ -38212,20 +38708,20 @@ var ts; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); for (var i = 0; i < sysFiles.length; i++) { - var name_29 = sysFiles[i]; - if (ts.fileExtensionIs(name_29, ".d.ts")) { - var baseName = name_29.substr(0, name_29.length - ".d.ts".length); + var name_31 = sysFiles[i]; + if (ts.fileExtensionIs(name_31, ".d.ts")) { + var baseName = name_31.substr(0, name_31.length - ".d.ts".length); if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_29); + fileNames.push(name_31); } } - else if (ts.fileExtensionIs(name_29, ".ts")) { - if (!ts.contains(sysFiles, name_29 + "x")) { - fileNames.push(name_29); + else if (ts.fileExtensionIs(name_31, ".ts")) { + if (!ts.contains(sysFiles, name_31 + "x")) { + fileNames.push(name_31); } } else { - fileNames.push(name_29); + fileNames.push(name_31); } } } @@ -38453,12 +38949,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_30 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_30); + for (var name_32 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_32); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_30); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); if (!matches) { continue; } @@ -38471,14 +38967,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_30); + matches = patternMatcher.getMatches(containers, name_32); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_30, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -38859,9 +39355,9 @@ var ts; case 211 /* VariableDeclaration */: case 163 /* BindingElement */: var variableDeclarationNode; - var name_31; + var name_33; if (node.kind === 163 /* BindingElement */) { - name_31 = node.name; + name_33 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration @@ -38873,16 +39369,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_31 = node.name; + name_33 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); } case 144 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -39802,7 +40298,7 @@ var ts; if (!candidates.length) { // We didn't have any sig help items produced by the TS compiler. If this is a JS // file, then see if we can figure out anything better. - if (ts.isJavaScript(sourceFile.fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { return createJavaScriptSignatureHelpItems(argumentInfo); } return undefined; @@ -41662,9 +42158,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_32 in o) { - if (o[name_32] === rule) { - return name_32; + for (var name_34 in o) { + if (o[name_34] === rule) { + return name_34; } } throw new Error("Unknown rule"); @@ -42096,7 +42592,7 @@ var ts; function TokenRangeAccess(from, to, except) { this.tokens = []; for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { + if (ts.indexOf(except, token) < 0) { this.tokens.push(token); } } @@ -43709,13 +44205,18 @@ var ts; ]; var jsDocCompletionEntries; function createNode(kind, pos, end, flags, parent) { - var node = new (ts.getNodeConstructor(kind))(pos, end); + var node = new NodeObject(kind, pos, end); node.flags = flags; node.parent = parent; return node; } var NodeObject = (function () { - function NodeObject() { + function NodeObject(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0 /* None */; + this.parent = undefined; } NodeObject.prototype.getSourceFile = function () { return ts.getSourceFileOfNode(this); @@ -44198,8 +44699,8 @@ var ts; })(); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); - function SourceFileObject() { - _super.apply(this, arguments); + function SourceFileObject(kind, pos, end) { + _super.call(this, kind, pos, end); } SourceFileObject.prototype.update = function (newText, textChangeRange) { return ts.updateSourceFile(this, newText, textChangeRange); @@ -44521,6 +45022,9 @@ var ts; ClassificationTypeNames.typeAliasName = "type alias name"; ClassificationTypeNames.parameterName = "parameter name"; ClassificationTypeNames.docCommentTagName = "doc comment tag name"; + ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; + ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; + ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -44543,6 +45047,9 @@ var ts; ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; })(ts.ClassificationType || (ts.ClassificationType = {})); var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { @@ -44922,8 +45429,9 @@ var ts; }; } ts.createDocumentRegistry = createDocumentRegistry; - function preProcessFile(sourceText, readImportFiles) { + function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { if (readImportFiles === void 0) { readImportFiles = true; } + if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; } var referencedFiles = []; var importedFiles = []; var ambientExternalModules; @@ -44957,9 +45465,207 @@ var ts; end: pos + importPath.length }); } - function processImport() { + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeDeclare() { + var token = scanner.getToken(); + if (token === 122 /* DeclareKeyword */) { + // declare module "mod" + token = scanner.scan(); + if (token === 125 /* ModuleKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + recordAmbientExternalModule(); + } + } + return true; + } + return false; + } + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeImport() { + var token = scanner.getToken(); + if (token === 89 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import "mod"; + recordModuleName(); + return true; + } + else { + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import d from "mod"; + recordModuleName(); + return true; + } + } + else if (token === 56 /* EqualsToken */) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + else if (token === 24 /* CommaToken */) { + // consume comma and keep going + token = scanner.scan(); + } + else { + // unknown syntax + return true; + } + } + if (token === 15 /* OpenBraceToken */) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure that it stops on EOF + while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + token = scanner.scan(); + } + if (token === 16 /* CloseBraceToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === 37 /* AsteriskToken */) { + token = scanner.scan(); + if (token === 116 /* AsKeyword */) { + token = scanner.scan(); + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import * as NS from "mod" + // import d, * as NS from "mod" + recordModuleName(); + } + } + } + } + } + } + return true; + } + return false; + } + function tryConsumeExport() { + var token = scanner.getToken(); + if (token === 82 /* ExportKeyword */) { + token = scanner.scan(); + if (token === 15 /* OpenBraceToken */) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure it stops on EOF + while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + token = scanner.scan(); + } + if (token === 16 /* CloseBraceToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === 37 /* AsteriskToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // export * from "mod" + recordModuleName(); + } + } + } + else if (token === 89 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 56 /* EqualsToken */) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + } + } + return true; + } + return false; + } + function tryConsumeRequireCall(skipCurrentToken) { + var token = skipCurrentToken ? scanner.scan() : scanner.getToken(); + if (token === 127 /* RequireKeyword */) { + token = scanner.scan(); + if (token === 17 /* OpenParenToken */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // require("mod"); + recordModuleName(); + } + } + return true; + } + return false; + } + function tryConsumeDefine() { + var token = scanner.getToken(); + if (token === 69 /* Identifier */ && scanner.getTokenValue() === "define") { + token = scanner.scan(); + if (token !== 17 /* OpenParenToken */) { + return true; + } + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // looks like define ("modname", ... - skip string literal and comma + token = scanner.scan(); + if (token === 24 /* CommaToken */) { + token = scanner.scan(); + } + else { + // unexpected token + return true; + } + } + // should be start of dependency list + if (token !== 19 /* OpenBracketToken */) { + return true; + } + // skip open bracket + token = scanner.scan(); + var i = 0; + // scan until ']' or EOF + while (token !== 20 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { + // record string literals as module names + if (token === 9 /* StringLiteral */) { + recordModuleName(); + i++; + } + token = scanner.scan(); + } + return true; + } + return false; + } + function processImports() { scanner.setText(sourceText); - var token = scanner.scan(); + scanner.scan(); // Look for: // import "mod"; // import d from "mod" @@ -44971,152 +45677,26 @@ var ts; // export * from "mod" // export {a as b} from "mod" // export import i = require("mod") - while (token !== 1 /* EndOfFileToken */) { - if (token === 122 /* DeclareKeyword */) { - // declare module "mod" - token = scanner.scan(); - if (token === 125 /* ModuleKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - recordAmbientExternalModule(); - continue; - } - } + // (for JavaScript files) require("mod") + while (true) { + if (scanner.getToken() === 1 /* EndOfFileToken */) { + break; } - else if (token === 89 /* ImportKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import "mod"; - recordModuleName(); - continue; - } - else { - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import d from "mod"; - recordModuleName(); - continue; - } - } - else if (token === 56 /* EqualsToken */) { - token = scanner.scan(); - if (token === 127 /* RequireKeyword */) { - token = scanner.scan(); - if (token === 17 /* OpenParenToken */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import i = require("mod"); - recordModuleName(); - continue; - } - } - } - } - else if (token === 24 /* CommaToken */) { - // consume comma and keep going - token = scanner.scan(); - } - else { - // unknown syntax - continue; - } - } - if (token === 15 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 16 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 16 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import {a as A} from "mod"; - // import d, {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 37 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 116 /* AsKeyword */) { - token = scanner.scan(); - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import * as NS from "mod" - // import d, * as NS from "mod" - recordModuleName(); - } - } - } - } - } - } + // check if at least one of alternative have moved scanner forward + if (tryConsumeDeclare() || + tryConsumeImport() || + tryConsumeExport() || + (detectJavaScriptImports && (tryConsumeRequireCall(/* skipCurrentToken */ false) || tryConsumeDefine()))) { + continue; } - else if (token === 82 /* ExportKeyword */) { - token = scanner.scan(); - if (token === 15 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 16 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 16 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export {a as A} from "mod"; - // export {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 37 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export * from "mod" - recordModuleName(); - } - } - } - else if (token === 89 /* ImportKeyword */) { - token = scanner.scan(); - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 56 /* EqualsToken */) { - token = scanner.scan(); - if (token === 127 /* RequireKeyword */) { - token = scanner.scan(); - if (token === 17 /* OpenParenToken */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export import i = require("mod"); - recordModuleName(); - } - } - } - } - } - } + else { + scanner.scan(); } - token = scanner.scan(); } scanner.setText(undefined); } if (readImportFiles) { - processImport(); + processImports(); } processTripleSlashDirectives(); return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientExternalModules }; @@ -45547,7 +46127,7 @@ var ts; // For JavaScript files, we don't want to report the normal typescript semantic errors. // Instead, we just report errors for using TypeScript-only constructs from within a // JavaScript file. - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(targetSourceFile)) { return getJavaScriptSemanticDiagnostics(targetSourceFile); } // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. @@ -45759,7 +46339,7 @@ var ts; var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); - var isJavaScriptFile = ts.isJavaScript(fileName); + var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); @@ -46393,8 +46973,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_33 = element.propertyName || element.name; - exisingImportsOrExports[name_33.text] = true; + var name_35 = element.propertyName || element.name; + exisingImportsOrExports[name_35.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -46426,7 +47006,10 @@ var ts; } var existingName = void 0; if (m.kind === 163 /* BindingElement */ && m.propertyName) { - existingName = m.propertyName.text; + // include only identifiers in completion list + if (m.propertyName.kind === 69 /* Identifier */) { + existingName = m.propertyName.text; + } } else { // TODO(jfreeman): Account for computed property name @@ -46466,46 +47049,43 @@ var ts; return undefined; } var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot, isJsDocTagName = completionData.isJsDocTagName; - var entries; if (isJsDocTagName) { // If the current position is a jsDoc tag name, only tag names should be provided for completion return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() }; } - if (isRightOfDot && ts.isJavaScript(fileName)) { - entries = getCompletionEntriesFromSymbols(symbols); - ts.addRange(entries, getJavaScriptCompletionEntries()); + var sourceFile = getValidSourceFile(fileName); + var entries = []; + if (isRightOfDot && ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames)); } else { if (!symbols || symbols.length === 0) { return undefined; } - entries = getCompletionEntriesFromSymbols(symbols); + getCompletionEntriesFromSymbols(symbols, entries); } // Add keywords if this is not a member completion list if (!isMemberCompletion && !isJsDocTagName) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries() { + function getJavaScriptCompletionEntries(sourceFile, uniqueNames) { var entries = []; - var allNames = {}; var target = program.getCompilerOptions().target; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - var nameTable = getNameTable(sourceFile); - for (var name_34 in nameTable) { - if (!allNames[name_34]) { - allNames[name_34] = name_34; - var displayName = getCompletionEntryDisplayName(name_34, target, /*performCharacterChecks:*/ true); - if (displayName) { - var entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } + var nameTable = getNameTable(sourceFile); + for (var name_36 in nameTable) { + if (!uniqueNames[name_36]) { + uniqueNames[name_36] = name_36; + var displayName = getCompletionEntryDisplayName(name_36, target, /*performCharacterChecks:*/ true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); } } } @@ -46543,25 +47123,24 @@ var ts; sortText: "0" }; } - function getCompletionEntriesFromSymbols(symbols) { + function getCompletionEntriesFromSymbols(symbols, entries) { var start = new Date().getTime(); - var entries = []; + var uniqueNames = {}; if (symbols) { - var nameToSymbol = {}; for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) { var symbol = symbols_3[_i]; var entry = createCompletionEntry(symbol, location); if (entry) { var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(nameToSymbol, id)) { + if (!ts.lookUp(uniqueNames, id)) { entries.push(entry); - nameToSymbol[id] = symbol; + uniqueNames[id] = id; } } } } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); - return entries; + return uniqueNames; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -46762,16 +47341,16 @@ var ts; case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(54 /* ColonToken */)); + displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); displayParts.push(ts.spacePart()); } - if (!(type.flags & 65536 /* Anonymous */)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + if (!(type.flags & ts.TypeFlags.Anonymous)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); } - addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); + addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); break; default: // Just signature @@ -48396,19 +48975,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_35 = node.text; + var name_37 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_35); + var unionProperty = contextualType.getProperty(name_37); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_35); + var symbol = t.getProperty(name_37); if (symbol) { result_4.push(symbol); } @@ -48417,7 +48996,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_35); + var symbol_1 = contextualType.getProperty(name_37); if (symbol_1) { return [symbol_1]; } @@ -48828,6 +49407,9 @@ var ts; case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName; case 17 /* parameterName */: return ClassificationTypeNames.parameterName; case 18 /* docCommentTagName */: return ClassificationTypeNames.docCommentTagName; + case 19 /* jsxOpenTagName */: return ClassificationTypeNames.jsxOpenTagName; + case 20 /* jsxCloseTagName */: return ClassificationTypeNames.jsxCloseTagName; + case 21 /* jsxSelfClosingTagName */: return ClassificationTypeNames.jsxSelfClosingTagName; } } function convertClassifications(classifications) { @@ -49097,6 +49679,21 @@ var ts; return 17 /* parameterName */; } return; + case 235 /* JsxOpeningElement */: + if (token.parent.tagName === token) { + return 19 /* jsxOpenTagName */; + } + return; + case 237 /* JsxClosingElement */: + if (token.parent.tagName === token) { + return 20 /* jsxCloseTagName */; + } + return; + case 234 /* JsxSelfClosingElement */: + if (token.parent.tagName === token) { + return 21 /* jsxSelfClosingTagName */; + } + return; } } return 2 /* identifier */; @@ -50021,18 +50618,8 @@ var ts; ts.getDefaultLibFilePath = getDefaultLibFilePath; function initializeServices() { ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0 /* None */; - this.parent = undefined; - } - var proto = kind === 248 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - Node.prototype = proto; - return Node; - }, + getNodeConstructor: function () { return NodeObject; }, + getSourceFileConstructor: function () { return SourceFileObject; }, getSymbolConstructor: function () { return SymbolObject; }, getTypeConstructor: function () { return TypeObject; }, getSignatureConstructor: function () { return SignatureObject; } @@ -51102,7 +51689,8 @@ var ts; }; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + // for now treat files as JavaScript + var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); var convertResult = { referencedFiles: [], importedFiles: [], @@ -51166,7 +51754,7 @@ var ts; TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { try { if (this.documentRegistry === undefined) { - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var hostAdapter = new LanguageServiceShimHostAdapter(host); var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); @@ -51199,7 +51787,7 @@ var ts; TypeScriptServicesFactory.prototype.close = function () { // Forget all the registered shims this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); + this.documentRegistry = undefined; }; TypeScriptServicesFactory.prototype.registerShim = function (shim) { this._shims.push(shim); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index d2758e6d5e9..af9a8bffe35 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -387,6 +387,7 @@ declare namespace ts { right: Identifier; } type EntityName = Identifier | QualifiedName; + type PropertyName = Identifier | LiteralExpression | ComputedPropertyName; type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; interface Declaration extends Node { _declarationBrand: any; @@ -425,7 +426,7 @@ declare namespace ts { initializer?: Expression; } interface BindingElement extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: Identifier | BindingPattern; initializer?: Expression; @@ -452,7 +453,7 @@ declare namespace ts { objectAssignmentInitializer?: Expression; } interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: DeclarationName; questionToken?: Node; @@ -581,7 +582,7 @@ declare namespace ts { asteriskToken?: Node; expression?: Expression; } - interface BinaryExpression extends Expression { + interface BinaryExpression extends Expression, Declaration { left: Expression; operatorToken: Node; right: Expression; @@ -625,7 +626,7 @@ declare namespace ts { interface ObjectLiteralExpression extends PrimaryExpression, Declaration { properties: NodeArray; } - interface PropertyAccessExpression extends MemberExpression { + interface PropertyAccessExpression extends MemberExpression, Declaration { expression: LeftHandSideExpression; dotToken: Node; name: Identifier; @@ -1220,6 +1221,7 @@ declare namespace ts { ObjectLiteral = 524288, ESSymbol = 16777216, ThisType = 33554432, + ObjectLiteralPatternWithComputedProperties = 67108864, StringLike = 258, NumberLike = 132, ObjectType = 80896, @@ -1537,7 +1539,6 @@ declare namespace ts { function getTypeParameterOwner(d: Declaration): Declaration; } declare namespace ts { - function getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node; function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; @@ -2126,6 +2127,9 @@ declare namespace ts { static typeAliasName: string; static parameterName: string; static docCommentTagName: string; + static jsxOpenTagName: string; + static jsxCloseTagName: string; + static jsxSelfClosingTagName: string; } enum ClassificationType { comment = 1, @@ -2146,6 +2150,9 @@ declare namespace ts { typeAliasName = 16, parameterName = 17, docCommentTagName = 18, + jsxOpenTagName = 19, + jsxCloseTagName = 20, + jsxSelfClosingTagName = 21, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; @@ -2171,7 +2178,7 @@ declare namespace ts { function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; + function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; function createClassifier(): Classifier; /** diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 8b0ef04f96e..498ddc37860 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -622,6 +622,7 @@ var ts; TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; TypeFlags[TypeFlags["ESSymbol"] = 16777216] = "ESSymbol"; TypeFlags[TypeFlags["ThisType"] = 33554432] = "ThisType"; + TypeFlags[TypeFlags["ObjectLiteralPatternWithComputedProperties"] = 67108864] = "ObjectLiteralPatternWithComputedProperties"; /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 16777343] = "Intrinsic"; /* @internal */ @@ -1530,12 +1531,7 @@ var ts; * List of supported extensions in order of file resolution precedence. */ ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - /** - * List of extensions that will be used to look for external modules. - * This list is kept separate from supportedExtensions to for cases when we'll allow to include .js files in compilation, - * but still would like to load only TypeScript files as modules - */ - ts.moduleFileExtensions = ts.supportedExtensions; + ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); function isSupportedSourceFileName(fileName) { if (!fileName) { return false; @@ -1586,17 +1582,16 @@ var ts; } function Signature(checker) { } + function Node(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0 /* None */; + this.parent = undefined; + } ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0 /* None */; - this.parent = undefined; - } - Node.prototype = { kind: kind }; - return Node; - }, + getNodeConstructor: function () { return Node; }, + getSourceFileConstructor: function () { return Node; }, getSymbolConstructor: function () { return Symbol; }, getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } @@ -1913,7 +1908,16 @@ var ts; if (writeByteOrderMark) { data = "\uFEFF" + data; } - _fs.writeFileSync(fileName, data, "utf8"); + var fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync(fd, data, undefined, "utf8"); + } + finally { + if (fd !== undefined) { + _fs.closeSync(fd); + } + } } function getCanonicalPath(path) { return useCaseSensitiveFileNames ? path.toLowerCase() : path; @@ -2614,6 +2618,7 @@ var ts; Disallow_inconsistently_cased_references_to_the_same_file: { code: 6078, category: ts.DiagnosticCategory.Message, key: "Disallow_inconsistently_cased_references_to_the_same_file_6078", message: "Disallow inconsistently-cased references to the same file." }, Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, + Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -3173,7 +3178,7 @@ var ts; function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; - while (true) { + while (pos < text.length) { var ch = text.charCodeAt(pos); switch (ch) { case 13 /* carriageReturn */: @@ -3242,6 +3247,7 @@ var ts; } return result; } + return result; } function getLeadingCommentRanges(text, pos) { return getCommentRanges(text, pos, /*trailing*/ false); @@ -3343,7 +3349,7 @@ var ts; error(ts.Diagnostics.Digit_expected); } } - return +(text.substring(start, end)); + return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -3770,7 +3776,7 @@ var ts; return pos++, token = 36 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { @@ -3873,7 +3879,7 @@ var ts; case 55 /* _7 */: case 56 /* _8 */: case 57 /* _9 */: - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; case 58 /* colon */: return pos++, token = 54 /* ColonToken */; @@ -4177,1321 +4183,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - ts.bindTime = 0; - (function (ModuleInstanceState) { - ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); - var ModuleInstanceState = ts.ModuleInstanceState; - var Reachability; - (function (Reachability) { - Reachability[Reachability["Unintialized"] = 1] = "Unintialized"; - Reachability[Reachability["Reachable"] = 2] = "Reachable"; - Reachability[Reachability["Unreachable"] = 4] = "Unreachable"; - Reachability[Reachability["ReportedUnreachable"] = 8] = "ReportedUnreachable"; - })(Reachability || (Reachability = {})); - function or(state1, state2) { - return (state1 | state2) & 2 /* Reachable */ - ? 2 /* Reachable */ - : (state1 & state2) & 8 /* ReportedUnreachable */ - ? 8 /* ReportedUnreachable */ - : 4 /* Unreachable */; - } - function getModuleInstanceState(node) { - // A module is uninstantiated if it contains only - // 1. interface declarations, type alias declarations - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { - return 0 /* NonInstantiated */; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2 /* ConstEnumOnly */; - } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { - return 0 /* NonInstantiated */; - } - else if (node.kind === 219 /* ModuleBlock */) { - var state = 0 /* NonInstantiated */; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0 /* NonInstantiated */: - // child is non-instantiated - continue searching - return false; - case 2 /* ConstEnumOnly */: - // child is const enum only - record state and continue searching - state = 2 /* ConstEnumOnly */; - return false; - case 1 /* Instantiated */: - // child is instantiated - record state and stop - state = 1 /* Instantiated */; - return true; - } - }); - return state; - } - else if (node.kind === 218 /* ModuleDeclaration */) { - return getModuleInstanceState(node.body); - } - else { - return 1 /* Instantiated */; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - var ContainerFlags; - (function (ContainerFlags) { - // The current node is not a container, and no container manipulation should happen before - // recursing into it. - ContainerFlags[ContainerFlags["None"] = 0] = "None"; - // The current node is a container. It should be set as the current container (and block- - // container) before recursing into it. The current node does not have locals. Examples: - // - // Classes, ObjectLiterals, TypeLiterals, Interfaces... - ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; - // The current node is a block-scoped-container. It should be set as the current block- - // container before recursing into it. Examples: - // - // Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements... - ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; - ContainerFlags[ContainerFlags["HasLocals"] = 4] = "HasLocals"; - // If the current node is a container that also container that also contains locals. Examples: - // - // Functions, Methods, Modules, Source-files. - ContainerFlags[ContainerFlags["IsContainerWithLocals"] = 5] = "IsContainerWithLocals"; - })(ContainerFlags || (ContainerFlags = {})); - var binder = createBinder(); - function bindSourceFile(file, options) { - var start = new Date().getTime(); - binder(file, options); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function createBinder() { - var file; - var options; - var parent; - var container; - var blockScopeContainer; - var lastContainer; - var seenThisKeyword; - // state used by reachability checks - var hasExplicitReturn; - var currentReachabilityState; - var labelStack; - var labelIndexMap; - var implicitLabels; - // If this file is an external module, then it is automatically in strict-mode according to - // ES6. If it is not an external module, then we'll determine if it is in strict mode or - // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). - var inStrictMode; - var symbolCount = 0; - var Symbol; - var classifiableNames; - function bindSourceFile(f, opts) { - file = f; - options = opts; - inStrictMode = !!file.externalModuleIndicator; - classifiableNames = {}; - Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - bind(file); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; - } - parent = undefined; - container = undefined; - blockScopeContainer = undefined; - lastContainer = undefined; - seenThisKeyword = false; - hasExplicitReturn = false; - labelStack = undefined; - labelIndexMap = undefined; - implicitLabels = undefined; - } - return bindSourceFile; - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolFlags) { - symbol.flags |= symbolFlags; - node.symbol = symbol; - if (!symbol.declarations) { - symbol.declarations = []; - } - symbol.declarations.push(node); - if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) { - symbol.exports = {}; - } - if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { - symbol.members = {}; - } - if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; - } - } - // Should not be called on a declaration with a computed property name, - // unless it is a well known Symbol. - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { - return "\"" + node.name.text + "\""; - } - if (node.name.kind === 136 /* ComputedPropertyName */) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 144 /* Constructor */: - return "__constructor"; - case 152 /* FunctionType */: - case 147 /* CallSignature */: - return "__call"; - case 153 /* ConstructorType */: - case 148 /* ConstructSignature */: - return "__new"; - case 149 /* IndexSignature */: - return "__index"; - case 228 /* ExportDeclaration */: - return "__export"; - case 227 /* ExportAssignment */: - return node.isExportEquals ? "export=" : "default"; - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: - return node.flags & 512 /* Default */ ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - /** - * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. - * @param symbolTable - The symbol table which node will be added to. - * @param parent - node's parent declaration. - * @param node - The declaration to be added to the symbol table - * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.) - * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations. - */ - function declareSymbol(symbolTable, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - var isDefaultExport = node.flags & 512 /* Default */; - // The exported symbol for an export default function/class node is always named "default" - var name = isDefaultExport && parent ? "default" : getDeclarationName(node); - var symbol; - if (name !== undefined) { - // Check and see if the symbol table already has a symbol with this name. If not, - // create a new symbol with this name and add it to the table. Note that we don't - // give the new symbol any flags *yet*. This ensures that it will not conflict - // with the 'excludes' flags we pass in. - // - // If we do get an existing symbol, see if it conflicts with the new symbol we're - // creating. For example, a 'var' symbol and a 'class' symbol will conflict within - // the same symbol table. If we have a conflict, report the issue on each - // declaration we have for this symbol, and then create a new symbol for this - // declaration. - // - // If we created a new symbol, either because we didn't have a symbol with this name - // in the symbol table, or we conflicted with an existing symbol, then just add this - // node as the sole declaration of the new symbol. - // - // Otherwise, we'll be merging into a compatible existing symbol (for example when - // you have multiple 'vars' with the same name in the same container). In this case - // just add this node into the declarations list of the symbol. - symbol = ts.hasProperty(symbolTable, name) - ? symbolTable[name] - : (symbolTable[name] = createSymbol(0 /* None */, name)); - if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; - } - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - // Report errors every position with duplicate declaration - // Report errors on previous encountered declarations - var message = symbol.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.flags & 512 /* Default */) { - message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; - } - }); - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0 /* None */, name); - } - } - else { - symbol = createSymbol(0 /* None */, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - return symbol; - } - function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; - if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - else { - // 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. - if (hasExportModifier || container.flags & 131072 /* ExportContext */) { - var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | - (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | - (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - node.localSymbol = local; - return local; - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - } - // All container nodes are kept on a linked list in declaration order. This list is used by - // the getLocalNameOfContainer function in the type checker to validate that the local name - // used for a container is unique. - function bindChildren(node) { - // Before we recurse into a node's chilren, we first save the existing parent, container - // and block-container. Then after we pop out of processing the children, we restore - // these saved values. - var saveParent = parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - // This node will now be set as the parent of all of its children as we recurse into them. - parent = node; - // Depending on what kind of node this is, we may have to adjust the current container - // and block-container. If the current node is a container, then it is automatically - // considered the current block-container as well. Also, for containers that we know - // may contain locals, we proactively initialize the .locals field. We do this because - // it's highly likely that the .locals will be needed to place some child in (for example, - // a parameter, or variable declaration). - // - // However, we do not proactively create the .locals for block-containers because it's - // totally normal and common for block-containers to never actually have a block-scoped - // variable in them. We don't want to end up allocating an object for every 'block' we - // run into when most of them won't be necessary. - // - // Finally, if this is a block-container, then we clear out any existing .locals object - // it may contain within it. This happens in incremental scenarios. Because we can be - // reusing a node from a previous compilation, that node may have had 'locals' created - // for it. We must clear this so we don't accidently move any stale data forward from - // a previous compilation. - var containerFlags = getContainerFlags(node); - if (containerFlags & 1 /* IsContainer */) { - container = blockScopeContainer = node; - if (containerFlags & 4 /* HasLocals */) { - container.locals = {}; - } - addToContainerChain(container); - } - else if (containerFlags & 2 /* IsBlockScopedContainer */) { - blockScopeContainer = node; - blockScopeContainer.locals = undefined; - } - var savedReachabilityState; - var savedLabelStack; - var savedLabels; - var savedImplicitLabels; - var savedHasExplicitReturn; - var kind = node.kind; - var flags = node.flags; - // reset all reachability check related flags on node (for incremental scenarios) - flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 215 /* InterfaceDeclaration */) { - seenThisKeyword = false; - } - var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); - if (saveState) { - savedReachabilityState = currentReachabilityState; - savedLabelStack = labelStack; - savedLabels = labelIndexMap; - savedImplicitLabels = implicitLabels; - savedHasExplicitReturn = hasExplicitReturn; - currentReachabilityState = 2 /* Reachable */; - hasExplicitReturn = false; - labelStack = labelIndexMap = implicitLabels = undefined; - } - bindReachableStatement(node); - if (currentReachabilityState === 2 /* Reachable */ && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { - flags |= 524288 /* HasImplicitReturn */; - if (hasExplicitReturn) { - flags |= 1048576 /* HasExplicitReturn */; - } - } - if (kind === 215 /* InterfaceDeclaration */) { - flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; - } - node.flags = flags; - if (saveState) { - hasExplicitReturn = savedHasExplicitReturn; - currentReachabilityState = savedReachabilityState; - labelStack = savedLabelStack; - labelIndexMap = savedLabels; - implicitLabels = savedImplicitLabels; - } - container = saveContainer; - parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - /** - * Returns true if node and its subnodes were successfully traversed. - * Returning false means that node was not examined and caller needs to dive into the node himself. - */ - function bindReachableStatement(node) { - if (checkUnreachable(node)) { - ts.forEachChild(node, bind); - return; - } - switch (node.kind) { - case 198 /* WhileStatement */: - bindWhileStatement(node); - break; - case 197 /* DoStatement */: - bindDoStatement(node); - break; - case 199 /* ForStatement */: - bindForStatement(node); - break; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - bindForInOrForOfStatement(node); - break; - case 196 /* IfStatement */: - bindIfStatement(node); - break; - case 204 /* ReturnStatement */: - case 208 /* ThrowStatement */: - bindReturnOrThrow(node); - break; - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - bindBreakOrContinueStatement(node); - break; - case 209 /* TryStatement */: - bindTryStatement(node); - break; - case 206 /* SwitchStatement */: - bindSwitchStatement(node); - break; - case 220 /* CaseBlock */: - bindCaseBlock(node); - break; - case 207 /* LabeledStatement */: - bindLabeledStatement(node); - break; - default: - ts.forEachChild(node, bind); - break; - } - } - function bindWhileStatement(n) { - var preWhileState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - var postWhileState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - // bind expressions (don't affect reachability) - bind(n.expression); - currentReachabilityState = preWhileState; - var postWhileLabel = pushImplicitLabel(); - bind(n.statement); - popImplicitLabel(postWhileLabel, postWhileState); - } - function bindDoStatement(n) { - var preDoState = currentReachabilityState; - var postDoLabel = pushImplicitLabel(); - bind(n.statement); - var postDoState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : preDoState; - popImplicitLabel(postDoLabel, postDoState); - // bind expressions (don't affect reachability) - bind(n.expression); - } - function bindForStatement(n) { - var preForState = currentReachabilityState; - var postForLabel = pushImplicitLabel(); - // bind expressions (don't affect reachability) - bind(n.initializer); - bind(n.condition); - bind(n.incrementor); - bind(n.statement); - // for statement is considered infinite when it condition is either omitted or is true keyword - // - for(..;;..) - // - for(..;true;..) - var isInfiniteLoop = (!n.condition || n.condition.kind === 99 /* TrueKeyword */); - var postForState = isInfiniteLoop ? 4 /* Unreachable */ : preForState; - popImplicitLabel(postForLabel, postForState); - } - function bindForInOrForOfStatement(n) { - var preStatementState = currentReachabilityState; - var postStatementLabel = pushImplicitLabel(); - // bind expressions (don't affect reachability) - bind(n.initializer); - bind(n.expression); - bind(n.statement); - popImplicitLabel(postStatementLabel, preStatementState); - } - function bindIfStatement(n) { - // denotes reachability state when entering 'thenStatement' part of the if statement: - // i.e. if condition is false then thenStatement is unreachable - var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - // denotes reachability state when entering 'elseStatement': - // i.e. if condition is true then elseStatement is unreachable - var ifFalseState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; - currentReachabilityState = ifTrueState; - // bind expression (don't affect reachability) - bind(n.expression); - bind(n.thenStatement); - if (n.elseStatement) { - var preElseState = currentReachabilityState; - currentReachabilityState = ifFalseState; - bind(n.elseStatement); - currentReachabilityState = or(currentReachabilityState, preElseState); - } - else { - currentReachabilityState = or(currentReachabilityState, ifFalseState); - } - } - function bindReturnOrThrow(n) { - // bind expression (don't affect reachability) - bind(n.expression); - if (n.kind === 204 /* ReturnStatement */) { - hasExplicitReturn = true; - } - currentReachabilityState = 4 /* Unreachable */; - } - function bindBreakOrContinueStatement(n) { - // call bind on label (don't affect reachability) - bind(n.label); - // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); - if (isValidJump) { - currentReachabilityState = 4 /* Unreachable */; - } - } - function bindTryStatement(n) { - // catch\finally blocks has the same reachability as try block - var preTryState = currentReachabilityState; - bind(n.tryBlock); - var postTryState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.catchClause); - var postCatchState = currentReachabilityState; - currentReachabilityState = preTryState; - bind(n.finallyBlock); - // post catch/finally state is reachable if - // - post try state is reachable - control flow can fall out of try block - // - post catch state is reachable - control flow can fall out of catch block - currentReachabilityState = or(postTryState, postCatchState); - } - function bindSwitchStatement(n) { - var preSwitchState = currentReachabilityState; - var postSwitchLabel = pushImplicitLabel(); - // bind expression (don't affect reachability) - bind(n.expression); - bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); - // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case - var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; - popImplicitLabel(postSwitchLabel, postSwitchState); - } - function bindCaseBlock(n) { - var startState = currentReachabilityState; - for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { - var clause = _a[_i]; - currentReachabilityState = startState; - bind(clause); - if (clause.statements.length && currentReachabilityState === 2 /* Reachable */ && options.noFallthroughCasesInSwitch) { - errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); - } - } - } - function bindLabeledStatement(n) { - // call bind on label (don't affect reachability) - bind(n.label); - var ok = pushNamedLabel(n.label); - bind(n.statement); - if (ok) { - popNamedLabel(n.label, currentReachabilityState); - } - } - function getContainerFlags(node) { - switch (node.kind) { - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - return 1 /* IsContainer */; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 218 /* ModuleDeclaration */: - case 248 /* SourceFile */: - case 216 /* TypeAliasDeclaration */: - return 5 /* IsContainerWithLocals */; - case 244 /* CatchClause */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 220 /* CaseBlock */: - return 2 /* IsBlockScopedContainer */; - case 192 /* Block */: - // do not treat blocks directly inside a function as a block-scoped-container. - // Locals that reside in this block should go to the function locals. Othewise 'x' - // would not appear to be a redeclaration of a block scoped local in the following - // example: - // - // function foo() { - // var x; - // let x; - // } - // - // If we placed 'var x' into the function locals and 'let x' into the locals of - // the block, then there would be no collision. - // - // By not creating a new block-scoped-container here, we ensure that both 'var x' - // and 'let x' go into the Function-container's locals, and we do get a collision - // conflict. - return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; - } - return 0 /* None */; - } - function addToContainerChain(next) { - if (lastContainer) { - lastContainer.nextContainer = next; - } - lastContainer = next; - } - function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { - // Just call this directly so that the return type of this function stays "void". - declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); - } - function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { - switch (container.kind) { - // Modules, source files, and classes need specialized handling for how their - // members are declared (for example, a member of a class will go into a specific - // symbol table depending on if it is static or not). We defer to specialized - // handlers to take care of declaring these child members. - case 218 /* ModuleDeclaration */: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248 /* SourceFile */: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 217 /* EnumDeclaration */: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - case 215 /* InterfaceDeclaration */: - // Interface/Object-types always have their children added to the 'members' of - // their container. They are only accessible through an instance of their - // container, and are never in scope otherwise (even inside the body of the - // object / type / interface declaring them). An exception is type parameters, - // which are in scope without qualification (similar to 'locals'). - return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 216 /* TypeAliasDeclaration */: - // All the children of these container types are never visible through another - // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, - // they're only accessed 'lexically' (i.e. from code that exists underneath - // their container in the tree. To accomplish this, we simply add their declared - // symbol to the 'locals' of the container. These symbols can then be found as - // the type checker walks up the containers, checking them for matching names. - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function declareClassMember(node, symbolFlags, symbolExcludes) { - return node.flags & 64 /* Static */ - ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) - : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - } - function declareSourceFileMember(node, symbolFlags, symbolExcludes) { - return ts.isExternalModule(file) - ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); - } - function hasExportDeclarations(node) { - var body = node.kind === 248 /* SourceFile */ ? node : node.body; - if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { - for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { - var stat = _a[_i]; - if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { - return true; - } - } - } - return false; - } - function setExportContextFlag(node) { - // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular - // declarations with export modifiers) is an export context in which declarations are implicitly exported. - if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 131072 /* ExportContext */; - } - else { - node.flags &= ~131072 /* ExportContext */; - } - } - function bindModuleDeclaration(node) { - setExportContextFlag(node); - if (node.name.kind === 9 /* StringLiteral */) { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - } - else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { - // if module was already merged with some function, class or non-const enum - // treat is a non-const-enum-only - node.symbol.constEnumOnlyModule = false; - } - else { - var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; - if (node.symbol.constEnumOnlyModule === undefined) { - // non-merged case - use the current state - node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; - } - else { - // merged case: module is const enum only if all its pieces are non-instantiated or const enum - node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; - } - } - } - } - } - function bindFunctionOrConstructorType(node) { - // For a given function symbol "<...>(...) => T" we want to generate a symbol identical - // to the one we would get for: { <...>(...): T } - // - // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable - // from an actual type literal symbol you would have gotten had you used the long form. - var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072 /* Signature */); - var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); - typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); - var _a; - } - function bindObjectLiteralExpression(node) { - var ElementKind; - (function (ElementKind) { - ElementKind[ElementKind["Property"] = 1] = "Property"; - ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; - })(ElementKind || (ElementKind = {})); - if (inStrictMode) { - var seen = {}; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; - if (prop.name.kind !== 69 /* Identifier */) { - continue; - } - var identifier = prop.name; - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ - ? 1 /* Property */ - : 2 /* Accessor */; - var existingKind = seen[identifier.text]; - if (!existingKind) { - seen[identifier.text] = currentKind; - continue; - } - if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { - var span = ts.getErrorSpanForNode(file, identifier); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); - } - } - } - return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); - } - function bindAnonymousDeclaration(node, symbolFlags, name) { - var symbol = createSymbol(symbolFlags, name); - addDeclarationToSymbol(symbol, node, symbolFlags); - } - function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { - switch (blockScopeContainer.kind) { - case 218 /* ModuleDeclaration */: - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - case 248 /* SourceFile */: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - } - // fall through. - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - addToContainerChain(blockScopeContainer); - } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); - } - // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized - // check for reserved words used as identifiers in strict mode code. - function checkStrictModeIdentifier(node) { - if (inStrictMode && - node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ && - node.originalKeywordKind <= 114 /* LastFutureReservedWord */ && - !ts.isIdentifierName(node)) { - // Report error only if there are no parse errors in file - if (!file.parseDiagnostics.length) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); - } - } - } - function getStrictModeIdentifierMessage(node) { - // Provide specialized messages to help the user understand why we think they're in - // strict mode. - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; - } - function checkStrictModeBinaryExpression(node) { - if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - checkStrictModeEvalOrArguments(node, node.left); - } - } - function checkStrictModeCatchClause(node) { - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - if (inStrictMode && node.variableDeclaration) { - checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); - } - } - function checkStrictModeDeleteExpression(node) { - // Grammar checking - if (inStrictMode && node.expression.kind === 69 /* Identifier */) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - var span = ts.getErrorSpanForNode(file, node.expression); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); - } - } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 /* Identifier */ && - (node.text === "eval" || node.text === "arguments"); - } - function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 69 /* Identifier */) { - var identifier = name; - if (isEvalOrArgumentsIdentifier(identifier)) { - // We check first if the name is inside class declaration or class expression; if so give explicit message - // otherwise report generic error message. - var span = ts.getErrorSpanForNode(file, name); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); - } - } - } - function getStrictModeEvalOrArgumentsMessage(node) { - // Provide specialized messages to help the user understand why we think they're in - // strict mode. - if (ts.getContainingClass(node)) { - return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; - } - if (file.externalModuleIndicator) { - return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; - } - return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; - } - function checkStrictModeFunctionName(node) { - if (inStrictMode) { - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) - checkStrictModeEvalOrArguments(node, node.name); - } - } - function checkStrictModeNumericLiteral(node) { - if (inStrictMode && node.flags & 32768 /* OctalLiteral */) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); - } - } - function checkStrictModePostfixUnaryExpression(node) { - // Grammar checking - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - function checkStrictModePrefixUnaryExpression(node) { - // Grammar checking - if (inStrictMode) { - if (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) { - checkStrictModeEvalOrArguments(node, node.operand); - } - } - } - function checkStrictModeWithStatement(node) { - // Grammar checking for withStatement - if (inStrictMode) { - errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - function errorOnFirstToken(node, message, arg0, arg1, arg2) { - var span = ts.getSpanOfTokenAtPosition(file, node.pos); - file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - if (!node) { - return; - } - node.parent = parent; - var savedInStrictMode = inStrictMode; - if (!savedInStrictMode) { - updateStrictMode(node); - } - // First we bind declaration nodes to a symbol if possible. We'll both create a symbol - // and then potentially add the symbol to an appropriate symbol table. Possible - // destination symbol tables are: - // - // 1) The 'exports' table of the current container's symbol. - // 2) The 'members' table of the current container's symbol. - // 3) The 'locals' table of the current container. - // - // However, not all symbols will end up in any of these tables. 'Anonymous' symbols - // (like TypeLiterals for example) will not be put in any table. - bindWorker(node); - // Then we recurse into the children of the node to bind them as well. For certain - // symbols we do specialized work when we recurse. For example, we'll keep track of - // the current 'container' node when it changes. This helps us know which symbol table - // a local should go into for example. - bindChildren(node); - inStrictMode = savedInStrictMode; - } - function updateStrictMode(node) { - switch (node.kind) { - case 248 /* SourceFile */: - case 219 /* ModuleBlock */: - updateStrictModeStatementList(node.statements); - return; - case 192 /* Block */: - if (ts.isFunctionLike(node.parent)) { - updateStrictModeStatementList(node.statements); - } - return; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - // All classes are automatically in strict mode in ES6. - inStrictMode = true; - return; - } - } - function updateStrictModeStatementList(statements) { - for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { - var statement = statements_1[_i]; - if (!ts.isPrologueDirective(statement)) { - return; - } - if (isUseStrictPrologueDirective(statement)) { - inStrictMode = true; - return; - } - } - } - /// Should be called only on prologue directives (isPrologueDirective(node) should be true) - function isUseStrictPrologueDirective(node) { - var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); - // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the - // string to contain unicode escapes (as per ES5). - return nodeText === "\"use strict\"" || nodeText === "'use strict'"; - } - function bindWorker(node) { - switch (node.kind) { - case 69 /* Identifier */: - return checkStrictModeIdentifier(node); - case 181 /* BinaryExpression */: - return checkStrictModeBinaryExpression(node); - case 244 /* CatchClause */: - return checkStrictModeCatchClause(node); - case 175 /* DeleteExpression */: - return checkStrictModeDeleteExpression(node); - case 8 /* NumericLiteral */: - return checkStrictModeNumericLiteral(node); - case 180 /* PostfixUnaryExpression */: - return checkStrictModePostfixUnaryExpression(node); - case 179 /* PrefixUnaryExpression */: - return checkStrictModePrefixUnaryExpression(node); - case 205 /* WithStatement */: - return checkStrictModeWithStatement(node); - case 97 /* ThisKeyword */: - seenThisKeyword = true; - return; - case 137 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); - case 138 /* Parameter */: - return bindParameter(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: - return bindVariableDeclarationOrBindingElement(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 247 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - // If this is an ObjectLiteralExpression method, then it sits in the same space - // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes - // so that it will conflict with any other object literal members with the same - // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 213 /* FunctionDeclaration */: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); - case 144 /* Constructor */: - return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 145 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 146 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - return bindFunctionOrConstructorType(node); - case 155 /* TypeLiteral */: - return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 165 /* ObjectLiteralExpression */: - return bindObjectLiteralExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - return bindClassLikeDeclaration(node); - case 215 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 216 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 217 /* EnumDeclaration */: - return bindEnumDeclaration(node); - case 218 /* ModuleDeclaration */: - return bindModuleDeclaration(node); - case 221 /* ImportEqualsDeclaration */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: - return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 223 /* ImportClause */: - return bindImportClause(node); - case 228 /* ExportDeclaration */: - return bindExportDeclaration(node); - case 227 /* ExportAssignment */: - return bindExportAssignment(node); - case 248 /* SourceFile */: - return bindSourceFileIfExternalModule(); - } - } - function bindSourceFileIfExternalModule() { - setExportContextFlag(file); - if (ts.isExternalModule(file)) { - bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); - } - } - function bindExportAssignment(node) { - if (!container.symbol || !container.symbol.exports) { - // Export assignment in some sort of block construct - bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); - } - else if (node.expression.kind === 69 /* Identifier */) { - // An export default clause with an identifier exports all meanings of that identifier - declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - else { - // An export default clause with an expression exports a value - declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - } - function bindExportDeclaration(node) { - if (!container.symbol || !container.symbol.exports) { - // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); - } - else if (!node.exportClause) { - // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); - } - } - function bindImportClause(node) { - if (node.name) { - declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - } - } - function bindClassLikeDeclaration(node) { - if (node.kind === 214 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); - } - else { - var bindingName = node.name ? node.name.text : "__class"; - bindAnonymousDeclaration(node, 32 /* Class */, bindingName); - // Add name of class expression into the map for semantic classifier - if (node.name) { - classifiableNames[node.name.text] = node.name.text; - } - } - var symbol = node.symbol; - // 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'. - // - // Note: we check for this here because this class may be merging into a module. The - // module might have an exported variable called 'prototype'. We can't allow that as - // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - function bindEnumDeclaration(node) { - return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) - : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); - } - function bindVariableDeclarationOrBindingElement(node) { - if (inStrictMode) { - checkStrictModeEvalOrArguments(node, node.name); - } - if (!ts.isBindingPattern(node.name)) { - if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else if (ts.isParameterDeclaration(node)) { - // It is safe to walk up parent chain to find whether the node is a destructing parameter declaration - // because its parent chain has already been set up, since parents are set before descending into children. - // - // If node is a binding element in parameter declaration, we need to use ParameterExcludes. - // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration - // For example: - // function foo([a,a]) {} // Duplicate Identifier error - // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter - // // which correctly set excluded symbols - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); - } - } - } - function bindParameter(node) { - if (inStrictMode) { - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) - checkStrictModeEvalOrArguments(node, node.name); - } - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node)); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - // If this is a property-parameter, then also declare the property symbol into the - // containing class. - if (node.flags & 56 /* AccessibilityModifier */ && - node.parent.kind === 144 /* Constructor */ && - ts.isClassLike(node.parent.parent)) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - return ts.hasDynamicName(node) - ? bindAnonymousDeclaration(node, symbolFlags, "__computed") - : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - // reachability checks - function pushNamedLabel(name) { - initializeReachabilityStateIfNecessary(); - if (ts.hasProperty(labelIndexMap, name.text)) { - return false; - } - labelIndexMap[name.text] = labelStack.push(1 /* Unintialized */) - 1; - return true; - } - function pushImplicitLabel() { - initializeReachabilityStateIfNecessary(); - var index = labelStack.push(1 /* Unintialized */) - 1; - implicitLabels.push(index); - return index; - } - function popNamedLabel(label, outerState) { - var index = labelIndexMap[label.text]; - ts.Debug.assert(index !== undefined); - ts.Debug.assert(labelStack.length == index + 1); - labelIndexMap[label.text] = undefined; - setCurrentStateAtLabel(labelStack.pop(), outerState, label); - } - function popImplicitLabel(implicitLabelIndex, outerState) { - if (labelStack.length !== implicitLabelIndex + 1) { - ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); - } - var i = implicitLabels.pop(); - if (implicitLabelIndex !== i) { - ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); - } - setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); - } - function setCurrentStateAtLabel(innerMergedState, outerState, label) { - if (innerMergedState === 1 /* Unintialized */) { - if (label && !options.allowUnusedLabels) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); - } - currentReachabilityState = outerState; - } - else { - currentReachabilityState = or(innerMergedState, outerState); - } - } - function jumpToLabel(label, outerState) { - initializeReachabilityStateIfNecessary(); - var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); - if (index === undefined) { - // reference to unknown label or - // break/continue used outside of loops - return false; - } - var stateAtLabel = labelStack[index]; - labelStack[index] = stateAtLabel === 1 /* Unintialized */ ? outerState : or(stateAtLabel, outerState); - return true; - } - function checkUnreachable(node) { - switch (currentReachabilityState) { - case 4 /* Unreachable */: - var reportError = - // report error on all statements - ts.isStatement(node) || - // report error on class declarations - node.kind === 214 /* ClassDeclaration */ || - // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || - // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); - if (reportError) { - currentReachabilityState = 8 /* ReportedUnreachable */; - // unreachable code is reported if - // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error - // so we should not report extras) AND - // - node is not variable statement OR - // - node is block scoped variable statement OR - // - node is not block scoped variable statement and at least one variable declaration has initializer - // Rationale: we don't want to report errors on non-initialized var's since they are hoisted - // On the other side we do want to report errors on non-initialized 'lets' because of TDZ - var reportUnreachableCode = !options.allowUnreachableCode && - !ts.isInAmbientContext(node) && - (node.kind !== 193 /* VariableStatement */ || - ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || - ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); - if (reportUnreachableCode) { - errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); - } - } - case 8 /* ReportedUnreachable */: - return true; - default: - return false; - } - function shouldReportErrorOnModuleDeclaration(node) { - var instanceState = getModuleInstanceState(node); - return instanceState === 1 /* Instantiated */ || (instanceState === 2 /* ConstEnumOnly */ && options.preserveConstEnums); - } - } - function initializeReachabilityStateIfNecessary() { - if (labelIndexMap) { - return; - } - currentReachabilityState = 2 /* Reachable */; - labelIndexMap = {}; - labelStack = []; - implicitLabels = []; - } - } -})(ts || (ts = {})); -/// /// /* @internal */ var ts; @@ -5812,6 +4503,10 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isDeclarationFile(file) { return (file.flags & 4096 /* DeclarationFile */) !== 0; } @@ -5865,19 +4560,27 @@ var ts; return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getLeadingCommentRangesOfNodeFromText(node, text) { + return ts.getLeadingCommentRanges(text, node.pos); + } + ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJsDocComments(node, sourceFileOfNode) { + return getJsDocCommentsFromText(node, sourceFileOfNode.text); + } + ts.getJsDocComments = getJsDocComments; + function getJsDocCommentsFromText(node, text) { var commentRanges = (node.kind === 138 /* Parameter */ || node.kind === 137 /* TypeParameter */) ? - ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : - getLeadingCommentRangesOfNode(node, sourceFileOfNode); + ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); function isJsDocComment(comment) { // True if the comment starts with '/**' but not if it is '/**/' - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } } - ts.getJsDocComments = getJsDocComments; + ts.getJsDocCommentsFromText = getJsDocCommentsFromText; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { @@ -6464,6 +5167,57 @@ var ts; return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 232 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJavaScript(file) { + return isInJavaScriptFile(file); + } + ts.isSourceFileJavaScript = isSourceFileJavaScript; + function isInJavaScriptFile(node) { + return node && !!(node.parserContextFlags & 32 /* JavaScriptFile */); + } + ts.isInJavaScriptFile = isInJavaScriptFile; + /** + * Returns true if the node is a CallExpression to the identifier 'require' with + * exactly one string literal argument. + * This function does not test if the node is in a JavaScript file or not. + */ + function isRequireCall(expression) { + // of the form 'require("name")' + return expression.kind === 168 /* CallExpression */ && + expression.expression.kind === 69 /* Identifier */ && + expression.expression.text === "require" && + expression.arguments.length === 1 && + expression.arguments[0].kind === 9 /* StringLiteral */; + } + ts.isRequireCall = isRequireCall; + /** + * Returns true if the node is an assignment to a property on the identifier 'exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + function isExportsPropertyAssignment(expression) { + // of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === 181 /* BinaryExpression */) && + (expression.operatorToken.kind === 56 /* EqualsToken */) && + (expression.left.kind === 166 /* PropertyAccessExpression */) && + (expression.left.expression.kind === 69 /* Identifier */) && + ((expression.left.expression).text === "exports"); + } + ts.isExportsPropertyAssignment = isExportsPropertyAssignment; + /** + * Returns true if the node is an assignment to the property access expression 'module.exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + function isModuleExportsAssignment(expression) { + // of the form 'module.exports = expr' where 'expr' is arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === 181 /* BinaryExpression */) && + (expression.operatorToken.kind === 56 /* EqualsToken */) && + (expression.left.kind === 166 /* PropertyAccessExpression */) && + (expression.left.expression.kind === 69 /* Identifier */) && + ((expression.left.expression).text === "module") && + (expression.left.name.text === "exports"); + } + ts.isModuleExportsAssignment = isModuleExportsAssignment; function getExternalModuleName(node) { if (node.kind === 222 /* ImportDeclaration */) { return node.moduleSpecifier; @@ -6791,8 +5545,8 @@ var ts; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -6834,6 +5588,10 @@ var ts; return isFunctionLike(node) && (node.flags & 256 /* Async */) !== 0 && !isAccessor(node); } ts.isAsyncFunctionLike = isAsyncFunctionLike; + function isStringOrNumericLiteral(kind) { + return kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */; + } + ts.isStringOrNumericLiteral = isStringOrNumericLiteral; /** * A declaration has a dynamic name if both of the following are true: * 1. The declaration has a computed property name @@ -6842,11 +5600,15 @@ var ts; * Symbol. */ function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 136 /* ComputedPropertyName */ && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && isDynamicName(declaration.name); } ts.hasDynamicName = hasDynamicName; + function isDynamicName(name) { + return name.kind === 136 /* ComputedPropertyName */ && + !isStringOrNumericLiteral(name.expression.kind) && + !isWellKnownSymbolSyntactically(name.expression); + } + ts.isDynamicName = isDynamicName; /** * Checks if the expression is of the form: * Symbol.name @@ -7087,11 +5849,11 @@ var ts; } ts.getIndentSize = getIndentSize; function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; + var output; + var indent; + var lineStart; + var lineCount; + var linePos; function write(s) { if (s && s.length) { if (lineStart) { @@ -7101,6 +5863,13 @@ var ts; output += s; } } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } function rawWrite(s) { if (s !== undefined) { if (lineStart) { @@ -7127,9 +5896,10 @@ var ts; lineStart = true; } } - function writeTextOfNode(sourceFile, node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + function writeTextOfNode(text, node) { + write(getTextOfNodeFromSourceText(text, node)); } + reset(); return { write: write, rawWrite: rawWrite, @@ -7142,10 +5912,20 @@ var ts; getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + getText: function () { return output; }, + reset: reset }; } ts.createTextWriter = createTextWriter; + /** + * Resolves a local path to a path which is absolute to the base of the emit + */ + function getExternalModuleNameFromPath(host, fileName) { + var dir = host.getCurrentDirectory(); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, /*isAbsolutePathAnUrl*/ false); + return ts.removeFileExtension(relativePath); + } + ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); var emitOutputFilePathWithoutExtension; @@ -7174,6 +5954,10 @@ var ts; return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } ts.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts.computeLineAndCharacterOfPosition(lineMap, pos).line; + } + ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { if (member.kind === 144 /* Constructor */ && nodeIsPresent(member.body)) { @@ -7246,22 +6030,22 @@ var ts; }; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { // If the leading comments start on different line than the start of node, write new line if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + getLineOfLocalPositionFromLineMap(lineMap, node.pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { writer.writeLine(); } } ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { + function emitComments(text, lineMap, writer, comments, trailingSeparator, newLine, writeComment) { var emitLeadingSpace = !trailingSeparator; ts.forEach(comments, function (comment) { if (emitLeadingSpace) { writer.write(" "); emitLeadingSpace = false; } - writeComment(currentSourceFile, writer, comment, newLine); + writeComment(text, lineMap, writer, comment, newLine); if (comment.hasTrailingNewLine) { writer.writeLine(); } @@ -7279,7 +6063,7 @@ var ts; * Detached comment is a comment at the top of file or function body that is separated from * the next statement by space. */ - function emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, removeComments) { + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { var leadingComments; var currentDetachedCommentInfo; if (removeComments) { @@ -7289,12 +6073,12 @@ var ts; // // var x = 10; if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); } } else { // removeComments is false, just get detached as normal and bypass the process to filter comment - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + leadingComments = ts.getLeadingCommentRanges(text, node.pos); } if (leadingComments) { var detachedComments = []; @@ -7302,8 +6086,8 @@ var ts; for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { var comment = leadingComments_1[_i]; if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This // comment is not part of the copyright comments. Return what we have so @@ -7318,36 +6102,36 @@ var ts; // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); - var nodeLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos)); if (nodeLine >= lastCommentLine + 2) { // Valid detachedComments - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments(text, lineMap, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; } } } return currentDetachedCommentInfo; function isPinnedComment(comment) { - return currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; } } ts.emitDetachedComments = emitDetachedComments; - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; + function writeCommentRange(text, lineMap, writer, comment, newLine) { + if (text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { + var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, comment.pos); + var lineCount = lineMap.length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : getStartPositionOfLine(currentLine + 1, currentSourceFile); + ? text.length + 1 + : lineMap[currentLine + 1]; if (pos !== comment.pos) { // If we are not emitting first line, we need to write the spaces to adjust the alignment if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], comment.pos); } // These are number of spaces writer is going to write at current indent var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); @@ -7365,7 +6149,7 @@ var ts; // More right indented comment */ --4 = 8 - 4 + 11 // class c { } // } - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); @@ -7383,45 +6167,45 @@ var ts; } } // Write the comment line text - writeTrimmedCurrentLine(pos, nextLineStart); + writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart); pos = nextLineStart; } } else { // Single line comment of style //.... - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ""); - if (currentLineText) { - // trimmed forward and ending spaces text - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - return currentLineIndent; + writer.write(text.substring(comment.pos, comment.end)); } } ts.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, comment, writer, newLine, pos, nextLineStart) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, ""); + if (currentLineText) { + // trimmed forward and ending spaces text + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + // Empty string - make sure we write empty line + writer.writeLiteral(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts.isWhiteSpace(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9 /* tab */) { + // Tabs = TabSize = indent size and go to next tabStop + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + // Single space + currentLineIndent++; + } + } + return currentLineIndent; + } function modifierToFlag(token) { switch (token) { case 113 /* StaticKeyword */: return 64 /* Static */; @@ -7517,14 +6301,14 @@ var ts; return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 512 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function isJavaScript(fileName) { - return ts.fileExtensionIs(fileName, ".js"); + function hasJavaScriptFileExtension(fileName) { + return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isJavaScript = isJavaScript; - function isTsx(fileName) { - return ts.fileExtensionIs(fileName, ".tsx"); + ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; + function allowsJsxExpressions(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); } - ts.isTsx = isTsx; + ts.allowsJsxExpressions = allowsJsxExpressions; /** * Replace each instance of non-ascii characters by one, two, three, or four escape sequences * representing the UTF-8 encoding of the character, and return the expanded char code list. @@ -7835,18 +6619,20 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; })(ts || (ts = {})); -/// /// +/// var ts; (function (ts) { - var nodeConstructors = new Array(272 /* Count */); /* @internal */ ts.parseTime = 0; - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; + var NodeConstructor; + var SourceFileConstructor; function createNode(kind, pos, end) { - return new (getNodeConstructor(kind))(pos, end); + if (kind === 248 /* SourceFile */) { + return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); + } + else { + return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, pos, end); + } } ts.createNode = createNode; function visitNode(cbNode, node) { @@ -8269,6 +7055,9 @@ var ts; // up by avoiding the cost of creating/compiling scanners over and over again. var scanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ true); var disallowInAndDecoratorContext = 1 /* DisallowIn */ | 4 /* Decorator */; + // capture constructors in 'initializeState' to avoid null checks + var NodeConstructor; + var SourceFileConstructor; var sourceFile; var parseDiagnostics; var syntaxCursor; @@ -8354,13 +7143,16 @@ var ts; // attached to the EOF token. var parseErrorBeforeNextFinishedNode = false; function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); + var isJavaScriptFile = ts.hasJavaScriptFileExtension(fileName) || _sourceText.lastIndexOf("// @language=javascript", 0) === 0; + initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); clearState(); return result; } Parser.parseSourceFile = parseSourceFile; - function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor) { + function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { + NodeConstructor = ts.objectAllocator.getNodeConstructor(); + SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); sourceText = _sourceText; syntaxCursor = _syntaxCursor; parseDiagnostics = []; @@ -8368,13 +7160,13 @@ var ts; identifiers = {}; identifierCount = 0; nodeCount = 0; - contextFlags = ts.isJavaScript(fileName) ? 32 /* JavaScriptFile */ : 0 /* None */; + contextFlags = isJavaScriptFile ? 32 /* JavaScriptFile */ : 0 /* None */; parseErrorBeforeNextFinishedNode = false; // Initialize and prime the scanner before parsing the source elements. scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.isTsx(fileName) ? 1 /* JSX */ : 0 /* Standard */); + scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 /* JSX */ : 0 /* Standard */); } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. @@ -8389,6 +7181,9 @@ var ts; } function parseSourceFileWorker(fileName, languageVersion, setParentNodes) { sourceFile = createSourceFile(fileName, languageVersion); + if (contextFlags & 32 /* JavaScriptFile */) { + sourceFile.parserContextFlags = 32 /* JavaScriptFile */; + } // Prime the scanner. token = nextToken(); processReferenceComments(sourceFile); @@ -8406,7 +7201,7 @@ var ts; // If this is a javascript file, proactively see if we can get JSDoc comments for // relevant nodes in the file. We'll use these to provide typing informaion if they're // available. - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { addJSDocComments(); } return sourceFile; @@ -8461,15 +7256,16 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = createNode(248 /* SourceFile */, /*pos*/ 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; + // code from createNode is inlined here so createNode won't have to deal with special case of creating source files + // this is quite rare comparing to other nodes and createNode should be as fast as possible + var sourceFile = new SourceFileConstructor(248 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 /* DeclarationFile */ : 0; - sourceFile.languageVariant = ts.isTsx(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; + sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; return sourceFile; } function setContextFlag(val, flag) { @@ -8734,12 +7530,13 @@ var ts; return parseExpected(23 /* SemicolonToken */); } } + // note: this function creates only node function createNode(kind, pos) { nodeCount++; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(pos, pos); + return new NodeConstructor(kind, pos, pos); } function finishNode(node, end) { node.end = end === undefined ? scanner.getStartPos() : end; @@ -8904,7 +7701,7 @@ var ts; case 12 /* ObjectLiteralMembers */: return token === 19 /* OpenBracketToken */ || token === 37 /* AsteriskToken */ || isLiteralPropertyName(); case 9 /* ObjectBindingElements */: - return isLiteralPropertyName(); + return token === 19 /* OpenBracketToken */ || isLiteralPropertyName(); case 7 /* HeritageClauseElement */: // If we see { } then only consume it as an expression if it is followed by , or { // That way we won't consume the body of a class in its heritage clause. @@ -9584,9 +8381,7 @@ var ts; } function parseParameterType() { if (parseOptional(54 /* ColonToken */)) { - return token === 9 /* StringLiteral */ - ? parseLiteralNode(/*internName*/ true) - : parseType(); + return parseType(); } return undefined; } @@ -9917,6 +8712,8 @@ var ts; // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); + case 9 /* StringLiteral */: + return parseLiteralNode(/*internName*/ true); case 103 /* VoidKeyword */: case 97 /* ThisKeyword */: return parseTokenNode(); @@ -9946,6 +8743,7 @@ var ts; case 19 /* OpenBracketToken */: case 25 /* LessThanToken */: case 92 /* NewKeyword */: + case 9 /* StringLiteral */: return true; case 17 /* OpenParenToken */: // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, @@ -10362,7 +9160,7 @@ var ts; return 1 /* True */; } // This *could* be a parenthesized arrow function. - // Return Unknown to let the caller know. + // Return Unknown to const the caller know. return 2 /* Unknown */; } else { @@ -10448,7 +9246,7 @@ var ts; // user meant to supply a block. For example, if the user wrote: // // a => - // let v = 0; + // const v = 0; // } // // they may be missing an open brace. Check to see if that's the case so we can @@ -10664,7 +9462,6 @@ var ts; var unaryOperator = token; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { - var diagnostic; var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); if (simpleUnaryExpression.kind === 171 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); @@ -11868,7 +10665,6 @@ var ts; } function parseObjectBindingElement() { var node = createNode(163 /* BindingElement */); - // TODO(andersh): Handle computed properties var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -12691,7 +11487,7 @@ var ts; } JSDocParser.isJSDocType = isJSDocType; function parseJSDocTypeExpressionForTests(content, start, length) { - initializeState("file.js", content, 2 /* Latest */, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, 2 /* Latest */, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); var jsDocTypeExpression = parseJSDocTypeExpression(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -12786,6 +11582,7 @@ var ts; case 103 /* VoidKeyword */: return parseTokenNode(); } + // TODO (drosen): Parse string literal types in JSDoc as well. return parseJSDocTypeReference(); } function parseJSDocThisType() { @@ -12957,7 +11754,7 @@ var ts; } } function parseIsolatedJSDocComment(content, start, length) { - initializeState("file.js", content, 2 /* Latest */, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, 2 /* Latest */, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); var jsDocComment = parseJSDocComment(/*parent:*/ undefined, start, length); var diagnostics = parseDiagnostics; clearState(); @@ -13682,6 +12479,1372 @@ var ts; })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); +/// +/// +/* @internal */ +var ts; +(function (ts) { + ts.bindTime = 0; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); + var ModuleInstanceState = ts.ModuleInstanceState; + var Reachability; + (function (Reachability) { + Reachability[Reachability["Unintialized"] = 1] = "Unintialized"; + Reachability[Reachability["Reachable"] = 2] = "Reachable"; + Reachability[Reachability["Unreachable"] = 4] = "Unreachable"; + Reachability[Reachability["ReportedUnreachable"] = 8] = "ReportedUnreachable"; + })(Reachability || (Reachability = {})); + function or(state1, state2) { + return (state1 | state2) & 2 /* Reachable */ + ? 2 /* Reachable */ + : (state1 & state2) & 8 /* ReportedUnreachable */ + ? 8 /* ReportedUnreachable */ + : 4 /* Unreachable */; + } + function getModuleInstanceState(node) { + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { + return 0 /* NonInstantiated */; + } + else if (ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; + } + else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + return 0 /* NonInstantiated */; + } + else if (node.kind === 219 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + // child is non-instantiated - continue searching + return false; + case 2 /* ConstEnumOnly */: + // child is const enum only - record state and continue searching + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + // child is instantiated - record state and stop + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 218 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); + } + else { + return 1 /* Instantiated */; + } + } + ts.getModuleInstanceState = getModuleInstanceState; + var ContainerFlags; + (function (ContainerFlags) { + // The current node is not a container, and no container manipulation should happen before + // recursing into it. + ContainerFlags[ContainerFlags["None"] = 0] = "None"; + // The current node is a container. It should be set as the current container (and block- + // container) before recursing into it. The current node does not have locals. Examples: + // + // Classes, ObjectLiterals, TypeLiterals, Interfaces... + ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; + // The current node is a block-scoped-container. It should be set as the current block- + // container before recursing into it. Examples: + // + // Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements... + ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags[ContainerFlags["HasLocals"] = 4] = "HasLocals"; + // If the current node is a container that also container that also contains locals. Examples: + // + // Functions, Methods, Modules, Source-files. + ContainerFlags[ContainerFlags["IsContainerWithLocals"] = 5] = "IsContainerWithLocals"; + })(ContainerFlags || (ContainerFlags = {})); + var binder = createBinder(); + function bindSourceFile(file, options) { + var start = new Date().getTime(); + binder(file, options); + ts.bindTime += new Date().getTime() - start; + } + ts.bindSourceFile = bindSourceFile; + function createBinder() { + var file; + var options; + var parent; + var container; + var blockScopeContainer; + var lastContainer; + var seenThisKeyword; + // state used by reachability checks + var hasExplicitReturn; + var currentReachabilityState; + var labelStack; + var labelIndexMap; + var implicitLabels; + // If this file is an external module, then it is automatically in strict-mode according to + // ES6. If it is not an external module, then we'll determine if it is in strict mode or + // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). + var inStrictMode; + var symbolCount = 0; + var Symbol; + var classifiableNames; + function bindSourceFile(f, opts) { + file = f; + options = opts; + inStrictMode = !!file.externalModuleIndicator; + classifiableNames = {}; + Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + bind(file); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + } + parent = undefined; + container = undefined; + blockScopeContainer = undefined; + lastContainer = undefined; + seenThisKeyword = false; + hasExplicitReturn = false; + labelStack = undefined; + labelIndexMap = undefined; + implicitLabels = undefined; + } + return bindSourceFile; + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function addDeclarationToSymbol(symbol, node, symbolFlags) { + symbol.flags |= symbolFlags; + node.symbol = symbol; + if (!symbol.declarations) { + symbol.declarations = []; + } + symbol.declarations.push(node); + if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) { + symbol.exports = {}; + } + if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { + symbol.members = {}; + } + if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { + symbol.valueDeclaration = node; + } + } + // Should not be called on a declaration with a computed property name, + // unless it is a well known Symbol. + function getDeclarationName(node) { + if (node.name) { + if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + return "\"" + node.name.text + "\""; + } + if (node.name.kind === 136 /* ComputedPropertyName */) { + var nameExpression = node.name.expression; + // treat computed property names where expression is string/numeric literal as just string/numeric literal + if (ts.isStringOrNumericLiteral(nameExpression.kind)) { + return nameExpression.text; + } + ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); + return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); + } + return node.name.text; + } + switch (node.kind) { + case 144 /* Constructor */: + return "__constructor"; + case 152 /* FunctionType */: + case 147 /* CallSignature */: + return "__call"; + case 153 /* ConstructorType */: + case 148 /* ConstructSignature */: + return "__new"; + case 149 /* IndexSignature */: + return "__index"; + case 228 /* ExportDeclaration */: + return "__export"; + case 227 /* ExportAssignment */: + return node.isExportEquals ? "export=" : "default"; + case 181 /* BinaryExpression */: + // Binary expression case is for JS module 'module.exports = expr' + return "export="; + case 213 /* FunctionDeclaration */: + case 214 /* ClassDeclaration */: + return node.flags & 512 /* Default */ ? "default" : undefined; + } + } + function getDisplayName(node) { + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); + } + /** + * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. + * @param symbolTable - The symbol table which node will be added to. + * @param parent - node's parent declaration. + * @param node - The declaration to be added to the symbol table + * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.) + * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations. + */ + function declareSymbol(symbolTable, parent, node, includes, excludes) { + ts.Debug.assert(!ts.hasDynamicName(node)); + var isDefaultExport = node.flags & 512 /* Default */; + // The exported symbol for an export default function/class node is always named "default" + var name = isDefaultExport && parent ? "default" : getDeclarationName(node); + var symbol; + if (name !== undefined) { + // Check and see if the symbol table already has a symbol with this name. If not, + // create a new symbol with this name and add it to the table. Note that we don't + // give the new symbol any flags *yet*. This ensures that it will not conflict + // with the 'excludes' flags we pass in. + // + // If we do get an existing symbol, see if it conflicts with the new symbol we're + // creating. For example, a 'var' symbol and a 'class' symbol will conflict within + // the same symbol table. If we have a conflict, report the issue on each + // declaration we have for this symbol, and then create a new symbol for this + // declaration. + // + // If we created a new symbol, either because we didn't have a symbol with this name + // in the symbol table, or we conflicted with an existing symbol, then just add this + // node as the sole declaration of the new symbol. + // + // Otherwise, we'll be merging into a compatible existing symbol (for example when + // you have multiple 'vars' with the same name in the same container). In this case + // just add this node into the declarations list of the symbol. + symbol = ts.hasProperty(symbolTable, name) + ? symbolTable[name] + : (symbolTable[name] = createSymbol(0 /* None */, name)); + if (name && (includes & 788448 /* Classifiable */)) { + classifiableNames[name] = name; + } + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + // Report errors every position with duplicate declaration + // Report errors on previous encountered declarations + var message = symbol.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.flags & 512 /* Default */) { + message = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; + } + }); + ts.forEach(symbol.declarations, function (declaration) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); + }); + file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); + symbol = createSymbol(0 /* None */, name); + } + } + else { + symbol = createSymbol(0 /* None */, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + return symbol; + } + function declareModuleMember(node, symbolFlags, symbolExcludes) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; + if (symbolFlags & 8388608 /* Alias */) { + if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + else { + // 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. + if (hasExportModifier || container.flags & 131072 /* ExportContext */) { + var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | + (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | + (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); + var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + node.localSymbol = local; + return local; + } + else { + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + } + // All container nodes are kept on a linked list in declaration order. This list is used by + // the getLocalNameOfContainer function in the type checker to validate that the local name + // used for a container is unique. + function bindChildren(node) { + // Before we recurse into a node's chilren, we first save the existing parent, container + // and block-container. Then after we pop out of processing the children, we restore + // these saved values. + var saveParent = parent; + var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; + // This node will now be set as the parent of all of its children as we recurse into them. + parent = node; + // Depending on what kind of node this is, we may have to adjust the current container + // and block-container. If the current node is a container, then it is automatically + // considered the current block-container as well. Also, for containers that we know + // may contain locals, we proactively initialize the .locals field. We do this because + // it's highly likely that the .locals will be needed to place some child in (for example, + // a parameter, or variable declaration). + // + // However, we do not proactively create the .locals for block-containers because it's + // totally normal and common for block-containers to never actually have a block-scoped + // variable in them. We don't want to end up allocating an object for every 'block' we + // run into when most of them won't be necessary. + // + // Finally, if this is a block-container, then we clear out any existing .locals object + // it may contain within it. This happens in incremental scenarios. Because we can be + // reusing a node from a previous compilation, that node may have had 'locals' created + // for it. We must clear this so we don't accidently move any stale data forward from + // a previous compilation. + var containerFlags = getContainerFlags(node); + if (containerFlags & 1 /* IsContainer */) { + container = blockScopeContainer = node; + if (containerFlags & 4 /* HasLocals */) { + container.locals = {}; + } + addToContainerChain(container); + } + else if (containerFlags & 2 /* IsBlockScopedContainer */) { + blockScopeContainer = node; + blockScopeContainer.locals = undefined; + } + var savedReachabilityState; + var savedLabelStack; + var savedLabels; + var savedImplicitLabels; + var savedHasExplicitReturn; + var kind = node.kind; + var flags = node.flags; + // reset all reachability check related flags on node (for incremental scenarios) + flags &= ~1572864 /* ReachabilityCheckFlags */; + if (kind === 215 /* InterfaceDeclaration */) { + seenThisKeyword = false; + } + var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + if (saveState) { + savedReachabilityState = currentReachabilityState; + savedLabelStack = labelStack; + savedLabels = labelIndexMap; + savedImplicitLabels = implicitLabels; + savedHasExplicitReturn = hasExplicitReturn; + currentReachabilityState = 2 /* Reachable */; + hasExplicitReturn = false; + labelStack = labelIndexMap = implicitLabels = undefined; + } + bindReachableStatement(node); + if (currentReachabilityState === 2 /* Reachable */ && ts.isFunctionLikeKind(kind) && ts.nodeIsPresent(node.body)) { + flags |= 524288 /* HasImplicitReturn */; + if (hasExplicitReturn) { + flags |= 1048576 /* HasExplicitReturn */; + } + } + if (kind === 215 /* InterfaceDeclaration */) { + flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; + } + node.flags = flags; + if (saveState) { + hasExplicitReturn = savedHasExplicitReturn; + currentReachabilityState = savedReachabilityState; + labelStack = savedLabelStack; + labelIndexMap = savedLabels; + implicitLabels = savedImplicitLabels; + } + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + /** + * Returns true if node and its subnodes were successfully traversed. + * Returning false means that node was not examined and caller needs to dive into the node himself. + */ + function bindReachableStatement(node) { + if (checkUnreachable(node)) { + ts.forEachChild(node, bind); + return; + } + switch (node.kind) { + case 198 /* WhileStatement */: + bindWhileStatement(node); + break; + case 197 /* DoStatement */: + bindDoStatement(node); + break; + case 199 /* ForStatement */: + bindForStatement(node); + break; + case 200 /* ForInStatement */: + case 201 /* ForOfStatement */: + bindForInOrForOfStatement(node); + break; + case 196 /* IfStatement */: + bindIfStatement(node); + break; + case 204 /* ReturnStatement */: + case 208 /* ThrowStatement */: + bindReturnOrThrow(node); + break; + case 203 /* BreakStatement */: + case 202 /* ContinueStatement */: + bindBreakOrContinueStatement(node); + break; + case 209 /* TryStatement */: + bindTryStatement(node); + break; + case 206 /* SwitchStatement */: + bindSwitchStatement(node); + break; + case 220 /* CaseBlock */: + bindCaseBlock(node); + break; + case 207 /* LabeledStatement */: + bindLabeledStatement(node); + break; + default: + ts.forEachChild(node, bind); + break; + } + } + function bindWhileStatement(n) { + var preWhileState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + var postWhileState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + // bind expressions (don't affect reachability) + bind(n.expression); + currentReachabilityState = preWhileState; + var postWhileLabel = pushImplicitLabel(); + bind(n.statement); + popImplicitLabel(postWhileLabel, postWhileState); + } + function bindDoStatement(n) { + var preDoState = currentReachabilityState; + var postDoLabel = pushImplicitLabel(); + bind(n.statement); + var postDoState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : preDoState; + popImplicitLabel(postDoLabel, postDoState); + // bind expressions (don't affect reachability) + bind(n.expression); + } + function bindForStatement(n) { + var preForState = currentReachabilityState; + var postForLabel = pushImplicitLabel(); + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.condition); + bind(n.incrementor); + bind(n.statement); + // for statement is considered infinite when it condition is either omitted or is true keyword + // - for(..;;..) + // - for(..;true;..) + var isInfiniteLoop = (!n.condition || n.condition.kind === 99 /* TrueKeyword */); + var postForState = isInfiniteLoop ? 4 /* Unreachable */ : preForState; + popImplicitLabel(postForLabel, postForState); + } + function bindForInOrForOfStatement(n) { + var preStatementState = currentReachabilityState; + var postStatementLabel = pushImplicitLabel(); + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.expression); + bind(n.statement); + popImplicitLabel(postStatementLabel, preStatementState); + } + function bindIfStatement(n) { + // denotes reachability state when entering 'thenStatement' part of the if statement: + // i.e. if condition is false then thenStatement is unreachable + var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + // denotes reachability state when entering 'elseStatement': + // i.e. if condition is true then elseStatement is unreachable + var ifFalseState = n.expression.kind === 99 /* TrueKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; + currentReachabilityState = ifTrueState; + // bind expression (don't affect reachability) + bind(n.expression); + bind(n.thenStatement); + if (n.elseStatement) { + var preElseState = currentReachabilityState; + currentReachabilityState = ifFalseState; + bind(n.elseStatement); + currentReachabilityState = or(currentReachabilityState, preElseState); + } + else { + currentReachabilityState = or(currentReachabilityState, ifFalseState); + } + } + function bindReturnOrThrow(n) { + // bind expression (don't affect reachability) + bind(n.expression); + if (n.kind === 204 /* ReturnStatement */) { + hasExplicitReturn = true; + } + currentReachabilityState = 4 /* Unreachable */; + } + function bindBreakOrContinueStatement(n) { + // call bind on label (don't affect reachability) + bind(n.label); + // for continue case touch label so it will be marked a used + var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + if (isValidJump) { + currentReachabilityState = 4 /* Unreachable */; + } + } + function bindTryStatement(n) { + // catch\finally blocks has the same reachability as try block + var preTryState = currentReachabilityState; + bind(n.tryBlock); + var postTryState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.catchClause); + var postCatchState = currentReachabilityState; + currentReachabilityState = preTryState; + bind(n.finallyBlock); + // post catch/finally state is reachable if + // - post try state is reachable - control flow can fall out of try block + // - post catch state is reachable - control flow can fall out of catch block + currentReachabilityState = or(postTryState, postCatchState); + } + function bindSwitchStatement(n) { + var preSwitchState = currentReachabilityState; + var postSwitchLabel = pushImplicitLabel(); + // bind expression (don't affect reachability) + bind(n.expression); + bind(n.caseBlock); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); + // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case + var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; + popImplicitLabel(postSwitchLabel, postSwitchState); + } + function bindCaseBlock(n) { + var startState = currentReachabilityState; + for (var _i = 0, _a = n.clauses; _i < _a.length; _i++) { + var clause = _a[_i]; + currentReachabilityState = startState; + bind(clause); + if (clause.statements.length && currentReachabilityState === 2 /* Reachable */ && options.noFallthroughCasesInSwitch) { + errorOnFirstToken(clause, ts.Diagnostics.Fallthrough_case_in_switch); + } + } + } + function bindLabeledStatement(n) { + // call bind on label (don't affect reachability) + bind(n.label); + var ok = pushNamedLabel(n.label); + bind(n.statement); + if (ok) { + popNamedLabel(n.label, currentReachabilityState); + } + } + function getContainerFlags(node) { + switch (node.kind) { + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + case 215 /* InterfaceDeclaration */: + case 217 /* EnumDeclaration */: + case 155 /* TypeLiteral */: + case 165 /* ObjectLiteralExpression */: + return 1 /* IsContainer */; + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 213 /* FunctionDeclaration */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + case 218 /* ModuleDeclaration */: + case 248 /* SourceFile */: + case 216 /* TypeAliasDeclaration */: + return 5 /* IsContainerWithLocals */; + case 244 /* CatchClause */: + case 199 /* ForStatement */: + case 200 /* ForInStatement */: + case 201 /* ForOfStatement */: + case 220 /* CaseBlock */: + return 2 /* IsBlockScopedContainer */; + case 192 /* Block */: + // do not treat blocks directly inside a function as a block-scoped-container. + // Locals that reside in this block should go to the function locals. Othewise 'x' + // would not appear to be a redeclaration of a block scoped local in the following + // example: + // + // function foo() { + // var x; + // let x; + // } + // + // If we placed 'var x' into the function locals and 'let x' into the locals of + // the block, then there would be no collision. + // + // By not creating a new block-scoped-container here, we ensure that both 'var x' + // and 'let x' go into the Function-container's locals, and we do get a collision + // conflict. + return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; + } + return 0 /* None */; + } + function addToContainerChain(next) { + if (lastContainer) { + lastContainer.nextContainer = next; + } + lastContainer = next; + } + function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { + // Just call this directly so that the return type of this function stays "void". + declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); + } + function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { + switch (container.kind) { + // Modules, source files, and classes need specialized handling for how their + // members are declared (for example, a member of a class will go into a specific + // symbol table depending on if it is static or not). We defer to specialized + // handlers to take care of declaring these child members. + case 218 /* ModuleDeclaration */: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 248 /* SourceFile */: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 217 /* EnumDeclaration */: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 155 /* TypeLiteral */: + case 165 /* ObjectLiteralExpression */: + case 215 /* InterfaceDeclaration */: + // Interface/Object-types always have their children added to the 'members' of + // their container. They are only accessible through an instance of their + // container, and are never in scope otherwise (even inside the body of the + // object / type / interface declaring them). An exception is type parameters, + // which are in scope without qualification (similar to 'locals'). + return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 213 /* FunctionDeclaration */: + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + case 216 /* TypeAliasDeclaration */: + // All the children of these container types are never visible through another + // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, + // they're only accessed 'lexically' (i.e. from code that exists underneath + // their container in the tree. To accomplish this, we simply add their declared + // symbol to the 'locals' of the container. These symbols can then be found as + // the type checker walks up the containers, checking them for matching names. + return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function declareClassMember(node, symbolFlags, symbolExcludes) { + return node.flags & 64 /* Static */ + ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) + : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + } + function declareSourceFileMember(node, symbolFlags, symbolExcludes) { + return ts.isExternalModule(file) + ? declareModuleMember(node, symbolFlags, symbolExcludes) + : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); + } + function hasExportDeclarations(node) { + var body = node.kind === 248 /* SourceFile */ ? node : node.body; + if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { + for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { + var stat = _a[_i]; + if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { + return true; + } + } + } + return false; + } + function setExportContextFlag(node) { + // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular + // declarations with export modifiers) is an export context in which declarations are implicitly exported. + if (ts.isInAmbientContext(node) && !hasExportDeclarations(node)) { + node.flags |= 131072 /* ExportContext */; + } + else { + node.flags &= ~131072 /* ExportContext */; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (node.name.kind === 9 /* StringLiteral */) { + declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + } + else { + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + } + else { + declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); + if (node.symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { + // if module was already merged with some function, class or non-const enum + // treat is a non-const-enum-only + node.symbol.constEnumOnlyModule = false; + } + else { + var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; + if (node.symbol.constEnumOnlyModule === undefined) { + // non-merged case - use the current state + node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; + } + else { + // merged case: module is const enum only if all its pieces are non-instantiated or const enum + node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; + } + } + } + } + } + function bindFunctionOrConstructorType(node) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072 /* Signature */); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); + var _a; + } + function bindObjectLiteralExpression(node) { + var ElementKind; + (function (ElementKind) { + ElementKind[ElementKind["Property"] = 1] = "Property"; + ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; + })(ElementKind || (ElementKind = {})); + if (inStrictMode) { + var seen = {}; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + if (prop.name.kind !== 69 /* Identifier */) { + continue; + } + var identifier = prop.name; + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields + var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + ? 1 /* Property */ + : 2 /* Accessor */; + var existingKind = seen[identifier.text]; + if (!existingKind) { + seen[identifier.text] = currentKind; + continue; + } + if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) { + var span = ts.getErrorSpanForNode(file, identifier); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode)); + } + } + } + return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); + } + function bindAnonymousDeclaration(node, symbolFlags, name) { + var symbol = createSymbol(symbolFlags, name); + addDeclarationToSymbol(symbol, node, symbolFlags); + } + function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { + switch (blockScopeContainer.kind) { + case 218 /* ModuleDeclaration */: + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + case 248 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + } + // fall through. + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); + } + declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); + } + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized + // check for reserved words used as identifiers in strict mode code. + function checkStrictModeIdentifier(node) { + if (inStrictMode && + node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ && + node.originalKeywordKind <= 114 /* LastFutureReservedWord */ && + !ts.isIdentifierName(node)) { + // Report error only if there are no parse errors in file + if (!file.parseDiagnostics.length) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node))); + } + } + } + function getStrictModeIdentifierMessage(node) { + // Provide specialized messages to help the user understand why we think they're in + // strict mode. + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; + } + function checkStrictModeBinaryExpression(node) { + if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) + checkStrictModeEvalOrArguments(node, node.left); + } + } + function checkStrictModeCatchClause(node) { + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments + if (inStrictMode && node.variableDeclaration) { + checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); + } + } + function checkStrictModeDeleteExpression(node) { + // Grammar checking + if (inStrictMode && node.expression.kind === 69 /* Identifier */) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name + var span = ts.getErrorSpanForNode(file, node.expression); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); + } + } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 69 /* Identifier */ && + (node.text === "eval" || node.text === "arguments"); + } + function checkStrictModeEvalOrArguments(contextNode, name) { + if (name && name.kind === 69 /* Identifier */) { + var identifier = name; + if (isEvalOrArgumentsIdentifier(identifier)) { + // We check first if the name is inside class declaration or class expression; if so give explicit message + // otherwise report generic error message. + var span = ts.getErrorSpanForNode(file, name); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), identifier.text)); + } + } + } + function getStrictModeEvalOrArgumentsMessage(node) { + // Provide specialized messages to help the user understand why we think they're in + // strict mode. + if (ts.getContainingClass(node)) { + return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; + } + return ts.Diagnostics.Invalid_use_of_0_in_strict_mode; + } + function checkStrictModeFunctionName(node) { + if (inStrictMode) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) + checkStrictModeEvalOrArguments(node, node.name); + } + } + function checkStrictModeNumericLiteral(node) { + if (inStrictMode && node.flags & 32768 /* OctalLiteral */) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); + } + } + function checkStrictModePostfixUnaryExpression(node) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + function checkStrictModePrefixUnaryExpression(node) { + // Grammar checking + if (inStrictMode) { + if (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + } + function checkStrictModeWithStatement(node) { + // Grammar checking for withStatement + if (inStrictMode) { + errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + function errorOnFirstToken(node, message, arg0, arg1, arg2) { + var span = ts.getSpanOfTokenAtPosition(file, node.pos); + file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); + } + function getDestructuringParameterName(node) { + return "__" + ts.indexOf(node.parent.parameters, node); + } + function bind(node) { + if (!node) { + return; + } + node.parent = parent; + var savedInStrictMode = inStrictMode; + if (!savedInStrictMode) { + updateStrictMode(node); + } + // First we bind declaration nodes to a symbol if possible. We'll both create a symbol + // and then potentially add the symbol to an appropriate symbol table. Possible + // destination symbol tables are: + // + // 1) The 'exports' table of the current container's symbol. + // 2) The 'members' table of the current container's symbol. + // 3) The 'locals' table of the current container. + // + // However, not all symbols will end up in any of these tables. 'Anonymous' symbols + // (like TypeLiterals for example) will not be put in any table. + bindWorker(node); + // Then we recurse into the children of the node to bind them as well. For certain + // symbols we do specialized work when we recurse. For example, we'll keep track of + // the current 'container' node when it changes. This helps us know which symbol table + // a local should go into for example. + bindChildren(node); + inStrictMode = savedInStrictMode; + } + function updateStrictMode(node) { + switch (node.kind) { + case 248 /* SourceFile */: + case 219 /* ModuleBlock */: + updateStrictModeStatementList(node.statements); + return; + case 192 /* Block */: + if (ts.isFunctionLike(node.parent)) { + updateStrictModeStatementList(node.statements); + } + return; + case 214 /* ClassDeclaration */: + case 186 /* ClassExpression */: + // All classes are automatically in strict mode in ES6. + inStrictMode = true; + return; + } + } + function updateStrictModeStatementList(statements) { + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (!ts.isPrologueDirective(statement)) { + return; + } + if (isUseStrictPrologueDirective(statement)) { + inStrictMode = true; + return; + } + } + } + /// Should be called only on prologue directives (isPrologueDirective(node) should be true) + function isUseStrictPrologueDirective(node) { + var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); + // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the + // string to contain unicode escapes (as per ES5). + return nodeText === "\"use strict\"" || nodeText === "'use strict'"; + } + function bindWorker(node) { + switch (node.kind) { + /* Strict mode checks */ + case 69 /* Identifier */: + return checkStrictModeIdentifier(node); + case 181 /* BinaryExpression */: + if (ts.isInJavaScriptFile(node)) { + if (ts.isExportsPropertyAssignment(node)) { + bindExportsPropertyAssignment(node); + } + else if (ts.isModuleExportsAssignment(node)) { + bindModuleExportsAssignment(node); + } + } + return checkStrictModeBinaryExpression(node); + case 244 /* CatchClause */: + return checkStrictModeCatchClause(node); + case 175 /* DeleteExpression */: + return checkStrictModeDeleteExpression(node); + case 8 /* NumericLiteral */: + return checkStrictModeNumericLiteral(node); + case 180 /* PostfixUnaryExpression */: + return checkStrictModePostfixUnaryExpression(node); + case 179 /* PrefixUnaryExpression */: + return checkStrictModePrefixUnaryExpression(node); + case 205 /* WithStatement */: + return checkStrictModeWithStatement(node); + case 97 /* ThisKeyword */: + seenThisKeyword = true; + return; + case 137 /* TypeParameter */: + return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); + case 138 /* Parameter */: + return bindParameter(node); + case 211 /* VariableDeclaration */: + case 163 /* BindingElement */: + return bindVariableDeclarationOrBindingElement(node); + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); + case 245 /* PropertyAssignment */: + case 246 /* ShorthandPropertyAssignment */: + return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); + case 247 /* EnumMember */: + return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: + case 149 /* IndexSignature */: + return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + // If this is an ObjectLiteralExpression method, then it sits in the same space + // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes + // so that it will conflict with any other object literal members with the same + // name. + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); + case 213 /* FunctionDeclaration */: + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + case 144 /* Constructor */: + return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); + case 145 /* GetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); + case 146 /* SetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); + case 152 /* FunctionType */: + case 153 /* ConstructorType */: + return bindFunctionOrConstructorType(node); + case 155 /* TypeLiteral */: + return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); + case 165 /* ObjectLiteralExpression */: + return bindObjectLiteralExpression(node); + case 173 /* FunctionExpression */: + case 174 /* ArrowFunction */: + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); + case 168 /* CallExpression */: + if (ts.isInJavaScriptFile(node)) { + bindCallExpression(node); + } + break; + // Members of classes, interfaces, and modules + case 186 /* ClassExpression */: + case 214 /* ClassDeclaration */: + return bindClassLikeDeclaration(node); + case 215 /* InterfaceDeclaration */: + return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); + case 216 /* TypeAliasDeclaration */: + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); + case 217 /* EnumDeclaration */: + return bindEnumDeclaration(node); + case 218 /* ModuleDeclaration */: + return bindModuleDeclaration(node); + // Imports and exports + case 221 /* ImportEqualsDeclaration */: + case 224 /* NamespaceImport */: + case 226 /* ImportSpecifier */: + case 230 /* ExportSpecifier */: + return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); + case 223 /* ImportClause */: + return bindImportClause(node); + case 228 /* ExportDeclaration */: + return bindExportDeclaration(node); + case 227 /* ExportAssignment */: + return bindExportAssignment(node); + case 248 /* SourceFile */: + return bindSourceFileIfExternalModule(); + } + } + function bindSourceFileIfExternalModule() { + setExportContextFlag(file); + if (ts.isExternalModule(file)) { + bindSourceFileAsExternalModule(); + } + } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); + } + function bindExportAssignment(node) { + var boundExpression = node.kind === 227 /* ExportAssignment */ ? node.expression : node.right; + if (!container.symbol || !container.symbol.exports) { + // Export assignment in some sort of block construct + bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); + } + else if (boundExpression.kind === 69 /* Identifier */) { + // An export default clause with an identifier exports all meanings of that identifier + declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); + } + else { + // An export default clause with an expression exports a value + declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); + } + } + function bindExportDeclaration(node) { + if (!container.symbol || !container.symbol.exports) { + // Export * in some sort of block construct + bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); + } + else if (!node.exportClause) { + // All export * declarations are collected in an __export symbol + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); + } + } + function bindImportClause(node) { + if (node.name) { + declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); + } + } + function setCommonJsModuleIndicator(node) { + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + bindSourceFileAsExternalModule(); + } + } + function bindExportsPropertyAssignment(node) { + // When we create a property via 'exports.foo = bar', the 'exports.foo' property access + // expression is the declaration + setCommonJsModuleIndicator(node); + declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 7340032 /* Export */, 0 /* None */); + } + function bindModuleExportsAssignment(node) { + // 'module.exports = expr' assignment + setCommonJsModuleIndicator(node); + bindExportAssignment(node); + } + function bindCallExpression(node) { + // We're only inspecting call expressions to detect CommonJS modules, so we can skip + // this check if we've already seen the module indicator + if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node) { + if (node.kind === 214 /* ClassDeclaration */) { + bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); + } + else { + var bindingName = node.name ? node.name.text : "__class"; + bindAnonymousDeclaration(node, 32 /* Class */, bindingName); + // Add name of class expression into the map for semantic classifier + if (node.name) { + classifiableNames[node.name.text] = node.name.text; + } + } + var symbol = node.symbol; + // 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'. + // + // Note: we check for this here because this class may be merging into a module. The + // module might have an exported variable called 'prototype'. We can't allow that as + // that would clash with the built-in 'prototype' for the class. + var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + function bindEnumDeclaration(node) { + return ts.isConst(node) + ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) + : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); + } + function bindVariableDeclarationOrBindingElement(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (!ts.isBindingPattern(node.name)) { + if (ts.isBlockOrCatchScoped(node)) { + bindBlockScopedVariableDeclaration(node); + } + else if (ts.isParameterDeclaration(node)) { + // It is safe to walk up parent chain to find whether the node is a destructing parameter declaration + // because its parent chain has already been set up, since parents are set before descending into children. + // + // If node is a binding element in parameter declaration, we need to use ParameterExcludes. + // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration + // For example: + // function foo([a,a]) {} // Duplicate Identifier error + // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter + // // which correctly set excluded symbols + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + } + else { + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); + } + } + } + function bindParameter(node) { + if (inStrictMode) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + checkStrictModeEvalOrArguments(node, node.name); + } + if (ts.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node)); + } + else { + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + } + // If this is a property-parameter, then also declare the property symbol into the + // containing class. + if (node.flags & 56 /* AccessibilityModifier */ && + node.parent.kind === 144 /* Constructor */ && + ts.isClassLike(node.parent.parent)) { + var classDeclaration = node.parent.parent; + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); + } + } + function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + return ts.hasDynamicName(node) + ? bindAnonymousDeclaration(node, symbolFlags, "__computed") + : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + // reachability checks + function pushNamedLabel(name) { + initializeReachabilityStateIfNecessary(); + if (ts.hasProperty(labelIndexMap, name.text)) { + return false; + } + labelIndexMap[name.text] = labelStack.push(1 /* Unintialized */) - 1; + return true; + } + function pushImplicitLabel() { + initializeReachabilityStateIfNecessary(); + var index = labelStack.push(1 /* Unintialized */) - 1; + implicitLabels.push(index); + return index; + } + function popNamedLabel(label, outerState) { + var index = labelIndexMap[label.text]; + ts.Debug.assert(index !== undefined); + ts.Debug.assert(labelStack.length == index + 1); + labelIndexMap[label.text] = undefined; + setCurrentStateAtLabel(labelStack.pop(), outerState, label); + } + function popImplicitLabel(implicitLabelIndex, outerState) { + if (labelStack.length !== implicitLabelIndex + 1) { + ts.Debug.assert(false, "Label stack: " + labelStack.length + ", index:" + implicitLabelIndex); + } + var i = implicitLabels.pop(); + if (implicitLabelIndex !== i) { + ts.Debug.assert(false, "i: " + i + ", index: " + implicitLabelIndex); + } + setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); + } + function setCurrentStateAtLabel(innerMergedState, outerState, label) { + if (innerMergedState === 1 /* Unintialized */) { + if (label && !options.allowUnusedLabels) { + file.bindDiagnostics.push(ts.createDiagnosticForNode(label, ts.Diagnostics.Unused_label)); + } + currentReachabilityState = outerState; + } + else { + currentReachabilityState = or(innerMergedState, outerState); + } + } + function jumpToLabel(label, outerState) { + initializeReachabilityStateIfNecessary(); + var index = label ? labelIndexMap[label.text] : ts.lastOrUndefined(implicitLabels); + if (index === undefined) { + // reference to unknown label or + // break/continue used outside of loops + return false; + } + var stateAtLabel = labelStack[index]; + labelStack[index] = stateAtLabel === 1 /* Unintialized */ ? outerState : or(stateAtLabel, outerState); + return true; + } + function checkUnreachable(node) { + switch (currentReachabilityState) { + case 4 /* Unreachable */: + var reportError = + // report error on all statements except empty ones + (ts.isStatement(node) && node.kind !== 194 /* EmptyStatement */) || + // report error on class declarations + node.kind === 214 /* ClassDeclaration */ || + // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + // report error on regular enums and const enums if preserveConstEnums is set + (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + if (reportError) { + currentReachabilityState = 8 /* ReportedUnreachable */; + // unreachable code is reported if + // - user has explicitly asked about it AND + // - statement is in not ambient context (statements in ambient context is already an error + // so we should not report extras) AND + // - node is not variable statement OR + // - node is block scoped variable statement OR + // - node is not block scoped variable statement and at least one variable declaration has initializer + // Rationale: we don't want to report errors on non-initialized var's since they are hoisted + // On the other side we do want to report errors on non-initialized 'lets' because of TDZ + var reportUnreachableCode = !options.allowUnreachableCode && + !ts.isInAmbientContext(node) && + (node.kind !== 193 /* VariableStatement */ || + ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || + ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); + if (reportUnreachableCode) { + errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected); + } + } + case 8 /* ReportedUnreachable */: + return true; + default: + return false; + } + function shouldReportErrorOnModuleDeclaration(node) { + var instanceState = getModuleInstanceState(node); + return instanceState === 1 /* Instantiated */ || (instanceState === 2 /* ConstEnumOnly */ && options.preserveConstEnums); + } + } + function initializeReachabilityStateIfNecessary() { + if (labelIndexMap) { + return; + } + currentReachabilityState = 2 /* Reachable */; + labelIndexMap = {}; + labelStack = []; + implicitLabels = []; + } + } +})(ts || (ts = {})); /// /* @internal */ var ts; @@ -13755,7 +13918,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getContextualType, + getContextualType: getApparentTypeOfContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -14025,7 +14188,7 @@ var ts; return ts.getAncestor(node, 248 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 248 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 248 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14127,15 +14290,24 @@ var ts; } switch (location.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location)) + if (!ts.isExternalOrCommonJsModule(location)) break; case 218 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; if (location.kind === 248 /* SourceFile */ || (location.kind === 218 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { - // It's an external module. Because of module/namespace merging, a module's exports are in scope, - // yet we never want to treat an export specifier as putting a member in scope. Therefore, - // if the name we find is purely an export specifier, it is not actually considered in scope. + // It's an external module. First see if the module has an export default and if the local + // name of that export default matches. + if (result = moduleExports["default"]) { + var localSymbol = ts.getLocalSymbolForExportDefault(result); + if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { + break loop; + } + result = undefined; + } + // Because of module/namespace merging, a module's exports are in scope, + // yet we never want to treat an export specifier as putting a member in scope. + // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope. // Two things to note about this: // 1. We have to check this without calling getSymbol. The problem with calling getSymbol // on an export specifier is that it might find the export specifier itself, and try to @@ -14149,12 +14321,6 @@ var ts; ts.getDeclarationOfKind(moduleExports[name], 230 /* ExportSpecifier */)) { break; } - result = moduleExports["default"]; - var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; } if (result = getSymbol(moduleExports, name, meaning & 8914931 /* ModuleMember */)) { break loop; @@ -14297,7 +14463,7 @@ var ts; // declare module foo { // interface bar {} // } - // let foo/*1*/: foo/*2*/.bar; + // const foo/*1*/: foo/*2*/.bar; // The foo at /*1*/ and /*2*/ will share same symbol with two meaning // block - scope variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, @@ -14601,6 +14767,9 @@ var ts; if (moduleName === undefined) { return; } + if (moduleName.indexOf("!") >= 0) { + moduleName = moduleName.substr(0, moduleName.indexOf("!")); + } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); @@ -14788,7 +14957,7 @@ var ts; } switch (location_1.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location_1)) { + if (!ts.isExternalOrCommonJsModule(location_1)) { break; } case 218 /* ModuleDeclaration */: @@ -14910,7 +15079,7 @@ var ts; // export class c { // } // } - // let x: typeof m.c + // const x: typeof m.c // In the above example when we start with checking if typeof m.c symbol is accessible, // we are going to see if c can be accessed in scope directly. // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible @@ -14949,7 +15118,7 @@ var ts; } function hasExternalModuleSymbol(declaration) { return (declaration.kind === 218 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 248 /* SourceFile */ && ts.isExternalModule(declaration)); + (declaration.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15100,7 +15269,7 @@ var ts; parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses + // const the writer know we just wrote out a symbol. The declaration emitter writer uses // this to determine if an import it has previously seen (and not written out) needs // to be written to the file once the walk of the tree is complete. // @@ -15181,7 +15350,7 @@ var ts; writeAnonymousType(type, flags); } else if (type.flags & 256 /* StringLiteral */) { - writer.writeStringLiteral(type.text); + writer.writeStringLiteral("\"" + ts.escapeString(type.text) + "\""); } else { // Should never get here @@ -15568,7 +15737,7 @@ var ts; } } else if (node.kind === 248 /* SourceFile */) { - return ts.isExternalModule(node) ? node : undefined; + return ts.isExternalOrCommonJsModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); @@ -15650,7 +15819,7 @@ var ts; // Private/protected properties/methods are not visible return false; } - // Public properties/methods are visible if its parents are visible, so let it fall into next case statement + // Public properties/methods are visible if its parents are visible, so const it fall into next case statement case 144 /* Constructor */: case 148 /* ConstructSignature */: case 147 /* CallSignature */: @@ -15678,7 +15847,7 @@ var ts; // Source file is always visible case 248 /* SourceFile */: return true; - // Export assignements do not create name bindings outside the module + // Export assignments do not create name bindings outside the module case 227 /* ExportAssignment */: return false; default: @@ -15814,6 +15983,23 @@ var ts; var symbol = getSymbolOfNode(node); return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node); } + function getTextOfPropertyName(name) { + switch (name.kind) { + case 69 /* Identifier */: + return name.text; + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + return name.text; + case 136 /* ComputedPropertyName */: + if (ts.isStringOrNumericLiteral(name.expression.kind)) { + return name.expression.text; + } + } + return undefined; + } + function isComputedNonLiteralName(name) { + return name.kind === 136 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); + } // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -15835,10 +16021,15 @@ var ts; if (pattern.kind === 161 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name_10)) { + // computed properties with non-literal names are treated as 'any' + return anyType; + } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - type = getTypeOfPropertyOfType(parentType, name_10.text) || - isNumericLiteralName(name_10.text) && getIndexTypeOfType(parentType, 1 /* Number */) || + var text = getTextOfPropertyName(name_10); + type = getTypeOfPropertyOfType(parentType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); if (!type) { error(name_10, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_10)); @@ -15938,10 +16129,17 @@ var ts; // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern, includePatternInType) { var members = {}; + var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + if (isComputedNonLiteralName(name)) { + // do not include computed properties in the implied type + hasComputedProperties = true; + return; + } + var text = getTextOfPropertyName(name); + var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); + var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType); symbol.bindingElement = e; members[symbol.name] = symbol; @@ -15950,6 +16148,9 @@ var ts; if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= 67108864 /* ObjectLiteralPatternWithComputedProperties */; + } return result; } // Return the type implied by an array binding pattern @@ -16026,6 +16227,14 @@ var ts; if (declaration.kind === 227 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } + // Handle module.exports = expr + if (declaration.kind === 181 /* BinaryExpression */) { + return links.type = checkExpression(declaration.right); + } + // Handle exports.p = expr + if (declaration.kind === 166 /* PropertyAccessExpression */) { + return checkExpressionCached(declaration.parent.right); + } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { return unknownType; @@ -16304,23 +16513,25 @@ var ts; } function resolveBaseTypesOfClass(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - var baseContructorType = getBaseConstructorTypeOfClass(type); - if (!(baseContructorType.flags & 80896 /* ObjectType */)) { + var baseConstructorType = getBaseConstructorTypeOfClass(type); + if (!(baseConstructorType.flags & 80896 /* ObjectType */)) { return; } var baseTypeNode = getBaseTypeNodeOfClass(type); var baseType; - if (baseContructorType.symbol && baseContructorType.symbol.flags & 32 /* Class */) { - // When base constructor type is a class we know that the constructors all have the same type parameters as the + var originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 /* Class */ && + areAllOuterTypeParametersApplied(originalBaseType)) { + // When base constructor type is a class with no captured type arguments we know that the constructors all have the same type parameters as the // class and all return the instance type of the class. There is no need for further checks and we can apply the // type arguments in the same manner as a type reference to get the same error reporting experience. - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseContructorType.symbol); + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - var constructors = getInstantiatedConstructorsForTypeArguments(baseContructorType, baseTypeNode.typeArguments); + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -16345,6 +16556,17 @@ var ts; type.resolvedBaseTypes.push(baseType); } } + function areAllOuterTypeParametersApplied(type) { + // An unapplied type parameter has its symbol still the same as the matching argument symbol. + // Since parameters are applied outer-to-inner, only the last outer parameter needs to be checked. + var outerTypeParameters = type.outerTypeParameters; + if (outerTypeParameters) { + var last = outerTypeParameters.length - 1; + var typeArguments = type.typeArguments; + return outerTypeParameters[last].symbol !== typeArguments[last].symbol; + } + return true; + } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { @@ -16424,7 +16646,7 @@ var ts; type.typeArguments = type.typeParameters; type.thisType = createType(512 /* TypeParameter */ | 33554432 /* ThisType */); type.thisType.symbol = symbol; - type.thisType.constraint = getTypeWithThisArgument(type); + type.thisType.constraint = type; } } return links.declaredType; @@ -16939,6 +17161,20 @@ var ts; type = getApparentType(type); return type.flags & 49152 /* UnionOrIntersection */ ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); } + /** + * The apparent type of a type parameter is the base constraint instantiated with the type parameter + * as the type argument for the 'this' type. + */ + function getApparentTypeOfTypeParameter(type) { + if (!type.resolvedApparentType) { + var constraintType = getConstraintOfTypeParameter(type); + while (constraintType && constraintType.flags & 512 /* TypeParameter */) { + constraintType = getConstraintOfTypeParameter(constraintType); + } + type.resolvedApparentType = getTypeWithThisArgument(constraintType || emptyObjectType, type); + } + return type.resolvedApparentType; + } /** * For a type parameter, return the base constraint of the type parameter. For the string, number, * boolean, and symbol primitive types, return the corresponding object types. Otherwise return the @@ -16946,12 +17182,7 @@ var ts; */ function getApparentType(type) { if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) { - type = emptyObjectType; - } + type = getApparentTypeOfTypeParameter(type); } if (type.flags & 258 /* StringLike */) { type = globalStringType; @@ -17116,7 +17347,7 @@ var ts; if (node.initializer) { var signatureDeclaration = node.parent; var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -17217,6 +17448,16 @@ var ts; } return result; } + function resolveExternalModuleTypeByLiteral(name) { + var moduleSym = resolveExternalModuleName(name, name); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { @@ -17740,11 +17981,12 @@ var ts; return links.resolvedType; } function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; + var text = node.text; + if (ts.hasProperty(stringLiteralTypes, text)) { + return stringLiteralTypes[text]; } - var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getTextOfNode(node); + var type = stringLiteralTypes[text] = createType(256 /* StringLiteral */); + type.text = text; return type; } function getTypeFromStringLiteral(node) { @@ -18265,7 +18507,7 @@ var ts; return false; } function hasExcessProperties(source, target, reportErrors) { - if (someConstituentTypeHasKind(target, 80896 /* ObjectType */)) { + if (!(target.flags & 67108864 /* ObjectLiteralPatternWithComputedProperties */) && someConstituentTypeHasKind(target, 80896 /* ObjectType */)) { for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { @@ -18358,9 +18600,6 @@ var ts; return result; } function typeParameterIdenticalTo(source, target) { - if (source.symbol.name !== target.symbol.name) { - return 0 /* False */; - } // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { return -1 /* True */; @@ -18852,18 +19091,29 @@ var ts; } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } + function isMatchingSignature(source, target, partialMatch) { + // A source signature matches a target signature if the two signatures have the same number of required, + // optional, and rest parameters. + if (source.parameters.length === target.parameters.length && + source.minArgumentCount === target.minArgumentCount && + source.hasRestParameter === target.hasRestParameter) { + return true; + } + // A source signature partially matches a target signature if the target signature has no fewer required + // parameters and no more overall parameters than the source signature (where a signature with a rest + // parameter is always considered to have more overall parameters than one without). + if (partialMatch && source.minArgumentCount <= target.minArgumentCount && (source.hasRestParameter && !target.hasRestParameter || + source.hasRestParameter === target.hasRestParameter && source.parameters.length >= target.parameters.length)) { + return true; + } + return false; + } function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1 /* True */; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { - if (!partialMatch || - source.parameters.length < target.parameters.length && !source.hasRestParameter || - source.minArgumentCount > target.minArgumentCount) { - return 0 /* False */; - } + if (!(isMatchingSignature(source, target, partialMatch))) { + return 0 /* False */; } var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { @@ -18957,6 +19207,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isStringLiteralType(type) { + return type.flags & 256 /* StringLiteral */; + } /** * Check if a Type was written as a tuple type literal. * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. @@ -19629,7 +19882,7 @@ var ts; } function narrowTypeByInstanceof(type, expr, assumeTrue) { // Check that type is not any, assumed result is true, and we have variable symbol on the left - if (isTypeAny(type) || !assumeTrue || expr.left.kind !== 69 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (isTypeAny(type) || expr.left.kind !== 69 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } // Check that right operand is a function type with a prototype property @@ -19660,6 +19913,12 @@ var ts; } } if (targetType) { + if (!assumeTrue) { + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); + } + return type; + } return getNarrowedType(type, targetType); } return type; @@ -20129,6 +20388,9 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); } + function contextualTypeIsStringLiteralType(type) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isStringLiteralType) : isStringLiteralType(type)); + } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -20150,7 +20412,7 @@ var ts; } function getContextualTypeForObjectLiteralElement(element) { var objectLiteral = element.parent; - var type = getContextualType(objectLiteral); + var type = getApparentTypeOfContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { // For a (non-symbol) computed property, there is no reason to look up the name @@ -20173,7 +20435,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); + var type = getApparentTypeOfContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) @@ -20206,11 +20468,28 @@ var ts; } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. - function getContextualType(node) { - var type = getContextualTypeWorker(node); + function getApparentTypeOfContextualType(node) { + var type = getContextualType(node); return type && getApparentType(type); } - function getContextualTypeWorker(node) { + /** + * Woah! Do you really want to use this function? + * + * Unless you're trying to get the *non-apparent* type for a + * value-literal type or you're authoring relevant portions of this algorithm, + * you probably meant to use 'getApparentTypeOfContextualType'. + * Otherwise this may not be very useful. + * + * In cases where you *are* working on this function, you should understand + * when it is appropriate to use 'getContextualType' and 'getApparentTypeOfContetxualType'. + * + * - Use 'getContextualType' when you are simply going to propagate the result to the expression. + * - Use 'getApparentTypeOfContextualType' when you're going to need the members of the type. + * + * @param node the expression whose contextual type will be returned. + * @returns the contextual type of an expression. + */ + function getContextualType(node) { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; @@ -20285,7 +20564,7 @@ var ts; ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + : getApparentTypeOfContextualType(node); if (!type) { return undefined; } @@ -20411,7 +20690,7 @@ var ts; type.pattern = node; return type; } - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting @@ -20494,10 +20773,11 @@ var ts; checkGrammarObjectLiteralExpression(node, inDestructuringPattern); var propertiesTable = {}; var propertiesArray = []; - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 161 /* ObjectBindingPattern */ || contextualType.pattern.kind === 165 /* ObjectLiteralExpression */); var typeFlags = 0; + var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; @@ -20525,8 +20805,11 @@ var ts; if (isOptional) { prop.flags |= 536870912 /* Optional */; } + if (ts.hasDynamicName(memberDecl)) { + patternWithComputedProperties = true; + } } - else if (contextualTypeHasPattern) { + else if (contextualTypeHasPattern && !(contextualType.flags & 67108864 /* ObjectLiteralPatternWithComputedProperties */)) { // If object literal is contextually typed by the implied type of a binding pattern, and if the // binding pattern specifies a default value for the property, make the property optional. var impliedProp = getPropertyOfType(contextualType, member.name); @@ -20578,7 +20861,7 @@ var ts; var numberIndexType = getIndexType(1 /* Number */); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 1048576 /* FreshObjectLiteral */; - result.flags |= 524288 /* ObjectLiteral */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */); + result.flags |= 524288 /* ObjectLiteral */ | 4194304 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 14680064 /* PropagatingFlags */) | (patternWithComputedProperties ? 67108864 /* ObjectLiteralPatternWithComputedProperties */ : 0); if (inDestructuringPattern) { result.pattern = node; } @@ -21289,7 +21572,7 @@ var ts; // so order how inherited signatures are processed is still preserved. // interface A { (x: string): void } // interface B extends A { (x: 'foo'): string } - // let b: B; + // const b: B; // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] function reorderCandidates(signatures, result) { var lastParent; @@ -22247,6 +22530,10 @@ var ts; return anyType; } } + // In JavaScript files, calls to any identifier 'require' are treated as external module imports + if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { @@ -22257,7 +22544,10 @@ var ts; var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { + // Permit 'number[] | "foo"' to be asserted to 'string'. + var bothAreStringLike = someConstituentTypeHasKind(targetType, 258 /* StringLike */) && + someConstituentTypeHasKind(widenedType, 258 /* StringLike */); + if (!bothAreStringLike && !(isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } @@ -22801,19 +23091,26 @@ var ts; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { - // TODO(andersh): Computed property support var name_13 = p.name; + if (name_13.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(name_13); + } + if (isComputedNonLiteralName(name_13)) { + continue; + } + var text = getTextOfPropertyName(name_13); var type = isTypeAny(sourceType) ? sourceType - : getTypeOfPropertyOfType(sourceType, name_13.text) || - isNumericLiteralName(name_13.text) && getIndexTypeOfType(sourceType, 1 /* Number */) || + : getTypeOfPropertyOfType(sourceType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { if (p.kind === 246 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { - checkDestructuringAssignment(p.initializer || name_13, type); + // non-shorthand property assignments should always have initializers + checkDestructuringAssignment(p.initializer, type); } } else { @@ -23014,6 +23311,10 @@ var ts; case 31 /* ExclamationEqualsToken */: case 32 /* EqualsEqualsEqualsToken */: case 33 /* ExclamationEqualsEqualsToken */: + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (someConstituentTypeHasKind(leftType, 258 /* StringLike */) && someConstituentTypeHasKind(rightType, 258 /* StringLike */)) { + return booleanType; + } if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } @@ -23137,6 +23438,13 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkStringLiteralExpression(node) { + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { + return getStringLiteralType(node); + } + return stringType; + } function checkTemplateExpression(node) { // We just want to check each expressions, but we are unconcerned with // the type of each expression, as any value may be coerced into a string. @@ -23187,7 +23495,7 @@ var ts; if (isInferentialContext(contextualMapper)) { var signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); + var contextualType = getApparentTypeOfContextualType(node); if (contextualType) { var contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { @@ -23251,6 +23559,7 @@ var ts; case 183 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: + return checkStringLiteralExpression(node); case 11 /* NoSubstitutionTemplateLiteral */: return stringType; case 10 /* RegularExpressionLiteral */: @@ -24580,7 +24889,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 248 /* SourceFile */ && ts.isExternalModule(parent)) { + if (parent.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -24598,15 +24907,15 @@ var ts; // A non-initialized declaration is a no-op as the block declaration will resolve before the var // declaration. the problem is if the declaration has an initializer. this will act as a write to the // block declared value. this is fine for let, but not const. - // Only consider declarations with initializers, uninitialized let declarations will not + // Only consider declarations with initializers, uninitialized const declarations will not // step on a let/const variable. - // Do not consider let and const declarations, as duplicate block-scoped declarations + // Do not consider const and const declarations, as duplicate block-scoped declarations // are handled by the binder. - // We are only looking for let declarations that step on let\const declarations from a + // We are only looking for const declarations that step on let\const declarations from a // different scope. e.g.: // { // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration - // let x = 0; // symbol for this declaration will be 'symbol' + // const x = 0; // symbol for this declaration will be 'symbol' // } // skip block-scoped variables and parameters if ((ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) !== 0 || ts.isParameterDeclaration(node)) { @@ -24693,6 +25002,12 @@ var ts; checkExpressionCached(node.initializer); } } + if (node.kind === 163 /* BindingElement */) { + // check computed properties inside property names of binding elements + if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(node.propertyName); + } + } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); @@ -25176,6 +25491,7 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); + var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause if (clause.kind === 242 /* DefaultClause */ && !hasDuplicateDefaultClause) { @@ -25195,6 +25511,10 @@ var ts; // 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(caseClause.expression); + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) { + return; + } if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined); @@ -25659,11 +25979,14 @@ var ts; var enumIsConst = ts.isConst(node); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.name.kind === 136 /* ComputedPropertyName */) { + if (isComputedNonLiteralName(member.name)) { error(member.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } - else if (isNumericLiteralName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + else { + var text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } } var previousEnumMemberIsNonConstant = autoValue === undefined; var initializer = member.initializer; @@ -26305,8 +26628,8 @@ var ts; } // Function and class expression bodies are checked after all statements in the enclosing body. This is // to ensure constructs like the following are permitted: - // let foo = function () { - // let s = foo(); + // const foo = function () { + // const s = foo(); // return "hello"; // } // Here, performing a full type check of the body of the function expression whilst in the process of @@ -26421,8 +26744,12 @@ var ts; if (!(links.flags & 1 /* TypeChecked */)) { // Check whether the file has declared it is the default lib, // and whether the user has specifically chosen to avoid checking it. - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; + if (compilerOptions.skipDefaultLibCheck) { + // If the user specified '--noLib' and a file has a '/// ', + // then we should treat that file as a default lib. + if (node.hasNoDefaultLib) { + return; + } } // Grammar checking checkGrammarSourceFile(node); @@ -26432,7 +26759,7 @@ var ts; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (ts.isExternalModule(node)) { + if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } if (potentialThisCollisions.length) { @@ -26515,7 +26842,7 @@ var ts; } switch (location.kind) { case 248 /* SourceFile */: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalOrCommonJsModule(location)) { break; } case 218 /* ModuleDeclaration */: @@ -27153,9 +27480,18 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, - isArgumentsLocalBinding: isArgumentsLocalBinding + isArgumentsLocalBinding: isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; } + function getExternalModuleFileFromDeclaration(declaration) { + var specifier = ts.getExternalModuleName(declaration); + var moduleSymbol = getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return undefined; + } + return ts.getDeclarationOfKind(moduleSymbol, 248 /* SourceFile */); + } function initializeTypeChecker() { // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { @@ -27163,11 +27499,10 @@ var ts; }); // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { + if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } }); - // Initialize special symbols getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; @@ -27866,7 +28201,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 136 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (ts.isDynamicName(node)) { return grammarErrorOnNode(node, message); } } @@ -28225,11 +28560,15 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; - var currentSourceFile; + var currentText; + var currentLineMap; + var currentIdentifiers; + var isCurrentFileExternalModule; var reportedDeclarationError = false; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; + var noDeclare = !root; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; // Contains the reference paths that needs to go in the declaration file. @@ -28272,23 +28611,56 @@ var ts; else { // Emit references corresponding to this file var emittedReferencedFiles = []; + var prevModuleElementDeclarationEmitInfo = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isDeclarationFile(sourceFile)) { // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && + // If the reference file is a declaration file, emit that reference + if (referencedFile && (ts.isDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } }); } + } + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + noDeclare = false; emitSourceFile(sourceFile); } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + // create asynchronous output for the importDeclarations + if (moduleElementDeclarationEmitInfo.length) { + var oldWriter = writer; + ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); + createAndSetNewTextWriterWithSymbolWriter(); + ts.Debug.assert(aliasEmitInfo.indent === 1); + increaseIndent(); + writeImportDeclaration(aliasEmitInfo.node); + aliasEmitInfo.asynchronousOutput = writer.getText(); + decreaseIndent(); + } + }); + setWriter(oldWriter); + } + prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; + } }); + moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); } return { reportedDeclarationError: reportedDeclarationError, @@ -28297,13 +28669,12 @@ var ts; referencePathsOutput: referencePathsOutput }; function hasInternalAnnotation(range) { - var text = currentSourceFile.text; - var comment = text.substring(range.pos, range.end); + var comment = currentText.substring(range.pos, range.end); return comment.indexOf("@internal") >= 0; } function stripInternal(node) { if (node) { - var leadingCommentRanges = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); + var leadingCommentRanges = ts.getLeadingCommentRanges(currentText, node.pos); if (ts.forEach(leadingCommentRanges, hasInternalAnnotation)) { return; } @@ -28395,7 +28766,7 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -28461,10 +28832,10 @@ var ts; } function writeJsDocComments(declaration) { if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + var jsDocComments = ts.getJsDocCommentsFromText(declaration, currentText); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, declaration, jsDocComments); // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, jsDocComments, /*trailingSeparator*/ true, newLine, ts.writeCommentRange); + ts.emitComments(currentText, currentLineMap, writer, jsDocComments, /*trailingSeparator*/ true, newLine, ts.writeCommentRange); } } function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { @@ -28481,7 +28852,7 @@ var ts; case 103 /* VoidKeyword */: case 97 /* ThisKeyword */: case 9 /* StringLiteral */: - return writeTextOfNode(currentSourceFile, type); + return writeTextOfNode(currentText, type); case 188 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); case 151 /* TypeReference */: @@ -28512,14 +28883,14 @@ var ts; } function writeEntityName(entityName) { if (entityName.kind === 69 /* Identifier */) { - writeTextOfNode(currentSourceFile, entityName); + writeTextOfNode(currentText, entityName); } else { var left = entityName.kind === 135 /* QualifiedName */ ? entityName.left : entityName.expression; var right = entityName.kind === 135 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, right); + writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { @@ -28549,7 +28920,7 @@ var ts; } } function emitTypePredicate(type) { - writeTextOfNode(currentSourceFile, type.parameterName); + writeTextOfNode(currentText, type.parameterName); write(" is "); emitType(type.type); } @@ -28590,9 +28961,12 @@ var ts; } } function emitSourceFile(node) { - currentSourceFile = node; + currentText = node.text; + currentLineMap = ts.getLineStarts(node); + currentIdentifiers = node.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(node); enclosingDeclaration = node; - ts.emitDetachedComments(currentSourceFile, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); + ts.emitDetachedComments(currentText, currentLineMap, writer, ts.writeCommentRange, node, newLine, true /* remove comments */); emitLines(node.statements); } // Return a temp variable name to be used in `export default` statements. @@ -28601,13 +28975,13 @@ var ts; // do not need to keep track of created temp names. function getExportDefaultTempVariableName() { var baseName = "_default"; - if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + if (!ts.hasProperty(currentIdentifiers, baseName)) { return baseName; } var count = 0; while (true) { var name_18 = baseName + "_" + (++count); - if (!ts.hasProperty(currentSourceFile.identifiers, name_18)) { + if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } } @@ -28615,7 +28989,7 @@ var ts; function emitExportAssignment(node) { if (node.expression.kind === 69 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + writeTextOfNode(currentText, node.expression); } else { // Expression @@ -28653,7 +29027,7 @@ var ts; writeModuleElement(node); } else if (node.kind === 221 /* ImportEqualsDeclaration */ || - (node.parent.kind === 248 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { + (node.parent.kind === 248 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot @@ -28707,7 +29081,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent === currentSourceFile) { + if (node.parent.kind === 248 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -28715,7 +29089,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 215 /* InterfaceDeclaration */) { + else if (node.kind !== 215 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -28742,7 +29116,7 @@ var ts; write("export "); } write("import "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" = "); if (ts.isInternalModuleImportEqualsDeclaration(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); @@ -28750,7 +29124,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentSourceFile, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); write(");"); } writer.writeLine(); @@ -28785,7 +29159,7 @@ var ts; if (node.importClause) { var currentWriterPos = writer.getTextPos(); if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { - writeTextOfNode(currentSourceFile, node.importClause.name); + writeTextOfNode(currentText, node.importClause.name); } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { @@ -28794,7 +29168,7 @@ var ts; } if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { write("* as "); - writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); + writeTextOfNode(currentText, node.importClause.namedBindings.name); } else { write("{ "); @@ -28804,16 +29178,28 @@ var ts; } write(" from "); } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier) { + if (moduleSpecifier.kind === 9 /* StringLiteral */ && (!root) && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + if (moduleName) { + write("\""); + write(moduleName); + write("\""); + return; + } + } + writeTextOfNode(currentText, moduleSpecifier); + } function emitImportOrExportSpecifier(node) { if (node.propertyName) { - writeTextOfNode(currentSourceFile, node.propertyName); + writeTextOfNode(currentText, node.propertyName); write(" as "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); @@ -28835,7 +29221,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -28849,11 +29235,11 @@ var ts; else { write("module "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); while (node.body.kind !== 219 /* ModuleBlock */) { node = node.body; write("."); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -28872,7 +29258,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("type "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); emitTypeParameters(node.typeParameters); write(" = "); emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); @@ -28894,7 +29280,7 @@ var ts; write("const "); } write("enum "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" {"); writeLine(); increaseIndent(); @@ -28905,7 +29291,7 @@ var ts; } function emitEnumMemberDeclaration(node) { emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var enumMemberValue = resolver.getConstantValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -28922,7 +29308,7 @@ var ts; increaseIndent(); emitJsDocComments(node); decreaseIndent(); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); @@ -29037,7 +29423,7 @@ var ts; write("abstract "); } write("class "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -29060,7 +29446,7 @@ var ts; emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("interface "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -29095,7 +29481,7 @@ var ts; // If this node is a computed name, it can only be a symbol, because we've already skipped // it if it's not a well known symbol. In that case, the text of the name will be exactly // what we want, namely the name expression enclosed in brackets. - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If optional property emit ? if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); @@ -29177,7 +29563,7 @@ var ts; emitBindingPattern(bindingElement.name); } else { - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); writeTypeOfDeclaration(bindingElement, /*type*/ undefined, getBindingElementTypeVisibilityError); } } @@ -29221,7 +29607,7 @@ var ts; emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (!(node.flags & 16 /* Private */)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); @@ -29307,13 +29693,13 @@ var ts; } if (node.kind === 213 /* FunctionDeclaration */) { write("function "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } else if (node.kind === 144 /* Constructor */) { write("constructor"); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (ts.hasQuestionToken(node)) { write("?"); } @@ -29437,7 +29823,7 @@ var ts; emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } if (resolver.isOptionalParameter(node)) { write("?"); @@ -29552,7 +29938,7 @@ var ts; // Example: // original: function foo({y: [a,b,c]}) {} // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; - writeTextOfNode(currentSourceFile, bindingElement.propertyName); + writeTextOfNode(currentText, bindingElement.propertyName); write(": "); } if (bindingElement.name) { @@ -29575,7 +29961,7 @@ var ts; if (bindingElement.dotDotDotToken) { write("..."); } - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); } } } @@ -29667,6 +30053,18 @@ var ts; return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function getResolvedExternalModuleName(host, file) { + return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); + } + ts.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || ts.isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); + } + ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; var Jump; (function (Jump) { Jump[Jump["Break"] = 2] = "Break"; @@ -29954,15 +30352,19 @@ var ts; var newLine = host.getNewLine(); var jsxDesugaring = host.getCompilerOptions().jsx !== 1 /* Preserve */; var shouldEmitJsx = function (s) { return (s.languageVariant === 1 /* JSX */ && !jsxDesugaring); }; + var outFile = compilerOptions.outFile || compilerOptions.out; + var emitJavaScript = createFileEmitter(); if (targetSourceFile === undefined) { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.outFile || compilerOptions.out) { - emitFile(compilerOptions.outFile || compilerOptions.out); + if (outFile) { + emitFile(outFile); + } + else { + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); + emitFile(jsFilePath, sourceFile); + } + }); } } else { @@ -29971,8 +30373,8 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); emitFile(jsFilePath, targetSourceFile); } - else if (!ts.isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) { - emitFile(compilerOptions.outFile || compilerOptions.out); + else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { + emitFile(outFile); } } // Sort and make the unique list of diagnostics @@ -30024,10 +30426,16 @@ var ts; } } } - function emitJavaScript(jsFilePath, root) { + function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var currentText; + var currentLineMap; + var currentFileIdentifiers; + var renamedDependencies; + var isEs6Module; + var isCurrentFileExternalModule; // name of an exporter function if file is a System external module // System.register([...], function () {...}) // exporting in System modules looks like: @@ -30035,15 +30443,15 @@ var ts; // => // var x;... exporter("x", x = 1) var exportFunctionForFile; - var generatedNameSet = {}; - var nodeToGeneratedName = []; + var generatedNameSet; + var nodeToGeneratedName; var computedPropertyNamesToGeneratedNames; var convertedLoopState; - var extendsEmitted = false; - var decorateEmitted = false; - var paramEmitted = false; - var awaiterEmitted = false; - var tempFlags = 0; + var extendsEmitted; + var decorateEmitted; + var paramEmitted; + var awaiterEmitted; + var tempFlags; var tempVariables; var tempParameters; var externalImports; @@ -30075,6 +30483,8 @@ var ts; var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; + /** The root file passed to the emit function (if present) */ + var root; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, @@ -30085,31 +30495,77 @@ var ts; _a[1 /* CommonJS */] = emitCommonJSModule, _a ); - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); + var bundleEmitDelegates = (_b = {}, + _b[5 /* ES6 */] = function () { }, + _b[2 /* AMD */] = emitAMDModule, + _b[4 /* System */] = emitSystemModule, + _b[3 /* UMD */] = function () { }, + _b[1 /* CommonJS */] = function () { }, + _b + ); + return doEmit; + function doEmit(jsFilePath, rootFile) { + // reset the state + writer.reset(); + currentSourceFile = undefined; + currentText = undefined; + currentLineMap = undefined; + exportFunctionForFile = undefined; + generatedNameSet = {}; + nodeToGeneratedName = []; + computedPropertyNamesToGeneratedNames = undefined; + convertedLoopState = undefined; + extendsEmitted = false; + decorateEmitted = false; + paramEmitted = false; + awaiterEmitted = false; + tempFlags = 0; + tempVariables = undefined; + tempParameters = undefined; + externalImports = undefined; + exportSpecifiers = undefined; + exportEquals = undefined; + hasExportStars = undefined; + detachedCommentsInfo = undefined; + sourceMapData = undefined; + isEs6Module = false; + renamedDependencies = undefined; + isCurrentFileExternalModule = false; + root = rootFile; + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { + initializeEmitterWithSourceMaps(jsFilePath, root); + } + if (root) { + // Do not call emit directly. It does not set the currentSourceFile. + emitSourceFile(root); + } + else { + if (modulekind) { + ts.forEach(host.getSourceFiles(), emitEmitHelpers); } - }); + ts.forEach(host.getSourceFiles(), function (sourceFile) { + if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { + emitSourceFile(sourceFile); + } + }); + } + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); } - writeLine(); - writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM); - return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + currentText = sourceFile.text; + currentLineMap = ts.getLineStarts(sourceFile); exportFunctionForFile = undefined; + isEs6Module = sourceFile.symbol && sourceFile.symbol.exports && !!sourceFile.symbol.exports["___esModule"]; + renamedDependencies = sourceFile.renamedDependencies; + currentFileIdentifiers = sourceFile.identifiers; + isCurrentFileExternalModule = ts.isExternalModule(sourceFile); emit(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentSourceFile.identifiers, name) && + !ts.hasProperty(currentFileIdentifiers, name) && !ts.hasProperty(generatedNameSet, name); } // Return the next available name in the pattern _a ... _z, _0, _1, ... @@ -30192,7 +30648,7 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps() { + function initializeEmitterWithSourceMaps(jsFilePath, root) { var sourceMapDir; // The directory in which sourcemap will be // Current source map file and its index in the sources list var sourceMapSourceIndex = -1; @@ -30280,7 +30736,7 @@ var ts; } } function recordSourceMapSpan(pos) { - var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); // Convert the location to be one-based. sourceLinePos.line++; sourceLinePos.character++; @@ -30314,13 +30770,13 @@ var ts; } function recordEmitNodeStartSpan(node) { // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); + recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); } function recordEmitNodeEndSpan(node) { recordSourceMapSpan(node.end); } function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + var tokenStartPos = ts.skipTrivia(currentText, startPos); recordSourceMapSpan(tokenStartPos); var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); recordSourceMapSpan(tokenEndPos); @@ -30402,9 +30858,9 @@ var ts; sourceMapNameIndices.pop(); } ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { + function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentSourceFile, writer, comment, newLine); + ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); recordSourceMapSpan(comment.end); } function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { @@ -30434,7 +30890,7 @@ var ts; return output; } } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); @@ -30450,7 +30906,7 @@ var ts; sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; } // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); } // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); @@ -30522,7 +30978,7 @@ var ts; scopeEmitEnd = recordScopeNameEnd; writeComment = writeCommentRangeWithMap; } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { + function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } // Create a temporary variable with a unique unused name. @@ -30702,7 +31158,7 @@ var ts; // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. if (node.parent) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + return ts.getTextOfNodeFromSourceText(currentText, node); } // If we can't reach the original source text, use the canonical form if it's a number, // or an escaped quoted form of the original text if it's string-like. @@ -30729,7 +31185,7 @@ var ts; // Find original source text, since we need to emit the raw strings of the tagged template. // The raw strings contain the (escaped) strings of what the user wrote. // Examples: `\n` is converted to "\\n", a template string with a newline to "\n". - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + var text = ts.getTextOfNodeFromSourceText(currentText, node); // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"), // thus we need to remove those characters. // First template piece starts with "`", others with "}" @@ -31146,7 +31602,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } write("\""); } @@ -31246,7 +31702,7 @@ var ts; // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name_23); + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -31270,7 +31726,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function isNameOfNestedRedeclaration(node) { @@ -31308,7 +31764,7 @@ var ts; write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } function emitThis(node) { @@ -31712,7 +32168,7 @@ var ts; function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here // we manually emit the identifier to avoid rewriting. - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); // If emitting pre-ES6 code, or if the name requires rewriting when resolved as an expression identifier, // we emit a normal property assignment. For example: // module m { @@ -31722,7 +32178,7 @@ var ts; // let obj = { y }; // } // Here we need to emit obj = { y : m.y } regardless of the output target. - if (languageVersion < 2 /* ES6 */ || isNamespaceExportReference(node.name)) { + if (modulekind !== 5 /* ES6 */ || isNamespaceExportReference(node.name)) { // Emit identifier as an identifier write(": "); emit(node.name); @@ -31779,11 +32235,11 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); // 1 .toString is a valid property access, emit a space after the literal // Also emit a space if expression is a integer const enum value - it will appear in generated code as numeric literal - var shouldEmitSpace; + var shouldEmitSpace = false; if (!indentedBeforeDot) { if (node.expression.kind === 8 /* NumericLiteral */) { // check if numeric literal was originally written with a dot - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node.expression); + var text = ts.getTextOfNodeFromSourceText(currentText, node.expression); shouldEmitSpace = text.indexOf(ts.tokenToString(21 /* DotToken */)) < 0; } else { @@ -32962,16 +33418,16 @@ var ts; emitToken(16 /* CloseBraceToken */, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node1.pos)) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, node2.end); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return ts.getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { if (node.kind === 241 /* CaseClause */) { @@ -33077,7 +33533,7 @@ var ts; ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 227 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { - if (!currentSourceFile.symbol.exports["___esModule"]) { + if (!isEs6Module) { if (languageVersion === 1 /* ES5 */) { // default value of configurable, enumerable, writable are `false`. write("Object.defineProperty(exports, \"__esModule\", { value: true });"); @@ -33272,14 +33728,20 @@ var ts; return node; } function createPropertyAccessForDestructuringProperty(object, propName) { - // We create a synthetic copy of the identifier in order to avoid the rewriting that might - // otherwise occur when the identifier is emitted. - var syntheticName = ts.createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== 69 /* Identifier */) { - return createElementAccessExpression(object, syntheticName); + var index; + var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; + if (nameIsComputed) { + index = ensureIdentifier(propName.expression, /* reuseIdentifierExpression */ false); } - return createPropertyAccessExpression(object, syntheticName); + else { + // We create a synthetic copy of the identifier in order to avoid the rewriting that might + // otherwise occur when the identifier is emitted. + index = ts.createSynthesizedNode(propName.kind); + index.text = propName.text; + } + return !nameIsComputed && index.kind === 69 /* Identifier */ + ? createPropertyAccessExpression(object, index) + : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { var call = ts.createSynthesizedNode(168 /* CallExpression */); @@ -33742,7 +34204,6 @@ var ts; var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); var isArrowFunction = node.kind === 174 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; - var args; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current // `this` and `arguments` objects to `__awaiter`. The generator function @@ -35197,8 +35658,8 @@ var ts; * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName) { - if (currentSourceFile.renamedDependencies && ts.hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { - return "\"" + currentSourceFile.renamedDependencies[moduleName.text] + "\""; + if (renamedDependencies && ts.hasProperty(renamedDependencies, moduleName.text)) { + return "\"" + renamedDependencies[moduleName.text] + "\""; } return undefined; } @@ -35351,7 +35812,7 @@ var ts; // - current file is not external module // - import declaration is top level and target is value imported by entity name if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + (!isCurrentFileExternalModule && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); // variable declaration for import-equals declaration can be hoisted in system modules @@ -35579,7 +36040,7 @@ var ts; function getLocalNameForExternalImport(node) { var namespaceDeclaration = getNamespaceDeclarationNode(node); if (namespaceDeclaration && !isDefaultImport(node)) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } if (node.kind === 222 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); @@ -35884,7 +36345,7 @@ var ts; ts.getEnclosingBlockScopeContainer(node).kind === 248 /* SourceFile */; } function isCurrentFileSystemExternalModule() { - return modulekind === 4 /* System */ && ts.isExternalModule(currentSourceFile); + return modulekind === 4 /* System */ && isCurrentFileExternalModule; } function emitSystemModuleBody(node, dependencyGroups, startIndex) { // shape of the body in system modules: @@ -36054,7 +36515,13 @@ var ts; writeLine(); write("}"); // execute } - function emitSystemModule(node) { + function writeModuleName(node, emitRelativePathAsModuleName) { + var moduleName = node.moduleName; + if (moduleName || (emitRelativePathAsModuleName && (moduleName = getResolvedExternalModuleName(host, node)))) { + write("\"" + moduleName + "\", "); + } + } + function emitSystemModule(node, emitRelativePathAsModuleName) { collectExternalModuleInfo(node); // System modules has the following shape // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) @@ -36069,9 +36536,7 @@ var ts; exportFunctionForFile = makeUniqueName("exports"); writeLine(); write("System.register("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } + writeModuleName(node, emitRelativePathAsModuleName); write("["); var groupIndices = {}; var dependencyGroups = []; @@ -36090,6 +36555,12 @@ var ts; if (i !== 0) { write(", "); } + if (emitRelativePathAsModuleName) { + var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); + if (name_29) { + text = "\"" + name_29 + "\""; + } + } write(text); } write("], function(" + exportFunctionForFile + ") {"); @@ -36103,7 +36574,7 @@ var ts; writeLine(); write("});"); } - function getAMDDependencyNames(node, includeNonAmdDependencies) { + function getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { // names of modules with corresponding parameter in the factory function var aliasedModuleNames = []; // names of modules with no corresponding parameters in factory function @@ -36126,6 +36597,12 @@ var ts; var importNode = externalImports_4[_c]; // Find the name of the external module var externalModuleName = getExternalModuleNameText(importNode); + if (emitRelativePathAsModuleName) { + var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_30) { + externalModuleName = "\"" + name_30 + "\""; + } + } // Find the name of the module alias, if there is one var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { @@ -36138,7 +36615,7 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } - function emitAMDDependencies(node, includeNonAmdDependencies) { + function emitAMDDependencies(node, includeNonAmdDependencies, emitRelativePathAsModuleName) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // @@ -36150,7 +36627,7 @@ var ts; // To ensure this is true in cases of modules with no aliases, e.g.: // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies); + var dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName); emitAMDDependencyList(dependencyNames); write(", "); emitAMDFactoryHeader(dependencyNames); @@ -36177,15 +36654,13 @@ var ts; } write(") {"); } - function emitAMDModule(node) { + function emitAMDModule(node, emitRelativePathAsModuleName) { emitEmitHelpers(node); collectExternalModuleInfo(node); writeLine(); write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, /*includeNonAmdDependencies*/ true); + writeModuleName(node, emitRelativePathAsModuleName); + emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName); increaseIndent(); var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); emitExportStarHelper(); @@ -36404,8 +36879,13 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; - emitModule(node); + if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; + emitModule(node); + } + else { + bundleEmitDelegates[modulekind](node, /*emitRelativePathAsModuleName*/ true); + } } else { // emit prologue directives prior to __extends @@ -36666,7 +37146,7 @@ var ts; } function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentText, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -36683,10 +37163,10 @@ var ts; function isTripleSlashComment(comment) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && + if (currentText.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */) { - var textSubStr = currentSourceFile.text.substring(comment.pos, comment.end); + currentText.charCodeAt(comment.pos + 2) === 47 /* slash */) { + var textSubStr = currentText.substring(comment.pos, comment.end); return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? true : false; @@ -36703,7 +37183,7 @@ var ts; } else { // get the leading comments from the node - return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); + return ts.getLeadingCommentRangesOfNodeFromText(node, currentText); } } } @@ -36712,7 +37192,7 @@ var ts; // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { if (node.parent.kind === 248 /* SourceFile */ || node.end !== node.parent.end) { - return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); + return ts.getTrailingCommentRanges(currentText, node.end); } } } @@ -36746,9 +37226,9 @@ var ts; leadingComments = ts.filter(getLeadingCommentsToEmit(node), isTripleSlashComment); } } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { @@ -36757,7 +37237,7 @@ var ts; // Emit the trailing comments only if the parent's end doesn't match var trailingComments = getTrailingCommentsToEmit(node); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - ts.emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); } /** * Emit trailing comments at the position. The term trailing comment is used here to describe following comment: @@ -36768,9 +37248,9 @@ var ts; if (compilerOptions.removeComments) { return; } - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, pos); + var trailingComments = ts.getTrailingCommentRanges(currentText, pos); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - ts.emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitLeadingCommentsOfPositionWorker(pos) { if (compilerOptions.removeComments) { @@ -36783,14 +37263,14 @@ var ts; } else { // get the leading comments from the node - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentText, pos); } - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAndUpdateCommentsInfo(node) { - var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, compilerOptions.removeComments); + var currentDetachedCommentInfo = ts.emitDetachedComments(currentText, currentLineMap, writer, writeComment, node, newLine, compilerOptions.removeComments); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -36801,12 +37281,12 @@ var ts; } } function emitShebang() { - var shebang = ts.getShebang(currentSourceFile.text); + var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); } } - var _a; + var _a, _b; } function emitFile(jsFilePath, sourceFile) { emitJavaScript(jsFilePath, sourceFile); @@ -36866,11 +37346,11 @@ var ts; if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -36880,8 +37360,8 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(candidate, failedLookupLocation, host) { - return ts.forEach(ts.moduleFileExtensions, tryLoad); + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; if (host.fileExists(fileName)) { @@ -36893,7 +37373,7 @@ var ts; } } } - function loadNodeModuleFromDirectory(candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); if (host.fileExists(packageJsonPath)) { var jsonContent; @@ -36906,7 +37386,7 @@ var ts; jsonContent = { typings: undefined }; } if (jsonContent.typings) { - var result = loadNodeModuleFromFile(ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); if (result) { return result; } @@ -36916,7 +37396,7 @@ var ts; // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -36926,11 +37406,11 @@ var ts; if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -36956,9 +37436,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; + var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(ts.supportedExtensions, function (extension) { + referencedSourceFile = ts.forEach(extensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { // resolve .tsx files only if jsx support is enabled // 'logical not' handles both undefined and None cases @@ -36989,10 +37470,8 @@ var ts; /* @internal */ ts.defaultInitCompilerOptions = { module: 1 /* CommonJS */, - target: 0 /* ES3 */, + target: 1 /* ES5 */, noImplicitAny: false, - outDir: "built", - rootDir: ".", sourceMap: false }; function createCompilerHost(options, setParentNodes) { @@ -37397,43 +37876,55 @@ var ts; if (file.imports) { return; } + var isJavaScriptFile = ts.isSourceFileJavaScript(file); var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /* allowRelativeModuleNames */ true); + collect(node, /* allowRelativeModuleNames */ true, /* collectOnlyRequireCalls */ false); } file.imports = imports || emptyArray; - function collect(node, allowRelativeModuleNames) { - switch (node.kind) { - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { + return; + function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { + if (!collectOnlyRequireCalls) { + switch (node.kind) { + case 222 /* ImportDeclaration */: + case 221 /* ImportEqualsDeclaration */: + case 228 /* ExportDeclaration */: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { + break; + } + if (!moduleNameExpr.text) { + break; + } + if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } - break; - case 218 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { - // 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 - ts.forEachChild(node.body, function (node) { + case 218 /* ModuleDeclaration */: + if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { // 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. - collect(node, /* allowRelativeModuleNames */ false); - }); - } - break; + // 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 + ts.forEachChild(node.body, function (node) { + // 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. + collect(node, /* allowRelativeModuleNames */ false, collectOnlyRequireCalls); + }); + } + break; + } + } + if (isJavaScriptFile) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /* collectOnlyRequireCalls */ true); }); + } } } } @@ -37526,7 +38017,6 @@ var ts; // always process imported modules to record module name resolutions processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -37604,6 +38094,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (!commonPathComponents) { + return currentDirectory; + } return ts.getNormalizedPathFromPathComponents(commonPathComponents); } function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { @@ -37689,12 +38182,15 @@ var ts; if (options.module === 5 /* ES6 */ && languageVersion < 2 /* ES6 */) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); } + // Cannot specify module gen that isn't amd or system with --out + if (outFile && options.module && !(options.module === 2 /* AMD */ || options.module === 4 /* System */)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile")); + } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted if (options.outDir || options.sourceRoot || - (options.mapRoot && - (!outFile || firstExternalModuleSourceFile !== undefined))) { + options.mapRoot) { if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); @@ -38212,20 +38708,20 @@ var ts; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); for (var i = 0; i < sysFiles.length; i++) { - var name_29 = sysFiles[i]; - if (ts.fileExtensionIs(name_29, ".d.ts")) { - var baseName = name_29.substr(0, name_29.length - ".d.ts".length); + var name_31 = sysFiles[i]; + if (ts.fileExtensionIs(name_31, ".d.ts")) { + var baseName = name_31.substr(0, name_31.length - ".d.ts".length); if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_29); + fileNames.push(name_31); } } - else if (ts.fileExtensionIs(name_29, ".ts")) { - if (!ts.contains(sysFiles, name_29 + "x")) { - fileNames.push(name_29); + else if (ts.fileExtensionIs(name_31, ".ts")) { + if (!ts.contains(sysFiles, name_31 + "x")) { + fileNames.push(name_31); } } else { - fileNames.push(name_29); + fileNames.push(name_31); } } } @@ -38453,12 +38949,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_30 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_30); + for (var name_32 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_32); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_30); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); if (!matches) { continue; } @@ -38471,14 +38967,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_30); + matches = patternMatcher.getMatches(containers, name_32); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_30, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -38859,9 +39355,9 @@ var ts; case 211 /* VariableDeclaration */: case 163 /* BindingElement */: var variableDeclarationNode; - var name_31; + var name_33; if (node.kind === 163 /* BindingElement */) { - name_31 = node.name; + name_33 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration @@ -38873,16 +39369,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_31 = node.name; + name_33 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_31), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); } case 144 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -39802,7 +40298,7 @@ var ts; if (!candidates.length) { // We didn't have any sig help items produced by the TS compiler. If this is a JS // file, then see if we can figure out anything better. - if (ts.isJavaScript(sourceFile.fileName)) { + if (ts.isSourceFileJavaScript(sourceFile)) { return createJavaScriptSignatureHelpItems(argumentInfo); } return undefined; @@ -41662,9 +42158,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_32 in o) { - if (o[name_32] === rule) { - return name_32; + for (var name_34 in o) { + if (o[name_34] === rule) { + return name_34; } } throw new Error("Unknown rule"); @@ -42096,7 +42592,7 @@ var ts; function TokenRangeAccess(from, to, except) { this.tokens = []; for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { + if (ts.indexOf(except, token) < 0) { this.tokens.push(token); } } @@ -43709,13 +44205,18 @@ var ts; ]; var jsDocCompletionEntries; function createNode(kind, pos, end, flags, parent) { - var node = new (ts.getNodeConstructor(kind))(pos, end); + var node = new NodeObject(kind, pos, end); node.flags = flags; node.parent = parent; return node; } var NodeObject = (function () { - function NodeObject() { + function NodeObject(kind, pos, end) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = 0 /* None */; + this.parent = undefined; } NodeObject.prototype.getSourceFile = function () { return ts.getSourceFileOfNode(this); @@ -44198,8 +44699,8 @@ var ts; })(); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); - function SourceFileObject() { - _super.apply(this, arguments); + function SourceFileObject(kind, pos, end) { + _super.call(this, kind, pos, end); } SourceFileObject.prototype.update = function (newText, textChangeRange) { return ts.updateSourceFile(this, newText, textChangeRange); @@ -44521,6 +45022,9 @@ var ts; ClassificationTypeNames.typeAliasName = "type alias name"; ClassificationTypeNames.parameterName = "parameter name"; ClassificationTypeNames.docCommentTagName = "doc comment tag name"; + ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; + ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; + ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -44543,6 +45047,9 @@ var ts; ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; })(ts.ClassificationType || (ts.ClassificationType = {})); var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { @@ -44922,8 +45429,9 @@ var ts; }; } ts.createDocumentRegistry = createDocumentRegistry; - function preProcessFile(sourceText, readImportFiles) { + function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { if (readImportFiles === void 0) { readImportFiles = true; } + if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; } var referencedFiles = []; var importedFiles = []; var ambientExternalModules; @@ -44957,9 +45465,207 @@ var ts; end: pos + importPath.length }); } - function processImport() { + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeDeclare() { + var token = scanner.getToken(); + if (token === 122 /* DeclareKeyword */) { + // declare module "mod" + token = scanner.scan(); + if (token === 125 /* ModuleKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + recordAmbientExternalModule(); + } + } + return true; + } + return false; + } + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeImport() { + var token = scanner.getToken(); + if (token === 89 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import "mod"; + recordModuleName(); + return true; + } + else { + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import d from "mod"; + recordModuleName(); + return true; + } + } + else if (token === 56 /* EqualsToken */) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + else if (token === 24 /* CommaToken */) { + // consume comma and keep going + token = scanner.scan(); + } + else { + // unknown syntax + return true; + } + } + if (token === 15 /* OpenBraceToken */) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure that it stops on EOF + while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + token = scanner.scan(); + } + if (token === 16 /* CloseBraceToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === 37 /* AsteriskToken */) { + token = scanner.scan(); + if (token === 116 /* AsKeyword */) { + token = scanner.scan(); + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // import * as NS from "mod" + // import d, * as NS from "mod" + recordModuleName(); + } + } + } + } + } + } + return true; + } + return false; + } + function tryConsumeExport() { + var token = scanner.getToken(); + if (token === 82 /* ExportKeyword */) { + token = scanner.scan(); + if (token === 15 /* OpenBraceToken */) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure it stops on EOF + while (token !== 16 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) { + token = scanner.scan(); + } + if (token === 16 /* CloseBraceToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === 37 /* AsteriskToken */) { + token = scanner.scan(); + if (token === 133 /* FromKeyword */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // export * from "mod" + recordModuleName(); + } + } + } + else if (token === 89 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 69 /* Identifier */ || ts.isKeyword(token)) { + token = scanner.scan(); + if (token === 56 /* EqualsToken */) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + } + } + return true; + } + return false; + } + function tryConsumeRequireCall(skipCurrentToken) { + var token = skipCurrentToken ? scanner.scan() : scanner.getToken(); + if (token === 127 /* RequireKeyword */) { + token = scanner.scan(); + if (token === 17 /* OpenParenToken */) { + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // require("mod"); + recordModuleName(); + } + } + return true; + } + return false; + } + function tryConsumeDefine() { + var token = scanner.getToken(); + if (token === 69 /* Identifier */ && scanner.getTokenValue() === "define") { + token = scanner.scan(); + if (token !== 17 /* OpenParenToken */) { + return true; + } + token = scanner.scan(); + if (token === 9 /* StringLiteral */) { + // looks like define ("modname", ... - skip string literal and comma + token = scanner.scan(); + if (token === 24 /* CommaToken */) { + token = scanner.scan(); + } + else { + // unexpected token + return true; + } + } + // should be start of dependency list + if (token !== 19 /* OpenBracketToken */) { + return true; + } + // skip open bracket + token = scanner.scan(); + var i = 0; + // scan until ']' or EOF + while (token !== 20 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) { + // record string literals as module names + if (token === 9 /* StringLiteral */) { + recordModuleName(); + i++; + } + token = scanner.scan(); + } + return true; + } + return false; + } + function processImports() { scanner.setText(sourceText); - var token = scanner.scan(); + scanner.scan(); // Look for: // import "mod"; // import d from "mod" @@ -44971,152 +45677,26 @@ var ts; // export * from "mod" // export {a as b} from "mod" // export import i = require("mod") - while (token !== 1 /* EndOfFileToken */) { - if (token === 122 /* DeclareKeyword */) { - // declare module "mod" - token = scanner.scan(); - if (token === 125 /* ModuleKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - recordAmbientExternalModule(); - continue; - } - } + // (for JavaScript files) require("mod") + while (true) { + if (scanner.getToken() === 1 /* EndOfFileToken */) { + break; } - else if (token === 89 /* ImportKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import "mod"; - recordModuleName(); - continue; - } - else { - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import d from "mod"; - recordModuleName(); - continue; - } - } - else if (token === 56 /* EqualsToken */) { - token = scanner.scan(); - if (token === 127 /* RequireKeyword */) { - token = scanner.scan(); - if (token === 17 /* OpenParenToken */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import i = require("mod"); - recordModuleName(); - continue; - } - } - } - } - else if (token === 24 /* CommaToken */) { - // consume comma and keep going - token = scanner.scan(); - } - else { - // unknown syntax - continue; - } - } - if (token === 15 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 16 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 16 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import {a as A} from "mod"; - // import d, {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 37 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 116 /* AsKeyword */) { - token = scanner.scan(); - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // import * as NS from "mod" - // import d, * as NS from "mod" - recordModuleName(); - } - } - } - } - } - } + // check if at least one of alternative have moved scanner forward + if (tryConsumeDeclare() || + tryConsumeImport() || + tryConsumeExport() || + (detectJavaScriptImports && (tryConsumeRequireCall(/* skipCurrentToken */ false) || tryConsumeDefine()))) { + continue; } - else if (token === 82 /* ExportKeyword */) { - token = scanner.scan(); - if (token === 15 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 16 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 16 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export {a as A} from "mod"; - // export {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 37 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 133 /* FromKeyword */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export * from "mod" - recordModuleName(); - } - } - } - else if (token === 89 /* ImportKeyword */) { - token = scanner.scan(); - if (token === 69 /* Identifier */ || ts.isKeyword(token)) { - token = scanner.scan(); - if (token === 56 /* EqualsToken */) { - token = scanner.scan(); - if (token === 127 /* RequireKeyword */) { - token = scanner.scan(); - if (token === 17 /* OpenParenToken */) { - token = scanner.scan(); - if (token === 9 /* StringLiteral */) { - // export import i = require("mod"); - recordModuleName(); - } - } - } - } - } - } + else { + scanner.scan(); } - token = scanner.scan(); } scanner.setText(undefined); } if (readImportFiles) { - processImport(); + processImports(); } processTripleSlashDirectives(); return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientExternalModules }; @@ -45547,7 +46127,7 @@ var ts; // For JavaScript files, we don't want to report the normal typescript semantic errors. // Instead, we just report errors for using TypeScript-only constructs from within a // JavaScript file. - if (ts.isJavaScript(fileName)) { + if (ts.isSourceFileJavaScript(targetSourceFile)) { return getJavaScriptSemanticDiagnostics(targetSourceFile); } // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. @@ -45759,7 +46339,7 @@ var ts; var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); - var isJavaScriptFile = ts.isJavaScript(fileName); + var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); @@ -46393,8 +46973,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_33 = element.propertyName || element.name; - exisingImportsOrExports[name_33.text] = true; + var name_35 = element.propertyName || element.name; + exisingImportsOrExports[name_35.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -46426,7 +47006,10 @@ var ts; } var existingName = void 0; if (m.kind === 163 /* BindingElement */ && m.propertyName) { - existingName = m.propertyName.text; + // include only identifiers in completion list + if (m.propertyName.kind === 69 /* Identifier */) { + existingName = m.propertyName.text; + } } else { // TODO(jfreeman): Account for computed property name @@ -46466,46 +47049,43 @@ var ts; return undefined; } var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot, isJsDocTagName = completionData.isJsDocTagName; - var entries; if (isJsDocTagName) { // If the current position is a jsDoc tag name, only tag names should be provided for completion return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() }; } - if (isRightOfDot && ts.isJavaScript(fileName)) { - entries = getCompletionEntriesFromSymbols(symbols); - ts.addRange(entries, getJavaScriptCompletionEntries()); + var sourceFile = getValidSourceFile(fileName); + var entries = []; + if (isRightOfDot && ts.isSourceFileJavaScript(sourceFile)) { + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries); + ts.addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames)); } else { if (!symbols || symbols.length === 0) { return undefined; } - entries = getCompletionEntriesFromSymbols(symbols); + getCompletionEntriesFromSymbols(symbols, entries); } // Add keywords if this is not a member completion list if (!isMemberCompletion && !isJsDocTagName) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries() { + function getJavaScriptCompletionEntries(sourceFile, uniqueNames) { var entries = []; - var allNames = {}; var target = program.getCompilerOptions().target; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - var nameTable = getNameTable(sourceFile); - for (var name_34 in nameTable) { - if (!allNames[name_34]) { - allNames[name_34] = name_34; - var displayName = getCompletionEntryDisplayName(name_34, target, /*performCharacterChecks:*/ true); - if (displayName) { - var entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } + var nameTable = getNameTable(sourceFile); + for (var name_36 in nameTable) { + if (!uniqueNames[name_36]) { + uniqueNames[name_36] = name_36; + var displayName = getCompletionEntryDisplayName(name_36, target, /*performCharacterChecks:*/ true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); } } } @@ -46543,25 +47123,24 @@ var ts; sortText: "0" }; } - function getCompletionEntriesFromSymbols(symbols) { + function getCompletionEntriesFromSymbols(symbols, entries) { var start = new Date().getTime(); - var entries = []; + var uniqueNames = {}; if (symbols) { - var nameToSymbol = {}; for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) { var symbol = symbols_3[_i]; var entry = createCompletionEntry(symbol, location); if (entry) { var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(nameToSymbol, id)) { + if (!ts.lookUp(uniqueNames, id)) { entries.push(entry); - nameToSymbol[id] = symbol; + uniqueNames[id] = id; } } } } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); - return entries; + return uniqueNames; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -46762,16 +47341,16 @@ var ts; case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(54 /* ColonToken */)); + displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); displayParts.push(ts.spacePart()); } - if (!(type.flags & 65536 /* Anonymous */)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + if (!(type.flags & ts.TypeFlags.Anonymous)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); } - addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); + addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); break; default: // Just signature @@ -48396,19 +48975,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_35 = node.text; + var name_37 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_35); + var unionProperty = contextualType.getProperty(name_37); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_35); + var symbol = t.getProperty(name_37); if (symbol) { result_4.push(symbol); } @@ -48417,7 +48996,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_35); + var symbol_1 = contextualType.getProperty(name_37); if (symbol_1) { return [symbol_1]; } @@ -48828,6 +49407,9 @@ var ts; case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName; case 17 /* parameterName */: return ClassificationTypeNames.parameterName; case 18 /* docCommentTagName */: return ClassificationTypeNames.docCommentTagName; + case 19 /* jsxOpenTagName */: return ClassificationTypeNames.jsxOpenTagName; + case 20 /* jsxCloseTagName */: return ClassificationTypeNames.jsxCloseTagName; + case 21 /* jsxSelfClosingTagName */: return ClassificationTypeNames.jsxSelfClosingTagName; } } function convertClassifications(classifications) { @@ -49097,6 +49679,21 @@ var ts; return 17 /* parameterName */; } return; + case 235 /* JsxOpeningElement */: + if (token.parent.tagName === token) { + return 19 /* jsxOpenTagName */; + } + return; + case 237 /* JsxClosingElement */: + if (token.parent.tagName === token) { + return 20 /* jsxCloseTagName */; + } + return; + case 234 /* JsxSelfClosingElement */: + if (token.parent.tagName === token) { + return 21 /* jsxSelfClosingTagName */; + } + return; } } return 2 /* identifier */; @@ -50021,18 +50618,8 @@ var ts; ts.getDefaultLibFilePath = getDefaultLibFilePath; function initializeServices() { ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node(pos, end) { - this.pos = pos; - this.end = end; - this.flags = 0 /* None */; - this.parent = undefined; - } - var proto = kind === 248 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - Node.prototype = proto; - return Node; - }, + getNodeConstructor: function () { return NodeObject; }, + getSourceFileConstructor: function () { return SourceFileObject; }, getSymbolConstructor: function () { return SymbolObject; }, getTypeConstructor: function () { return TypeObject; }, getSignatureConstructor: function () { return SignatureObject; } @@ -51102,7 +51689,8 @@ var ts; }; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + // for now treat files as JavaScript + var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); var convertResult = { referencedFiles: [], importedFiles: [], @@ -51166,7 +51754,7 @@ var ts; TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { try { if (this.documentRegistry === undefined) { - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var hostAdapter = new LanguageServiceShimHostAdapter(host); var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); @@ -51199,7 +51787,7 @@ var ts; TypeScriptServicesFactory.prototype.close = function () { // Forget all the registered shims this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); + this.documentRegistry = undefined; }; TypeScriptServicesFactory.prototype.registerShim = function (shim) { this._shims.push(shim); diff --git a/package.json b/package.json index 7b8abfaae43..261cdfa64b7 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "browserify": "latest", "istanbul": "latest", "mocha-fivemat-progress-reporter": "latest", - "tslint": "latest", + "tslint": "next", + "typescript": "next", "tsd": "latest" }, "scripts": { diff --git a/scripts/tslint/booleanTriviaRule.ts b/scripts/tslint/booleanTriviaRule.ts index be32a870ff4..93c312ab870 100644 --- a/scripts/tslint/booleanTriviaRule.ts +++ b/scripts/tslint/booleanTriviaRule.ts @@ -1,6 +1,5 @@ -/// -/// - +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; export class Rule extends Lint.Rules.AbstractRule { public static FAILURE_STRING_FACTORY = (name: string, currently: string) => `Tag boolean argument as '${name}' (currently '${currently}')`; @@ -19,7 +18,7 @@ class BooleanTriviaWalker extends Lint.RuleWalker { visitCallExpression(node: ts.CallExpression) { super.visitCallExpression(node); - if (node.arguments) { + if (node.arguments) { const targetCallSignature = this.checker.getResolvedSignature(node); if (!!targetCallSignature) { const targetParameters = targetCallSignature.getParameters(); @@ -37,7 +36,7 @@ class BooleanTriviaWalker extends Lint.RuleWalker { let triviaContent: string; const ranges = ts.getLeadingCommentRanges(arg.getFullText(), 0); if (ranges && ranges.length === 1 && ranges[0].kind === ts.SyntaxKind.MultiLineCommentTrivia) { - triviaContent = arg.getFullText().slice(ranges[0].pos + 2, ranges[0].end - 2); //+/-2 to remove /**/ + triviaContent = arg.getFullText().slice(ranges[0].pos + 2, ranges[0].end - 2); // +/-2 to remove /**/ } if (triviaContent !== param.getName()) { this.addFailure(this.createFailure(arg.getStart(source), arg.getWidth(source), Rule.FAILURE_STRING_FACTORY(param.getName(), triviaContent))); @@ -45,6 +44,6 @@ class BooleanTriviaWalker extends Lint.RuleWalker { } } } - } + } } } diff --git a/scripts/tslint/nextLineRule.ts b/scripts/tslint/nextLineRule.ts index 6d803fc7f88..d25652f7bce 100644 --- a/scripts/tslint/nextLineRule.ts +++ b/scripts/tslint/nextLineRule.ts @@ -1,5 +1,5 @@ -/// -/// +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; const OPTION_CATCH = "check-catch"; const OPTION_ELSE = "check-else"; diff --git a/scripts/tslint/noNullRule.ts b/scripts/tslint/noNullRule.ts index 2a2c5bc3717..8e9deca996b 100644 --- a/scripts/tslint/noNullRule.ts +++ b/scripts/tslint/noNullRule.ts @@ -1,5 +1,5 @@ -/// -/// +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/scripts/tslint/preferConstRule.ts b/scripts/tslint/preferConstRule.ts index 29160a9c634..aaa1b0e53d5 100644 --- a/scripts/tslint/preferConstRule.ts +++ b/scripts/tslint/preferConstRule.ts @@ -1,5 +1,5 @@ -/// -/// +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; export class Rule extends Lint.Rules.AbstractRule { @@ -85,12 +85,12 @@ class PreferConstWalker extends Lint.RuleWalker { visitBinaryExpression(node: ts.BinaryExpression) { if (isAssignmentOperator(node.operatorToken.kind)) { - this.visitLHSExpressions(node.left); + this.visitLeftHandSideExpression(node.left); } super.visitBinaryExpression(node); } - private visitLHSExpressions(node: ts.Expression) { + private visitLeftHandSideExpression(node: ts.Expression) { while (node.kind === ts.SyntaxKind.ParenthesizedExpression) { node = (node as ts.ParenthesizedExpression).expression; } @@ -101,23 +101,25 @@ class PreferConstWalker extends Lint.RuleWalker { this.visitBindingLiteralExpression(node as (ts.ArrayLiteralExpression | ts.ObjectLiteralExpression)); } } - + private visitBindingLiteralExpression(node: ts.ArrayLiteralExpression | ts.ObjectLiteralExpression) { if (node.kind === ts.SyntaxKind.ObjectLiteralExpression) { const pattern = node as ts.ObjectLiteralExpression; for (const element of pattern.properties) { - if (element.name.kind === ts.SyntaxKind.Identifier) { - this.markAssignment(element.name as ts.Identifier) + const kind = element.kind; + + if (kind === ts.SyntaxKind.ShorthandPropertyAssignment) { + this.markAssignment((element as ts.ShorthandPropertyAssignment).name); } - else if (isBindingPattern(element.name)) { - this.visitBindingPatternIdentifiers(element.name as ts.BindingPattern); + else if (kind === ts.SyntaxKind.PropertyAssignment) { + this.visitLeftHandSideExpression((element as ts.PropertyAssignment).initializer); } } } else if (node.kind === ts.SyntaxKind.ArrayLiteralExpression) { const pattern = node as ts.ArrayLiteralExpression; for (const element of pattern.elements) { - this.visitLHSExpressions(element); + this.visitLeftHandSideExpression(element); } } } @@ -145,7 +147,7 @@ class PreferConstWalker extends Lint.RuleWalker { private visitAnyUnaryExpression(node: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression) { if (node.operator === ts.SyntaxKind.PlusPlusToken || node.operator === ts.SyntaxKind.MinusMinusToken) { - this.visitLHSExpressions(node.operand); + this.visitLeftHandSideExpression(node.operand); } } @@ -211,12 +213,12 @@ class PreferConstWalker extends Lint.RuleWalker { } } - private collectNameIdentifiers(value: ts.VariableDeclaration, node: ts.Identifier | ts.BindingPattern, table: ts.Map) { + private collectNameIdentifiers(declaration: ts.VariableDeclaration, node: ts.Identifier | ts.BindingPattern, table: ts.Map) { if (node.kind === ts.SyntaxKind.Identifier) { - table[(node as ts.Identifier).text] = {declaration: value, usages: 0}; + table[(node as ts.Identifier).text] = { declaration, usages: 0 }; } else { - this.collectBindingPatternIdentifiers(value, node as ts.BindingPattern, table); + this.collectBindingPatternIdentifiers(declaration, node as ts.BindingPattern, table); } } diff --git a/scripts/tslint/typeOperatorSpacingRule.ts b/scripts/tslint/typeOperatorSpacingRule.ts index 23925493340..4196d024768 100644 --- a/scripts/tslint/typeOperatorSpacingRule.ts +++ b/scripts/tslint/typeOperatorSpacingRule.ts @@ -1,5 +1,5 @@ -/// -/// +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 6edba58cb11..7561783d139 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1,3 +1,4 @@ +/// /// /* @internal */ @@ -6,8 +7,8 @@ namespace ts { export const enum ModuleInstanceState { NonInstantiated = 0, - Instantiated = 1, - ConstEnumOnly = 2 + Instantiated = 1, + ConstEnumOnly = 2 } const enum Reachability { @@ -138,6 +139,8 @@ namespace ts { file.classifiableNames = classifiableNames; } + file = undefined; + options = undefined; parent = undefined; container = undefined; blockScopeContainer = undefined; @@ -174,9 +177,14 @@ namespace ts { symbol.members = {}; } - if (symbolFlags & SymbolFlags.Value && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; - } + if (symbolFlags & SymbolFlags.Value) { + const valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === SyntaxKind.ModuleDeclaration)) { + // other kinds of value declarations take precedence over modules + symbol.valueDeclaration = node; + } + } } // Should not be called on a declaration with a computed property name, @@ -188,6 +196,11 @@ namespace ts { } if (node.name.kind === SyntaxKind.ComputedPropertyName) { const nameExpression = (node.name).expression; + // treat computed property names where expression is string/numeric literal as just string/numeric literal + if (isStringOrNumericLiteral(nameExpression.kind)) { + return (nameExpression).text; + } + Debug.assert(isWellKnownSymbolSyntactically(nameExpression)); return getPropertyNameForKnownSymbolName((nameExpression).name.text); } @@ -208,6 +221,9 @@ namespace ts { return "__export"; case SyntaxKind.ExportAssignment: return (node).isExportEquals ? "export=" : "default"; + case SyntaxKind.BinaryExpression: + // Binary expression case is for JS module 'module.exports = expr' + return "export="; case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: return node.flags & NodeFlags.Default ? "default" : undefined; @@ -441,7 +457,7 @@ namespace ts { /** * Returns true if node and its subnodes were successfully traversed. - * Returning false means that node was not examined and caller needs to dive into the node himself. + * Returning false means that node was not examined and caller needs to dive into the node himself. */ function bindReachableStatement(node: Node): void { if (checkUnreachable(node)) { @@ -551,7 +567,7 @@ namespace ts { } function bindIfStatement(n: IfStatement): void { - // denotes reachability state when entering 'thenStatement' part of the if statement: + // denotes reachability state when entering 'thenStatement' part of the if statement: // i.e. if condition is false then thenStatement is unreachable const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; // denotes reachability state when entering 'elseStatement': @@ -1069,7 +1085,7 @@ namespace ts { return "__" + indexOf((node.parent).parameters, node); } - function bind(node: Node) { + function bind(node: Node): void { if (!node) { return; } @@ -1145,9 +1161,18 @@ namespace ts { function bindWorker(node: Node) { switch (node.kind) { + /* Strict mode checks */ case SyntaxKind.Identifier: return checkStrictModeIdentifier(node); case SyntaxKind.BinaryExpression: + if (isInJavaScriptFile(node)) { + if (isExportsPropertyAssignment(node)) { + bindExportsPropertyAssignment(node); + } + else if (isModuleExportsAssignment(node)) { + bindModuleExportsAssignment(node); + } + } return checkStrictModeBinaryExpression(node); case SyntaxKind.CatchClause: return checkStrictModeCatchClause(node); @@ -1161,7 +1186,7 @@ namespace ts { return checkStrictModePrefixUnaryExpression(node); case SyntaxKind.WithStatement: return checkStrictModeWithStatement(node); - case SyntaxKind.ThisKeyword: + case SyntaxKind.ThisType: seenThisKeyword = true; return; @@ -1213,6 +1238,14 @@ namespace ts { checkStrictModeFunctionName(node); const bindingName = (node).name ? (node).name.text : "__function"; return bindAnonymousDeclaration(node, SymbolFlags.Function, bindingName); + + case SyntaxKind.CallExpression: + if (isInJavaScriptFile(node)) { + bindCallExpression(node); + } + break; + + // Members of classes, interfaces, and modules case SyntaxKind.ClassExpression: case SyntaxKind.ClassDeclaration: return bindClassLikeDeclaration(node); @@ -1224,6 +1257,8 @@ namespace ts { return bindEnumDeclaration(node); case SyntaxKind.ModuleDeclaration: return bindModuleDeclaration(node); + + // Imports and exports case SyntaxKind.ImportEqualsDeclaration: case SyntaxKind.NamespaceImport: case SyntaxKind.ImportSpecifier: @@ -1243,16 +1278,21 @@ namespace ts { function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (isExternalModule(file)) { - bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName)}"`); + bindSourceFileAsExternalModule(); } } - function bindExportAssignment(node: ExportAssignment) { + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName) }"`); + } + + function bindExportAssignment(node: ExportAssignment | BinaryExpression) { + const boundExpression = node.kind === SyntaxKind.ExportAssignment ? (node).expression : (node).right; if (!container.symbol || !container.symbol.exports) { // Export assignment in some sort of block construct bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node)); } - else if (node.expression.kind === SyntaxKind.Identifier) { + else if (boundExpression.kind === SyntaxKind.Identifier) { // An export default clause with an identifier exports all meanings of that identifier declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes); } @@ -1279,6 +1319,34 @@ namespace ts { } } + function setCommonJsModuleIndicator(node: Node) { + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + bindSourceFileAsExternalModule(); + } + } + + function bindExportsPropertyAssignment(node: BinaryExpression) { + // When we create a property via 'exports.foo = bar', the 'exports.foo' property access + // expression is the declaration + setCommonJsModuleIndicator(node); + declareSymbol(file.symbol.exports, file.symbol, node.left, SymbolFlags.Property | SymbolFlags.Export, SymbolFlags.None); + } + + function bindModuleExportsAssignment(node: BinaryExpression) { + // 'module.exports = expr' assignment + setCommonJsModuleIndicator(node); + bindExportAssignment(node); + } + + function bindCallExpression(node: CallExpression) { + // We're only inspecting call expressions to detect CommonJS modules, so we can skip + // this check if we've already seen the module indicator + if (!file.commonJsModuleIndicator && isRequireCall(node)) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node: ClassLikeDeclaration) { if (node.kind === SyntaxKind.ClassDeclaration) { bindBlockScopedDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes); @@ -1467,7 +1535,7 @@ namespace ts { // unreachable code is reported if // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error + // - statement is in not ambient context (statements in ambient context is already an error // so we should not report extras) AND // - node is not variable statement OR // - node is block scoped variable statement OR diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 102b6b0c670..90a0411033b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -110,9 +110,9 @@ namespace ts { const undefinedType = createIntrinsicType(TypeFlags.Undefined | TypeFlags.ContainsUndefinedOrNull, "undefined"); const nullType = createIntrinsicType(TypeFlags.Null | TypeFlags.ContainsUndefinedOrNull, "null"); const unknownType = createIntrinsicType(TypeFlags.Any, "unknown"); - const circularType = createIntrinsicType(TypeFlags.Any, "__circular__"); const emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + const emptyUnionType = emptyObjectType; const emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); emptyGenericType.instantiations = {}; @@ -123,8 +123,8 @@ namespace ts { const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - const anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - const unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + const anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); + const unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); const globals: SymbolTable = {}; @@ -201,6 +201,10 @@ namespace ts { "symbol": { type: esSymbolType, flags: TypeFlags.ESSymbol + }, + "undefined": { + type: undefinedType, + flags: TypeFlags.ContainsUndefinedOrNull } }; @@ -296,7 +300,12 @@ namespace ts { target.constEnumOnlyModule = false; } target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; + if (source.valueDeclaration && + (!target.valueDeclaration || + (target.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && source.valueDeclaration.kind !== SyntaxKind.ModuleDeclaration))) { + // other kinds of value declarations take precedence over modules + target.valueDeclaration = source.valueDeclaration; + } forEach(source.declarations, node => { target.declarations.push(node); }); @@ -365,7 +374,7 @@ namespace ts { } function isGlobalSourceFile(node: Node) { - return node.kind === SyntaxKind.SourceFile && !isExternalModule(node); + return node.kind === SyntaxKind.SourceFile && !isExternalOrCommonJsModule(node); } function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol { @@ -468,28 +477,64 @@ namespace ts { // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - // Type parameters of a function are in scope in the entire function declaration, including the parameter - // list and return type. However, local types are only in scope in the function body. - if (!(meaning & SymbolFlags.Type) || - !(result.flags & (SymbolFlags.Type & ~SymbolFlags.TypeParameter)) || - !isFunctionLike(location) || - lastLocation === (location).body) { + let useResult = true; + if (isFunctionLike(location) && lastLocation && lastLocation !== (location).body) { + // symbol lookup restrictions for function-like declarations + // - Type parameters of a function are in scope in the entire function declaration, including the parameter + // list and return type. However, local types are only in scope in the function body. + // - parameters are only in the scope of function body + if (meaning & result.flags & SymbolFlags.Type) { + useResult = result.flags & SymbolFlags.TypeParameter + // type parameters are visible in parameter list, return type and type parameter list + ? lastLocation === (location).type || + lastLocation.kind === SyntaxKind.Parameter || + lastLocation.kind === SyntaxKind.TypeParameter + // local types not visible outside the function body + : false; + } + if (meaning & SymbolFlags.Value && result.flags & SymbolFlags.FunctionScopedVariable) { + // parameters are visible only inside function body, parameter list and return type + // technically for parameter list case here we might mix parameters and variables declared in function, + // however it is detected separately when checking initializers of parameters + // to make sure that they reference no variables declared after them. + useResult = + lastLocation.kind === SyntaxKind.Parameter || + ( + lastLocation === (location).type && + result.valueDeclaration.kind === SyntaxKind.Parameter + ); + } + } + + if (useResult) { break loop; } - result = undefined; + else { + result = undefined; + } } } switch (location.kind) { case SyntaxKind.SourceFile: - if (!isExternalModule(location)) break; + if (!isExternalOrCommonJsModule(location)) break; case SyntaxKind.ModuleDeclaration: const moduleExports = getSymbolOfNode(location).exports; if (location.kind === SyntaxKind.SourceFile || (location.kind === SyntaxKind.ModuleDeclaration && (location).name.kind === SyntaxKind.StringLiteral)) { - // It's an external module. Because of module/namespace merging, a module's exports are in scope, - // yet we never want to treat an export specifier as putting a member in scope. Therefore, - // if the name we find is purely an export specifier, it is not actually considered in scope. + // It's an external module. First see if the module has an export default and if the local + // name of that export default matches. + if (result = moduleExports["default"]) { + const localSymbol = getLocalSymbolForExportDefault(result); + if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { + break loop; + } + result = undefined; + } + + // Because of module/namespace merging, a module's exports are in scope, + // yet we never want to treat an export specifier as putting a member in scope. + // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope. // Two things to note about this: // 1. We have to check this without calling getSymbol. The problem with calling getSymbol // on an export specifier is that it might find the export specifier itself, and try to @@ -503,13 +548,6 @@ namespace ts { getDeclarationOfKind(moduleExports[name], SyntaxKind.ExportSpecifier)) { break; } - - result = moduleExports["default"]; - const localSymbol = getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; } if (result = getSymbol(moduleExports, name, meaning & SymbolFlags.ModuleMember)) { @@ -994,11 +1032,16 @@ namespace ts { // Module names are escaped in our symbol table. However, string literal values aren't. // Escape the name in the "require(...)" clause to ensure we find the right symbol. - const moduleName = escapeIdentifier(moduleReferenceLiteral.text); + let moduleName = escapeIdentifier(moduleReferenceLiteral.text); if (moduleName === undefined) { return; } + + if (moduleName.indexOf("!") >= 0) { + moduleName = moduleName.substr(0, moduleName.indexOf("!")); + } + const isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { const symbol = getSymbol(globals, "\"" + moduleName + "\"", SymbolFlags.ValueModule); @@ -1209,7 +1252,7 @@ namespace ts { } switch (location.kind) { case SyntaxKind.SourceFile: - if (!isExternalModule(location)) { + if (!isExternalOrCommonJsModule(location)) { break; } case SyntaxKind.ModuleDeclaration: @@ -1391,7 +1434,7 @@ namespace ts { function hasExternalModuleSymbol(declaration: Node) { return (declaration.kind === SyntaxKind.ModuleDeclaration && (declaration).name.kind === SyntaxKind.StringLiteral) || - (declaration.kind === SyntaxKind.SourceFile && isExternalModule(declaration)); + (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { @@ -1657,7 +1700,7 @@ namespace ts { writeAnonymousType(type, flags); } else if (type.flags & TypeFlags.StringLiteral) { - writer.writeStringLiteral((type).text); + writer.writeStringLiteral(`"${escapeString((type).text)}"`); } else { // Should never get here @@ -2065,7 +2108,7 @@ namespace ts { } } else if (node.kind === SyntaxKind.SourceFile) { - return isExternalModule(node) ? node : undefined; + return isExternalOrCommonJsModule(node) ? node : undefined; } } Debug.fail("getContainingModule cant reach here"); @@ -2186,7 +2229,7 @@ namespace ts { case SyntaxKind.SourceFile: return true; - // Export assignements do not create name bindings outside the module + // Export assignments do not create name bindings outside the module case SyntaxKind.ExportAssignment: return false; @@ -2263,7 +2306,7 @@ namespace ts { return false; } resolutionTargets.push(target); - resolutionResults.push(true); + resolutionResults.push(/*items*/ true); resolutionPropertyNames.push(propertyName); return true; } @@ -2341,6 +2384,26 @@ namespace ts { return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node); } + function getTextOfPropertyName(name: PropertyName): string { + switch (name.kind) { + case SyntaxKind.Identifier: + return (name).text; + case SyntaxKind.StringLiteral: + case SyntaxKind.NumericLiteral: + return (name).text; + case SyntaxKind.ComputedPropertyName: + if (isStringOrNumericLiteral((name).expression.kind)) { + return ((name).expression).text; + } + } + + return undefined; + } + + function isComputedNonLiteralName(name: PropertyName): boolean { + return name.kind === SyntaxKind.ComputedPropertyName && !isStringOrNumericLiteral((name).expression.kind); + } + // Return the inferred type for a binding element function getTypeForBindingElement(declaration: BindingElement): Type { const pattern = declaration.parent; @@ -2363,10 +2426,17 @@ namespace ts { if (pattern.kind === SyntaxKind.ObjectBindingPattern) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) const name = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name)) { + // computed properties with non-literal names are treated as 'any' + return anyType; + } + // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - type = getTypeOfPropertyOfType(parentType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, IndexKind.Number) || + const text = getTextOfPropertyName(name); + + type = getTypeOfPropertyOfType(parentType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(parentType, IndexKind.Number) || getIndexTypeOfType(parentType, IndexKind.String); if (!type) { error(name, Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), declarationNameToString(name)); @@ -2477,10 +2547,18 @@ namespace ts { // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern: BindingPattern, includePatternInType: boolean): Type { const members: SymbolTable = {}; + let hasComputedProperties = false; forEach(pattern.elements, e => { - const flags = SymbolFlags.Property | SymbolFlags.Transient | (e.initializer ? SymbolFlags.Optional : 0); const name = e.propertyName || e.name; - const symbol = createSymbol(flags, name.text); + if (isComputedNonLiteralName(name)) { + // do not include computed properties in the implied type + hasComputedProperties = true; + return; + } + + const text = getTextOfPropertyName(name); + const flags = SymbolFlags.Property | SymbolFlags.Transient | (e.initializer ? SymbolFlags.Optional : 0); + const symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType); symbol.bindingElement = e; members[symbol.name] = symbol; @@ -2489,6 +2567,9 @@ namespace ts { if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= TypeFlags.ObjectLiteralPatternWithComputedProperties; + } return result; } @@ -2571,6 +2652,14 @@ namespace ts { if (declaration.kind === SyntaxKind.ExportAssignment) { return links.type = checkExpression((declaration).expression); } + // Handle module.exports = expr + if (declaration.kind === SyntaxKind.BinaryExpression) { + return links.type = checkExpression((declaration).right); + } + // Handle exports.p = expr + if (declaration.kind === SyntaxKind.PropertyAccessExpression) { + return checkExpressionCached((declaration.parent).right); + } // Handle variable, parameter or property if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { return unknownType; @@ -2874,23 +2963,25 @@ namespace ts { function resolveBaseTypesOfClass(type: InterfaceType): void { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; - const baseContructorType = getBaseConstructorTypeOfClass(type); - if (!(baseContructorType.flags & TypeFlags.ObjectType)) { + const baseConstructorType = getBaseConstructorTypeOfClass(type); + if (!(baseConstructorType.flags & TypeFlags.ObjectType)) { return; } const baseTypeNode = getBaseTypeNodeOfClass(type); let baseType: Type; - if (baseContructorType.symbol && baseContructorType.symbol.flags & SymbolFlags.Class) { - // When base constructor type is a class we know that the constructors all have the same type parameters as the + const originalBaseType = baseConstructorType && baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & SymbolFlags.Class && + areAllOuterTypeParametersApplied(originalBaseType)) { + // When base constructor type is a class with no captured type arguments we know that the constructors all have the same type parameters as the // class and all return the instance type of the class. There is no need for further checks and we can apply the // type arguments in the same manner as a type reference to get the same error reporting experience. - baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseContructorType.symbol); + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); } else { // The class derives from a "class-like" constructor function, check that we have at least one construct signature // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere // we check that all instantiated signatures return the same type. - const constructors = getInstantiatedConstructorsForTypeArguments(baseContructorType, baseTypeNode.typeArguments); + const constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments); if (!constructors.length) { error(baseTypeNode.expression, Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return; @@ -2917,6 +3008,18 @@ namespace ts { } } + function areAllOuterTypeParametersApplied(type: Type): boolean { + // An unapplied type parameter has its symbol still the same as the matching argument symbol. + // Since parameters are applied outer-to-inner, only the last outer parameter needs to be checked. + const outerTypeParameters = (type).outerTypeParameters; + if (outerTypeParameters) { + const last = outerTypeParameters.length - 1; + const typeArguments = (type).typeArguments; + return outerTypeParameters[last].symbol !== typeArguments[last].symbol; + } + return true; + } + function resolveBaseTypesOfInterface(type: InterfaceType): void { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (const declaration of type.symbol.declarations) { @@ -3275,7 +3378,7 @@ namespace ts { function getDefaultConstructSignatures(classType: InterfaceType): Signature[] { if (!hasClassBaseType(classType)) { - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; + return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false)]; } const baseConstructorType = getBaseConstructorTypeOfClass(classType); const baseSignatures = getSignaturesOfType(baseConstructorType, SignatureKind.Construct); @@ -3735,7 +3838,7 @@ namespace ts { if (node.initializer) { const signatureDeclaration = node.parent; const signature = getSignatureFromDeclaration(signatureDeclaration); - const parameterIndex = signatureDeclaration.parameters.indexOf(node); + const parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -3756,7 +3859,13 @@ namespace ts { let minArgumentCount = -1; for (let i = 0, n = declaration.parameters.length; i < n; i++) { const param = declaration.parameters[i]; - parameters.push(param.symbol); + let paramSymbol = param.symbol; + // Include parameter symbol instead of property symbol in the signature + if (paramSymbol && !!(paramSymbol.flags & SymbolFlags.Property) && !isBindingPattern(param.name)) { + const resolvedSymbol = resolveName(param, paramSymbol.name, SymbolFlags.Value, undefined, undefined); + paramSymbol = resolvedSymbol; + } + parameters.push(paramSymbol); if (param.type && param.type.kind === SyntaxKind.StringLiteral) { hasStringLiterals = true; } @@ -3845,6 +3954,18 @@ namespace ts { return result; } + function resolveExternalModuleTypeByLiteral(name: StringLiteral) { + const moduleSym = resolveExternalModuleName(name, name); + if (moduleSym) { + const resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + + return anyType; + } + function getReturnTypeOfSignature(signature: Signature): Type { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, TypeSystemPropertyName.ResolvedReturnType)) { @@ -3888,7 +4009,7 @@ namespace ts { } function getSignatureInstantiation(signature: Signature, typeArguments: Type[]): Signature { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); } function getErasedSignature(signature: Signature): Signature { @@ -3898,7 +4019,7 @@ namespace ts { signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); } else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), /*eraseTypeParameters*/ true); } } return signature.erasedSignatureCache; @@ -4128,12 +4249,12 @@ namespace ts { // We only support expressions that are simple qualified names. For other expressions this produces undefined. const typeNameOrExpression = node.kind === SyntaxKind.TypeReference ? (node).typeName : isSupportedExpressionWithTypeArguments(node) ? (node).expression : - undefined; + undefined; const symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, SymbolFlags.Type) || unknownSymbol; const type = symbol === unknownSymbol ? unknownType : symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface) ? getTypeFromClassOrInterfaceReference(node, symbol) : - symbol.flags & SymbolFlags.TypeAlias ? getTypeFromTypeAliasReference(node, symbol) : - getTypeFromNonGenericTypeReference(node, symbol); + symbol.flags & SymbolFlags.TypeAlias ? getTypeFromTypeAliasReference(node, symbol) : + getTypeFromNonGenericTypeReference(node, symbol); // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the // type reference in checkTypeReferenceOrExpressionWithTypeArguments. links.resolvedSymbol = symbol; @@ -4337,7 +4458,7 @@ namespace ts { // a named type that circularly references itself. function getUnionType(types: Type[], noSubtypeReduction?: boolean): Type { if (types.length === 0) { - return emptyObjectType; + return emptyUnionType; } const typeSet: Type[] = []; addTypesToSet(typeSet, types, TypeFlags.Union); @@ -4415,12 +4536,13 @@ namespace ts { } function getStringLiteralType(node: StringLiteral): StringLiteralType { - if (hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; + const text = node.text; + if (hasProperty(stringLiteralTypes, text)) { + return stringLiteralTypes[text]; } - const type = stringLiteralTypes[node.text] = createType(TypeFlags.StringLiteral); - type.text = getTextOfNode(node); + const type = stringLiteralTypes[text] = createType(TypeFlags.StringLiteral); + type.text = text; return type; } @@ -4467,7 +4589,7 @@ namespace ts { return esSymbolType; case SyntaxKind.VoidKeyword: return voidType; - case SyntaxKind.ThisKeyword: + case SyntaxKind.ThisType: return getTypeFromThisTypeNode(node); case SyntaxKind.StringLiteral: return getTypeFromStringLiteral(node); @@ -4991,7 +5113,7 @@ namespace ts { } function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean { - if (someConstituentTypeHasKind(target, TypeFlags.ObjectType)) { + if (!(target.flags & TypeFlags.ObjectLiteralPatternWithComputedProperties) && someConstituentTypeHasKind(target, TypeFlags.ObjectType)) { for (const prop of getPropertiesOfObjectType(source)) { if (!isKnownProperty(target, prop.name)) { if (reportErrors) { @@ -5013,7 +5135,7 @@ namespace ts { let result = Ternary.True; const sourceTypes = source.types; for (const sourceType of sourceTypes) { - const related = typeRelatedToSomeType(sourceType, target, false); + const related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false); if (!related) { return Ternary.False; } @@ -5088,9 +5210,6 @@ namespace ts { } function typeParameterIdenticalTo(source: TypeParameter, target: TypeParameter): Ternary { - if (source.symbol.name !== target.symbol.name) { - return Ternary.False; - } // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { return Ternary.True; @@ -5414,7 +5533,7 @@ namespace ts { const saveErrorInfo = errorInfo; let related = isRelatedTo(s, t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(t, s, /*reportErrors*/ false); if (!related) { if (reportErrors) { reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, @@ -5541,7 +5660,7 @@ namespace ts { let related: Ternary; 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 - related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); @@ -5751,6 +5870,10 @@ namespace ts { return !!getPropertyOfType(type, "0"); } + function isStringLiteralType(type: Type) { + return type.flags & TypeFlags.StringLiteral; + } + /** * Check if a Type was written as a tuple type literal. * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. @@ -6207,27 +6330,6 @@ namespace ts { Debug.fail("should not get here"); } - // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) - // or not of the given type kind (when isOfTypeKind is false) - function removeTypesFromUnionType(type: Type, typeKind: TypeFlags, isOfTypeKind: boolean, allowEmptyUnionResult: boolean): Type { - if (type.flags & TypeFlags.Union) { - const types = (type).types; - if (forEach(types, t => !!(t.flags & typeKind) === isOfTypeKind)) { - // Above we checked if we have anything to remove, now use the opposite test to do the removal - const narrowedType = getUnionType(filter(types, t => !(t.flags & typeKind) === isOfTypeKind)); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types - // are represented ever changes. - return getUnionType(emptyArray); - } - return type; - } - function hasInitializer(node: VariableLikeDeclaration): boolean { return !!(node.initializer || isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } @@ -6329,53 +6431,70 @@ namespace ts { // Only narrow when symbol is variable of type any or an object, union, or type parameter type if (node && symbol.flags & SymbolFlags.Variable) { if (isTypeAny(type) || type.flags & (TypeFlags.ObjectType | TypeFlags.Union | TypeFlags.TypeParameter)) { + const declaration = getDeclarationOfKind(symbol, SyntaxKind.VariableDeclaration); + const top = declaration && getDeclarationContainer(declaration); + const originalType = type; + const nodeStack: {node: Node, child: Node}[] = []; loop: while (node.parent) { const child = node; node = node.parent; - let narrowedType = type; + switch (node.kind) { + case SyntaxKind.IfStatement: + case SyntaxKind.ConditionalExpression: + case SyntaxKind.BinaryExpression: + nodeStack.push({node, child}); + break; + case SyntaxKind.SourceFile: + case SyntaxKind.ModuleDeclaration: + // Stop at the first containing file or module declaration + break loop; + } + if (node === top) { + break; + } + } + + let nodes: {node: Node, child: Node}; + while (nodes = nodeStack.pop()) { + const {node, child} = nodes; switch (node.kind) { case SyntaxKind.IfStatement: // In a branch of an if statement, narrow based on controlling expression if (child !== (node).expression) { - narrowedType = narrowType(type, (node).expression, /*assumeTrue*/ child === (node).thenStatement); + type = narrowType(type, (node).expression, /*assumeTrue*/ child === (node).thenStatement); } break; case SyntaxKind.ConditionalExpression: // In a branch of a conditional expression, narrow based on controlling condition if (child !== (node).condition) { - narrowedType = narrowType(type, (node).condition, /*assumeTrue*/ child === (node).whenTrue); + type = narrowType(type, (node).condition, /*assumeTrue*/ child === (node).whenTrue); } break; case SyntaxKind.BinaryExpression: // In the right operand of an && or ||, narrow based on left operand if (child === (node).right) { if ((node).operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) { - narrowedType = narrowType(type, (node).left, /*assumeTrue*/ true); + type = narrowType(type, (node).left, /*assumeTrue*/ true); } else if ((node).operatorToken.kind === SyntaxKind.BarBarToken) { - narrowedType = narrowType(type, (node).left, /*assumeTrue*/ false); + type = narrowType(type, (node).left, /*assumeTrue*/ false); } } break; - case SyntaxKind.SourceFile: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: - // Stop at the first containing function or module declaration - break loop; + default: + Debug.fail("Unreachable!"); } - // Use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; + + // Use original type if construct contains assignments to variable + if (type !== originalType && isVariableAssignedWithin(symbol, node)) { + type = originalType; } } + + // Preserve old top-level behavior - if the branch is really an empty set, revert to prior type + if (type === emptyUnionType) { + type = originalType; + } } } @@ -6391,31 +6510,35 @@ namespace ts { if (left.expression.kind !== SyntaxKind.Identifier || getResolvedSymbol(left.expression) !== symbol) { return type; } - const typeInfo = primitiveTypeInfo[right.text]; if (expr.operatorToken.kind === SyntaxKind.ExclamationEqualsEqualsToken) { assumeTrue = !assumeTrue; } - if (assumeTrue) { - // Assumed result is true. If check was not for a primitive type, remove all primitive types - if (!typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.Boolean | TypeFlags.ESSymbol, - /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Check was for a primitive type, return that primitive type if it is a subtype - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is - // union of enum types and other types. - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ false, /*allowEmptyUnionResult*/ false); + const typeInfo = primitiveTypeInfo[right.text]; + // Don't narrow `undefined` + if (typeInfo && typeInfo.type === undefinedType) { + return type; + } + // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive + if (!!(type.flags & TypeFlags.Any) && typeInfo && assumeTrue) { + return typeInfo.type; + } + let flags: TypeFlags; + if (typeInfo) { + flags = typeInfo.flags; } else { - // Assumed result is false. If check was for a primitive type, remove that primitive type - if (typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Otherwise we don't have enough information to do anything. - return type; + assumeTrue = !assumeTrue; + flags = TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol | TypeFlags.Boolean; + } + // At this point we can bail if it's not a union + if (!(type.flags & TypeFlags.Union)) { + // If the active non-union type would be removed from a union by this type guard, return an empty union + return filterUnion(type) ? type : emptyUnionType; + } + return getUnionType(filter((type as UnionType).types, filterUnion), /*noSubtypeReduction*/ true); + + function filterUnion(type: Type) { + return assumeTrue === !!(type.flags & flags); } } @@ -6429,7 +6552,7 @@ namespace ts { // and the second operand was false. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ false), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ false) + narrowType(type, expr.right, /*assumeTrue*/ false) ]); } } @@ -6440,7 +6563,7 @@ namespace ts { // and the second operand was true. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ true), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ true) + narrowType(type, expr.right, /*assumeTrue*/ true) ]); } else { @@ -7030,6 +7153,10 @@ namespace ts { return applyToContextualType(type, t => getIndexTypeOfStructuredType(t, kind)); } + function contextualTypeIsStringLiteralType(type: Type): boolean { + return !!(type.flags & TypeFlags.Union ? forEach((type).types, isStringLiteralType) : isStringLiteralType(type)); + } + // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type: Type): boolean { return !!(type.flags & TypeFlags.Union ? forEach((type).types, isTupleLikeType) : isTupleLikeType(type)); @@ -7055,7 +7182,7 @@ namespace ts { function getContextualTypeForObjectLiteralElement(element: ObjectLiteralElement) { const objectLiteral = element.parent; - const type = getContextualType(objectLiteral); + const type = getApparentTypeOfContextualType(objectLiteral); if (type) { if (!hasDynamicName(element)) { // For a (non-symbol) computed property, there is no reason to look up the name @@ -7081,7 +7208,7 @@ namespace ts { // type of T. function getContextualTypeForElementExpression(node: Expression): Type { const arrayLiteral = node.parent; - const type = getContextualType(arrayLiteral); + const type = getApparentTypeOfContextualType(arrayLiteral); if (type) { const index = indexOf(arrayLiteral.elements, node); return getTypeOfPropertyOfContextualType(type, "" + index) @@ -7119,12 +7246,29 @@ namespace ts { // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. - function getContextualType(node: Expression): Type { - const type = getContextualTypeWorker(node); + function getApparentTypeOfContextualType(node: Expression): Type { + const type = getContextualType(node); return type && getApparentType(type); } - function getContextualTypeWorker(node: Expression): Type { + /** + * Woah! Do you really want to use this function? + * + * Unless you're trying to get the *non-apparent* type for a + * value-literal type or you're authoring relevant portions of this algorithm, + * you probably meant to use 'getApparentTypeOfContextualType'. + * Otherwise this may not be very useful. + * + * In cases where you *are* working on this function, you should understand + * when it is appropriate to use 'getContextualType' and 'getApparentTypeOfContetxualType'. + * + * - Use 'getContextualType' when you are simply going to propagate the result to the expression. + * - Use 'getApparentTypeOfContextualType' when you're going to need the members of the type. + * + * @param node the expression whose contextual type will be returned. + * @returns the contextual type of an expression. + */ + function getContextualType(node: Expression): Type { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; @@ -7203,7 +7347,7 @@ namespace ts { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); const type = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + : getApparentTypeOfContextualType(node); if (!type) { return undefined; } @@ -7333,7 +7477,7 @@ namespace ts { type.pattern = node; return type; } - const contextualType = getContextualType(node); + const contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { const pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting @@ -7425,11 +7569,12 @@ namespace ts { const propertiesTable: SymbolTable = {}; const propertiesArray: Symbol[] = []; - const contextualType = getContextualType(node); + const contextualType = getApparentTypeOfContextualType(node); const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === SyntaxKind.ObjectBindingPattern || contextualType.pattern.kind === SyntaxKind.ObjectLiteralExpression); let typeFlags: TypeFlags = 0; + let patternWithComputedProperties = false; for (const memberDecl of node.properties) { let member = memberDecl.symbol; if (memberDecl.kind === SyntaxKind.PropertyAssignment || @@ -7457,8 +7602,11 @@ namespace ts { if (isOptional) { prop.flags |= SymbolFlags.Optional; } + if (hasDynamicName(memberDecl)) { + patternWithComputedProperties = true; + } } - else if (contextualTypeHasPattern) { + else if (contextualTypeHasPattern && !(contextualType.flags & TypeFlags.ObjectLiteralPatternWithComputedProperties)) { // If object literal is contextually typed by the implied type of a binding pattern, and if the // binding pattern specifies a default value for the property, make the property optional. const impliedProp = getPropertyOfType(contextualType, member.name); @@ -7515,7 +7663,7 @@ namespace ts { const numberIndexType = getIndexType(IndexKind.Number); const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : TypeFlags.FreshObjectLiteral; - result.flags |= TypeFlags.ObjectLiteral | TypeFlags.ContainsObjectLiteral | freshObjectLiteralFlag | (typeFlags & TypeFlags.PropagatingFlags); + result.flags |= TypeFlags.ObjectLiteral | TypeFlags.ContainsObjectLiteral | freshObjectLiteralFlag | (typeFlags & TypeFlags.PropagatingFlags) | (patternWithComputedProperties ? TypeFlags.ObjectLiteralPatternWithComputedProperties : 0); if (inDestructuringPattern) { result.pattern = node; } @@ -9414,6 +9562,12 @@ namespace ts { return anyType; } } + + // In JavaScript files, calls to any identifier 'require' are treated as external module imports + if (isInJavaScriptFile(node) && isRequireCall(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } + return getReturnTypeOfSignature(signature); } @@ -9426,7 +9580,12 @@ namespace ts { const targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { const widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { + + // Permit 'number[] | "foo"' to be asserted to 'string'. + const bothAreStringLike = + someConstituentTypeHasKind(targetType, TypeFlags.StringLike) && + someConstituentTypeHasKind(widenedType, TypeFlags.StringLike); + if (!bothAreStringLike && !(isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } @@ -9749,7 +9908,7 @@ namespace ts { return type; } - function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { + function checkFunctionExpressionOrObjectLiteralMethodBody(node: ArrowFunction | FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); const isAsync = isAsyncFunctionLike(node); @@ -10034,19 +10193,27 @@ namespace ts { const properties = node.properties; for (const p of properties) { if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) { - // TODO(andersh): Computed property support - const name = (p).name; + const name = (p).name; + if (name.kind === SyntaxKind.ComputedPropertyName) { + checkComputedPropertyName(name); + } + if (isComputedNonLiteralName(name)) { + continue; + } + + const text = getTextOfPropertyName(name); const type = isTypeAny(sourceType) ? sourceType - : getTypeOfPropertyOfType(sourceType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, IndexKind.Number) || + : getTypeOfPropertyOfType(sourceType, text) || + isNumericLiteralName(text) && getIndexTypeOfType(sourceType, IndexKind.Number) || getIndexTypeOfType(sourceType, IndexKind.String); if (type) { if (p.kind === SyntaxKind.ShorthandPropertyAssignment) { checkDestructuringAssignment(p, type); } else { - checkDestructuringAssignment((p).initializer || name, type); + // non-shorthand property assignments should always have initializers + checkDestructuringAssignment((p).initializer, type); } } else { @@ -10256,6 +10423,10 @@ namespace ts { case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.ExclamationEqualsEqualsToken: + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (someConstituentTypeHasKind(leftType, TypeFlags.StringLike) && someConstituentTypeHasKind(rightType, TypeFlags.StringLike)) { + return booleanType; + } if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } @@ -10394,6 +10565,15 @@ namespace ts { return getUnionType([type1, type2]); } + function checkStringLiteralExpression(node: StringLiteral): Type { + const contextualType = getContextualType(node); + if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { + return getStringLiteralType(node); + } + + return stringType; + } + function checkTemplateExpression(node: TemplateExpression): Type { // We just want to check each expressions, but we are unconcerned with // the type of each expression, as any value may be coerced into a string. @@ -10453,7 +10633,7 @@ namespace ts { if (isInferentialContext(contextualMapper)) { const signature = getSingleCallSignature(type); if (signature && signature.typeParameters) { - const contextualType = getContextualType(node); + const contextualType = getApparentTypeOfContextualType(node); if (contextualType) { const contextualSignature = getSingleCallSignature(contextualType); if (contextualSignature && !contextualSignature.typeParameters) { @@ -10524,6 +10704,7 @@ namespace ts { case SyntaxKind.TemplateExpression: return checkTemplateExpression(node); case SyntaxKind.StringLiteral: + return checkStringLiteralExpression(node); case SyntaxKind.NoSubstitutionTemplateLiteral: return stringType; case SyntaxKind.RegularExpressionLiteral: @@ -10857,6 +11038,7 @@ namespace ts { const symbol = getSymbolOfNode(node); const firstDeclaration = getDeclarationOfKind(symbol, node.kind); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(symbol); @@ -11214,11 +11396,17 @@ namespace ts { const errorNode: Node = (subsequentNode).name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && (subsequentNode).name && (node.name).text === ((subsequentNode).name).text) { - // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - Debug.assert(node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature); - Debug.assert((node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static)); - const diagnostic = node.flags & NodeFlags.Static ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); + const reportError = + (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) && + (node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static); + // we can get here in two cases + // 1. mixed static and instance class members + // 2. something with the same name was defined before the set of overloads that prevents them from merging + // here we'll report error only for the first case since for second we should already report error in binder + if (reportError) { + const diagnostic = node.flags & NodeFlags.Static ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; + error(errorNode, diagnostic); + } return; } else if (nodeIsPresent((subsequentNode).body)) { @@ -11313,7 +11501,7 @@ namespace ts { // Abstract methods can't have an implementation -- in particular, they don't need one. if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(lastSeenNonAmbientDeclaration.flags & NodeFlags.Abstract) ) { + !(lastSeenNonAmbientDeclaration.flags & NodeFlags.Abstract)) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } @@ -11881,7 +12069,14 @@ namespace ts { const symbol = getSymbolOfNode(node); const localSymbol = node.localSymbol || symbol; - const firstDeclaration = getDeclarationOfKind(localSymbol, node.kind); + // Since the javascript won't do semantic analysis like typescript, + // if the javascript file comes before the typescript file and both contain same name functions, + // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. + const firstDeclaration = forEach(localSymbol.declarations, + // Get first non javascript function declaration + declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration : undefined); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -12036,7 +12231,7 @@ namespace ts { // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent const parent = getDeclarationContainer(node); - if (parent.kind === SyntaxKind.SourceFile && isExternalModule(parent)) { + if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); @@ -12165,6 +12360,14 @@ namespace ts { checkExpressionCached(node.initializer); } } + + if (node.kind === SyntaxKind.BindingElement) { + // check computed properties inside property names of binding elements + if (node.propertyName && node.propertyName.kind === SyntaxKind.ComputedPropertyName) { + checkComputedPropertyName(node.propertyName); + } + } + // For a binding pattern, check contained binding elements if (isBindingPattern(node.name)) { forEach((node.name).elements, checkSourceElement); @@ -12592,9 +12795,14 @@ namespace ts { // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the remaining type is the same as the initial type. - const arrayType = removeTypesFromUnionType(arrayOrStringType, TypeFlags.StringLike, /*isTypeOfKind*/ true, /*allowEmptyUnionResult*/ true); + let arrayType = arrayOrStringType; + if (arrayOrStringType.flags & TypeFlags.Union) { + arrayType = getUnionType(filter((arrayOrStringType as UnionType).types, t => !(t.flags & TypeFlags.StringLike))); + } + else if (arrayOrStringType.flags & TypeFlags.StringLike) { + arrayType = emptyUnionType; + } const hasStringConstituent = arrayOrStringType !== arrayType; - let reportedError = false; if (hasStringConstituent) { if (languageVersion < ScriptTarget.ES5) { @@ -12718,6 +12926,7 @@ namespace ts { let hasDuplicateDefaultClause = false; const expressionType = checkExpression(node.expression); + const expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, TypeFlags.StringLike); forEach(node.caseBlock.clauses, clause => { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause if (clause.kind === SyntaxKind.DefaultClause && !hasDuplicateDefaultClause) { @@ -12738,8 +12947,14 @@ namespace ts { // 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. const caseType = checkExpression(caseClause.expression); - if (!isTypeAssignableTo(expressionType, caseType)) { - // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails + + const expressionTypeIsAssignableToCaseType = + // Permit 'number[] | "foo"' to be asserted to 'string'. + (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, TypeFlags.StringLike)) || + isTypeAssignableTo(expressionType, caseType); + + if (!expressionTypeIsAssignableToCaseType) { + // 'expressionType is not assignable to caseType', try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined); } } @@ -13269,11 +13484,14 @@ namespace ts { const enumIsConst = isConst(node); for (const member of node.members) { - if (member.name.kind === SyntaxKind.ComputedPropertyName) { + if (isComputedNonLiteralName(member.name)) { error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); } - else if (isNumericLiteralName((member.name).text)) { - error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); + else { + const text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text)) { + error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } } const previousEnumMemberIsNonConstant = autoValue === undefined; @@ -14093,8 +14311,12 @@ namespace ts { if (!(links.flags & NodeCheckFlags.TypeChecked)) { // Check whether the file has declared it is the default lib, // and whether the user has specifically chosen to avoid checking it. - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; + if (compilerOptions.skipDefaultLibCheck) { + // If the user specified '--noLib' and a file has a '/// ', + // then we should treat that file as a default lib. + if (node.hasNoDefaultLib) { + return; + } } // Grammar checking @@ -14108,7 +14330,7 @@ namespace ts { forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (isExternalModule(node)) { + if (isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -14211,7 +14433,7 @@ namespace ts { switch (location.kind) { case SyntaxKind.SourceFile: - if (!isExternalModule(location)) { + if (!isExternalOrCommonJsModule(location)) { break; } case SyntaxKind.ModuleDeclaration: @@ -14225,8 +14447,8 @@ namespace ts { if (className) { copySymbol(location.symbol, meaning); } - // fall through; this fall-through is necessary because we would like to handle - // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration + // fall through; this fall-through is necessary because we would like to handle + // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: // If we didn't come from static member of class or interface, @@ -14382,8 +14604,8 @@ namespace ts { return resolveEntityName(entityName, meaning); } else if ((entityName.parent.kind === SyntaxKind.JsxOpeningElement) || - (entityName.parent.kind === SyntaxKind.JsxSelfClosingElement) || - (entityName.parent.kind === SyntaxKind.JsxClosingElement)) { + (entityName.parent.kind === SyntaxKind.JsxSelfClosingElement) || + (entityName.parent.kind === SyntaxKind.JsxClosingElement)) { return getJsxElementTagSymbol(entityName.parent); } else if (isExpression(entityName)) { @@ -14450,8 +14672,8 @@ namespace ts { : getSymbolOfPartOfRightHandSideOfImportEquals(node); } else if (node.parent.kind === SyntaxKind.BindingElement && - node.parent.parent.kind === SyntaxKind.ObjectBindingPattern && - node === (node.parent).propertyName) { + node.parent.parent.kind === SyntaxKind.ObjectBindingPattern && + node === (node.parent).propertyName) { const typeOfPattern = getTypeOfNode(node.parent.parent); const propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, (node).text); @@ -14472,6 +14694,9 @@ namespace ts { const type = isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; + case SyntaxKind.ThisType: + return getTypeFromTypeNode(node).symbol; + case SyntaxKind.ConstructorKeyword: // constructor keyword for an overload, should take us to the definition if it exist const constructorDeclaration = node.parent; @@ -14488,7 +14713,7 @@ namespace ts { (node.parent).moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } - // Fall through + // Fall through case SyntaxKind.NumericLiteral: // index access @@ -14684,7 +14909,7 @@ namespace ts { if (links.isNestedRedeclaration === undefined) { const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); links.isNestedRedeclaration = isStatementWithLocals(container) && - !!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + !!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); } return links.isNestedRedeclaration; } @@ -14935,10 +15160,20 @@ namespace ts { getReferencedValueDeclaration, getTypeReferenceSerializationKind, isOptionalParameter, - isArgumentsLocalBinding + isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration }; } + function getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): SourceFile { + const specifier = getExternalModuleName(declaration); + const moduleSymbol = getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return undefined; + } + return getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile) as SourceFile; + } + function initializeTypeChecker() { // Bind all source files and propagate errors forEach(host.getSourceFiles(), file => { @@ -14947,16 +15182,16 @@ namespace ts { // Initialize global symbol table forEach(host.getSourceFiles(), file => { - if (!isExternalModule(file)) { + if (!isExternalOrCommonJsModule(file)) { mergeSymbolTable(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 globalArrayType = getGlobalType("Array", /*arity*/ 1); globalObjectType = getGlobalType("Object"); @@ -15717,7 +15952,7 @@ namespace ts { } function checkGrammarForNonSymbolComputedProperty(node: DeclarationName, message: DiagnosticMessage) { - if (node.kind === SyntaxKind.ComputedPropertyName && !isWellKnownSymbolSyntactically((node).expression)) { + if (isDynamicName(node)) { return grammarErrorOnNode(node, message); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 272f5430b8c..8ec47fcffef 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -284,6 +284,11 @@ namespace ts { name: "allowSyntheticDefaultImports", type: "boolean", description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export + }, + { + name: "allowJs", + type: "boolean", + description: Diagnostics.Allow_javascript_files_to_be_compiled } ]; @@ -479,9 +484,10 @@ namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine { - const { options, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath); + export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}): ParsedCommandLine { + const { options: optionsFromJsonConfigFile, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath); + const options = extend(existingOptions, optionsFromJsonConfigFile); return { options, fileNames: getFileNames(), @@ -499,23 +505,32 @@ namespace ts { } } else { + const filesSeen: Map = {}; const exclude = json["exclude"] instanceof Array ? map(json["exclude"], normalizeSlashes) : undefined; - const sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); - for (let i = 0; i < sysFiles.length; i++) { - const name = sysFiles[i]; - if (fileExtensionIs(name, ".d.ts")) { - const baseName = name.substr(0, name.length - ".d.ts".length); - if (!contains(sysFiles, baseName + ".tsx") && !contains(sysFiles, baseName + ".ts")) { - fileNames.push(name); + const supportedExtensions = getSupportedExtensions(options); + Debug.assert(indexOf(supportedExtensions, ".ts") < indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick"); + + // Get files of supported extensions in their order of resolution + for (const extension of supportedExtensions) { + const filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); + for (const fileName of filesInDirWithExtension) { + // .ts extension would read the .d.ts extension files too but since .d.ts is lower priority extension, + // lets pick them when its turn comes up + if (extension === ".ts" && fileExtensionIs(fileName, ".d.ts")) { + continue; } - } - else if (fileExtensionIs(name, ".ts")) { - if (!contains(sysFiles, name + "x")) { - fileNames.push(name); + + // If this is one of the output extension (which would be .d.ts and .js if we are allowing compilation of js files) + // do not include this file if we included .ts or .tsx file with same base name as it could be output of the earlier compilation + if (extension === ".d.ts" || (options.allowJs && contains(supportedJavascriptExtensions, extension))) { + const baseName = fileName.substr(0, fileName.length - extension.length); + if (hasProperty(filesSeen, baseName + ".ts") || hasProperty(filesSeen, baseName + ".tsx")) { + continue; + } } - } - else { - fileNames.push(name); + + filesSeen[fileName] = true; + fileNames.push(fileName); } } } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 2ce3bbfaf3b..79f0251c565 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -297,8 +297,8 @@ namespace ts { return result; } - export function extend(first: Map, second: Map): Map { - const result: Map = {}; + export function extend, T2 extends Map<{}>>(first: T1 , second: T2): T1 & T2 { + const result: T1 & T2 = {}; for (const id in first) { (result as any)[id] = first[id]; } @@ -714,7 +714,7 @@ namespace ts { } export function getBaseFileName(path: string) { - if (!path) { + if (path === undefined) { return undefined; } const i = path.lastIndexOf(directorySeparator); @@ -738,18 +738,18 @@ namespace ts { /** * List of supported extensions in order of file resolution precedence. */ - export const supportedExtensions = [".ts", ".tsx", ".d.ts"]; - /** - * List of extensions that will be used to look for external modules. - * This list is kept separate from supportedExtensions to for cases when we'll allow to include .js files in compilation, - * but still would like to load only TypeScript files as modules - */ - export const moduleFileExtensions = supportedExtensions; + export const supportedTypeScriptExtensions = [".ts", ".tsx", ".d.ts"]; + export const supportedJavascriptExtensions = [".js", ".jsx"]; + const allSupportedExtensions = supportedTypeScriptExtensions.concat(supportedJavascriptExtensions); - export function isSupportedSourceFileName(fileName: string) { + export function getSupportedExtensions(options?: CompilerOptions): string[] { + return options && options.allowJs ? allSupportedExtensions : supportedTypeScriptExtensions; + } + + export function isSupportedSourceFileName(fileName: string, compilerOptions?: CompilerOptions) { if (!fileName) { return false; } - for (const extension of supportedExtensions) { + for (const extension of getSupportedExtensions(compilerOptions)) { if (fileExtensionIs(fileName, extension)) { return true; } @@ -847,7 +847,7 @@ namespace ts { } export function fail(message?: string): void { - Debug.assert(false, message); + Debug.assert(/*expression*/ false, message); } } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 081f3fd7d00..2747a3c647d 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -31,13 +31,17 @@ namespace ts { } export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] { - const diagnostics: Diagnostic[] = []; - const jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + const declarationDiagnostics = createDiagnosticCollection(); + forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName); + + function getDeclarationDiagnosticsFromFile({ declarationFilePath }, sources: SourceFile[], isBundledEmit: boolean) { + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit); + } } - function emitDeclarations(host: EmitHost, resolver: EmitResolver, diagnostics: Diagnostic[], jsFilePath: string, root?: SourceFile): DeclarationEmit { + function emitDeclarations(host: EmitHost, resolver: EmitResolver, emitterDiagnostics: DiagnosticCollection, declarationFilePath: string, + sourceFiles: SourceFile[], isBundledEmit: boolean): DeclarationEmit { const newLine = host.getNewLine(); const compilerOptions = host.getCompilerOptions(); @@ -58,8 +62,9 @@ namespace ts { let errorNameNode: DeclarationName; const emitJsDocComments = compilerOptions.removeComments ? function (declaration: Node) { } : writeJsDocComments; const emit = compilerOptions.stripInternal ? stripInternal : emitNode; + let noDeclare: boolean; - const moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; + let moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; let asynchronousSubModuleDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[]; // Contains the reference paths that needs to go in the declaration file. @@ -67,71 +72,78 @@ namespace ts { // and we could be collecting these paths from multiple files into single one with --out option let referencePathsOutput = ""; - if (root) { - // Emitting just a single file, so emit references in this file only + // Emit references corresponding to each file + const emittedReferencedFiles: SourceFile[] = []; + let addedGlobalFileReference = false; + let allSourcesModuleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; + forEach(sourceFiles, sourceFile => { + // Dont emit for javascript file + if (isSourceFileJavaScript(sourceFile)) { + return; + } + + // Check what references need to be added if (!compilerOptions.noResolve) { - let addedGlobalFileReference = false; - forEach(root.referencedFiles, fileReference => { - const referencedFile = tryResolveScriptReference(host, root, fileReference); + forEach(sourceFile.referencedFiles, fileReference => { + const referencedFile = tryResolveScriptReference(host, sourceFile, fileReference); - // All the references that are not going to be part of same file - if (referencedFile && ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference - shouldEmitToOwnFile(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)) { + // Emit reference in dts, if the file reference was not already emitted + if (referencedFile && !contains(emittedReferencedFiles, referencedFile)) { + // Add a reference to generated dts file, + // global file reference is added only + // - if it is not bundled emit (because otherwise it would be self reference) + // - and it is not already added + if (writeReferencePath(referencedFile, !isBundledEmit && !addedGlobalFileReference)) { addedGlobalFileReference = true; } + emittedReferencedFiles.push(referencedFile); } }); } - emitSourceFile(root); + if (!isBundledEmit || !isExternalModule(sourceFile)) { + noDeclare = false; + emitSourceFile(sourceFile); + } + else if (isExternalModule(sourceFile)) { + noDeclare = true; + write(`declare module "${getResolvedExternalModuleName(host, sourceFile)}" {`); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + } // create asynchronous output for the importDeclarations if (moduleElementDeclarationEmitInfo.length) { const oldWriter = writer; forEach(moduleElementDeclarationEmitInfo, aliasEmitInfo => { - if (aliasEmitInfo.isVisible) { + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { Debug.assert(aliasEmitInfo.node.kind === SyntaxKind.ImportDeclaration); createAndSetNewTextWriterWithSymbolWriter(); - Debug.assert(aliasEmitInfo.indent === 0); + Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); + for (let i = 0; i < aliasEmitInfo.indent; i++) { + increaseIndent(); + } writeImportDeclaration(aliasEmitInfo.node); aliasEmitInfo.asynchronousOutput = writer.getText(); + for (let i = 0; i < aliasEmitInfo.indent; i++) { + decreaseIndent(); + } } }); setWriter(oldWriter); + + allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; } - } - else { - // Emit references corresponding to this file - const emittedReferencedFiles: SourceFile[] = []; - forEach(host.getSourceFiles(), sourceFile => { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - forEach(sourceFile.referencedFiles, fileReference => { - const referencedFile = tryResolveScriptReference(host, sourceFile, fileReference); - - // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && - !contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted - - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - - emitSourceFile(sourceFile); - } - }); - } + }); return { reportedDeclarationError, - moduleElementDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput, }; @@ -243,14 +255,14 @@ namespace ts { const errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + emitterDiagnostics.add(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + emitterDiagnostics.add(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); @@ -265,7 +277,8 @@ namespace ts { function reportInaccessibleThisError() { if (errorNameNode) { - diagnostics.push(createDiagnosticForNode(errorNameNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, + reportedDeclarationError = true; + emitterDiagnostics.add(createDiagnosticForNode(errorNameNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, declarationNameToString(errorNameNode))); } } @@ -343,7 +356,7 @@ namespace ts { case SyntaxKind.BooleanKeyword: case SyntaxKind.SymbolKeyword: case SyntaxKind.VoidKeyword: - case SyntaxKind.ThisKeyword: + case SyntaxKind.ThisType: case SyntaxKind.StringLiteral: return writeTextOfNode(currentText, type); case SyntaxKind.ExpressionWithTypeArguments: @@ -607,7 +620,7 @@ namespace ts { if (node.flags & NodeFlags.Default) { write("default "); } - else if (node.kind !== SyntaxKind.InterfaceDeclaration) { + else if (node.kind !== SyntaxKind.InterfaceDeclaration && !noDeclare) { write("declare "); } } @@ -702,11 +715,25 @@ namespace ts { } write(" from "); } - writeTextOfNode(currentText, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier: Expression) { + if (moduleSpecifier.kind === SyntaxKind.StringLiteral && isBundledEmit) { + const moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration)); + if (moduleName) { + write("\""); + write(moduleName); + write("\""); + return; + } + } + + writeTextOfNode(currentText, moduleSpecifier); + } + function emitImportOrExportSpecifier(node: ImportOrExportSpecifier) { if (node.propertyName) { writeTextOfNode(currentText, node.propertyName); @@ -738,7 +765,7 @@ namespace ts { } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentText, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -1594,34 +1621,58 @@ namespace ts { } } - function writeReferencePath(referencedFile: SourceFile) { - let declFileName = referencedFile.flags & NodeFlags.DeclarationFile - ? referencedFile.fileName // Declaration file, use declaration file name - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file - : removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; // Global out file + /** + * Adds the reference to referenced file, returns true if global file reference was emitted + * @param referencedFile + * @param addBundledFileReference Determines if global file reference corresponding to bundled file should be emitted or not + */ + function writeReferencePath(referencedFile: SourceFile, addBundledFileReference: boolean): boolean { + let declFileName: string; + let addedBundledEmitReference = false; + if (isDeclarationFile(referencedFile)) { + // Declaration file, use declaration file name + declFileName = referencedFile.fileName; + } + else { + // Get the declaration file path + forEachExpectedEmitFile(host, getDeclFileName, referencedFile); + } - declFileName = getRelativePathToDirectoryOrUrl( - getDirectoryPath(normalizeSlashes(jsFilePath)), - declFileName, - host.getCurrentDirectory(), - host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ false); + if (declFileName) { + declFileName = getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizeSlashes(declarationFilePath)), + declFileName, + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); - referencePathsOutput += "/// " + newLine; + referencePathsOutput += "/// " + newLine; + } + return addedBundledEmitReference; + + function getDeclFileName(emitFileNames: EmitFileNames, sourceFiles: SourceFile[], isBundledEmit: boolean) { + // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path + if (isBundledEmit && !addBundledFileReference) { + return; + } + + Debug.assert(!!emitFileNames.declarationFilePath || isSourceFileJavaScript(referencedFile), "Declaration file is not present only for javascript files"); + declFileName = emitFileNames.declarationFilePath || emitFileNames.jsFilePath; + addedBundledEmitReference = isBundledEmit; + } } } /* @internal */ - export function writeDeclarationFile(jsFilePath: string, sourceFile: SourceFile, host: EmitHost, resolver: EmitResolver, diagnostics: Diagnostic[]) { - const emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - // TODO(shkamat): Should we not write any declaration file if any of them can produce error, - // or should we just not write this file like we are doing now - if (!emitDeclarationResult.reportedDeclarationError) { + export function writeDeclarationFile(declarationFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean, host: EmitHost, resolver: EmitResolver, emitterDiagnostics: DiagnosticCollection) { + const emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit); + const emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath); + if (!emitSkipped) { const declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - writeFile(host, diagnostics, removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM); } + return emitSkipped; function getDeclarationOutput(synchronousDeclarationOutput: string, moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[]) { let appliedSyncOutputPos = 0; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cdd20b38a69..9646353d8f8 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2060,6 +2060,14 @@ "category": "Error", "code": 5054 }, + "Cannot write file '{0}' because it would overwrite input file.": { + "category": "Error", + "code": 5055 + }, + "Cannot write file '{0}' because it would be overwritten by multiple input files.": { + "category": "Error", + "code": 5056 + }, "Concatenate and emit output to single file.": { "category": "Message", @@ -2314,7 +2322,6 @@ "category": "Message", "code": 6078 }, - "Specify JSX code generation: 'preserve' or 'react'": { "category": "Message", "code": 6080 @@ -2323,6 +2330,14 @@ "category": "Message", "code": 6081 }, + "Only 'amd' and 'system' modules are supported alongside --{0}.": { + "category": "Error", + "code": 6082 + }, + "Allow javascript files to be compiled.": { + "category": "Message", + "code": 6083 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index cb4cd3b3803..d2f9abc7354 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3,8 +3,16 @@ /* @internal */ namespace ts { - export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { - return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); + export function getResolvedExternalModuleName(host: EmitHost, file: SourceFile): string { + return file.moduleName || getExternalModuleNameFromPath(host, file.fileName); + } + + export function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): string { + const file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || isDeclarationFile(file)) { + return undefined; + } + return getResolvedExternalModuleName(host, file); } type DependencyGroup = Array; @@ -325,45 +333,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi };`; const compilerOptions = host.getCompilerOptions(); - const languageVersion = compilerOptions.target || ScriptTarget.ES3; - const modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None; + const languageVersion = getEmitScriptTarget(compilerOptions); + const modulekind = getEmitModuleKind(compilerOptions); const sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - let diagnostics: Diagnostic[] = []; + const emitterDiagnostics = createDiagnosticCollection(); + let emitSkipped = false; const newLine = host.getNewLine(); - const jsxDesugaring = host.getCompilerOptions().jsx !== JsxEmit.Preserve; - const shouldEmitJsx = (s: SourceFile) => (s.languageVariant === LanguageVariant.JSX && !jsxDesugaring); const emitJavaScript = createFileEmitter(); - - if (targetSourceFile === undefined) { - forEach(host.getSourceFiles(), sourceFile => { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - const jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - - if (compilerOptions.outFile || compilerOptions.out) { - emitFile(compilerOptions.outFile || compilerOptions.out); - } - } - else { - // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - const jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) { - emitFile(compilerOptions.outFile || compilerOptions.out); - } - } - - // Sort and make the unique list of diagnostics - diagnostics = sortAndDeduplicateDiagnostics(diagnostics); + forEachExpectedEmitFile(host, emitFile, targetSourceFile); return { - emitSkipped: false, - diagnostics, + emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), sourceMaps: sourceMapDataList }; @@ -414,7 +396,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * var loop = function(x) { } * var arguments_1 = arguments * for (var x;;) loop(x); - * otherwise semantics of the code will be different since 'arguments' inside converted loop body + * otherwise semantics of the code will be different since 'arguments' inside converted loop body * will refer to function that holds converted loop. * This value is set on demand. */ @@ -422,10 +404,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /* * list of non-block scoped variable declarations that appear inside converted loop - * such variable declarations should be moved outside the loop body + * such variable declarations should be moved outside the loop body * for (let x;;) { * var y = 1; - * ... + * ... * } * should be converted to * var loop = function(x) { @@ -472,8 +454,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } - function createFileEmitter(): (jsFilePath: string, root?: SourceFile) => void { - const writer: EmitTextWriter = createTextWriter(newLine); + function createFileEmitter(): (jsFilePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) => void { + const writer = createTextWriter(newLine); const { write, writeTextOfNode, writeLine, increaseIndent, decreaseIndent } = writer; let currentSourceFile: SourceFile; @@ -502,7 +484,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let decorateEmitted: boolean; let paramEmitted: boolean; let awaiterEmitted: boolean; - let tempFlags: TempFlags; + let tempFlags: TempFlags = 0; let tempVariables: Identifier[]; let tempParameters: Identifier[]; let externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; @@ -545,10 +527,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /** Sourcemap data that will get encoded */ let sourceMapData: SourceMapData; + /** Is the file being emitted into its own file */ + let isOwnFileEmit: boolean; + /** If removeComments is true, no leading-comments needed to be emitted **/ const emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos: number) { } : emitLeadingCommentsOfPositionWorker; - const moduleEmitDelegates: Map<(node: SourceFile) => void> = { + const moduleEmitDelegates: Map<(node: SourceFile, emitRelativePathAsModuleName?: boolean) => void> = { [ModuleKind.ES6]: emitES6Module, [ModuleKind.AMD]: emitAMDModule, [ModuleKind.System]: emitSystemModule, @@ -556,20 +541,47 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi [ModuleKind.CommonJS]: emitCommonJSModule, }; + const bundleEmitDelegates: Map<(node: SourceFile, emitRelativePathAsModuleName?: boolean) => void> = { + [ModuleKind.ES6]() {}, + [ModuleKind.AMD]: emitAMDModule, + [ModuleKind.System]: emitSystemModule, + [ModuleKind.UMD]() {}, + [ModuleKind.CommonJS]() {}, + }; + + return doEmit; - function doEmit(jsFilePath: string, root?: SourceFile) { + function doEmit(jsFilePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) { + generatedNameSet = {}; + nodeToGeneratedName = []; + isOwnFileEmit = !isBundledEmit; + + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { + initializeEmitterWithSourceMaps(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + + // Emit helpers from all the files + if (isBundledEmit && modulekind) { + forEach(sourceFiles, emitEmitHelpers); + } + + // Do not call emit directly. It does not set the currentSourceFile. + forEach(sourceFiles, emitSourceFile); + + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); + // reset the state writer.reset(); currentSourceFile = undefined; currentText = undefined; currentLineMap = undefined; exportFunctionForFile = undefined; - generatedNameSet = {}; - nodeToGeneratedName = []; + generatedNameSet = undefined; + nodeToGeneratedName = undefined; computedPropertyNamesToGeneratedNames = undefined; convertedLoopState = undefined; - extendsEmitted = false; decorateEmitted = false; paramEmitted = false; @@ -586,25 +598,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi isEs6Module = false; renamedDependencies = undefined; isCurrentFileExternalModule = false; - - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(jsFilePath, root); - } - - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - forEach(host.getSourceFiles(), sourceFile => { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); - } - }); - } - - writeLine(); - writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); } function emitSourceFile(sourceFile: SourceFile): void { @@ -715,7 +708,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps(jsFilePath: string, root?: SourceFile) { + function initializeEmitterWithSourceMaps(jsFilePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) { let sourceMapDir: string; // The directory in which sourcemap will be // Current source map file and its index in the sources list @@ -1016,24 +1009,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (compilerOptions.inlineSourceMap) { // Encode the sourceMap into the sourceMap url const base64SourceMapText = convertToBase64(sourceMapText); - sourceMapUrl = `//# sourceMappingURL=data:application/json;base64,${base64SourceMapText}`; + sourceMapData.jsSourceMappingURL = `data:application/json;base64,${base64SourceMapText}`; } else { // Write source map file - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, /*writeByteOrderMark*/ false); - sourceMapUrl = `//# sourceMappingURL=${sourceMapData.jsSourceMappingURL}`; + writeFile(host, emitterDiagnostics, sourceMapData.sourceMapFilePath, sourceMapText, /*writeByteOrderMark*/ false); } + sourceMapUrl = `//# sourceMappingURL=${sourceMapData.jsSourceMappingURL}`; // Write sourcemap url to the js file and write the js file writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); } // Initialize source map data - const sourceMapJsFile = getBaseFileName(normalizeSlashes(jsFilePath)); sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, + sourceMapFilePath: sourceMapFilePath, + jsSourceMappingURL: !compilerOptions.inlineSourceMap ? getBaseFileName(normalizeSlashes(sourceMapFilePath)) : undefined, + sourceMapFile: getBaseFileName(normalizeSlashes(jsFilePath)), sourceMapSourceRoot: compilerOptions.sourceRoot || "", sourceMapSources: [], inputSourceFileNames: [], @@ -1052,10 +1044,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (compilerOptions.mapRoot) { sourceMapDir = normalizeSlashes(compilerOptions.mapRoot); - if (root) { // emitting single module file + if (!isBundledEmit) { // emitting single module file + Debug.assert(sourceFiles.length === 1); // 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(root, host, sourceMapDir)); + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); } if (!isRootedDiskPath(sourceMapDir) && !isUrl(sourceMapDir)) { @@ -1108,7 +1101,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function writeJavaScriptFile(emitOutput: string, jsFilePath: string, writeByteOrderMark: boolean) { - writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + writeFile(host, emitterDiagnostics, jsFilePath, emitOutput, writeByteOrderMark); } // Create a temporary variable with a unique unused name. @@ -1263,7 +1256,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitCommaList(nodes: Node[]) { if (nodes) { - emitList(nodes, 0, nodes.length, /*multiline*/ false, /*trailingComma*/ false); + emitList(nodes, 0, nodes.length, /*multiLine*/ false, /*trailingComma*/ false); } } @@ -1563,13 +1556,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /// these emit into an object literal property name, we don't need to be worried /// about keywords, just non-identifier characters function emitAttributeName(name: Identifier) { - if (/[A-Za-z_]+[\w*]/.test(name.text)) { - write("\""); + if (/^[A-Za-z_]\w*$/.test(name.text)) { emit(name); - write("\""); } else { + write("\""); emit(name); + write("\""); } } @@ -2162,7 +2155,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else if (languageVersion >= ScriptTarget.ES6 || !forEach(elements, isSpreadElementExpression)) { write("["); - emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces:*/ false); + emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces*/ false); write("]"); } else { @@ -2186,7 +2179,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // then try to preserve the original shape of the object literal. // Otherwise just try to preserve the formatting. if (numElements === properties.length) { - emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= ScriptTarget.ES5, /* spacesBetweenBraces */ true); + emitLinePreservingList(node, properties, /*allowTrailingComma*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces*/ true); } else { const multiLine = (node.flags & NodeFlags.MultiLine) !== 0; @@ -2461,7 +2454,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // let obj = { y }; // } // Here we need to emit obj = { y : m.y } regardless of the output target. - if (languageVersion < ScriptTarget.ES6 || isNamespaceExportReference(node.name)) { + if (modulekind !== ModuleKind.ES6 || isNamespaceExportReference(node.name)) { // Emit identifier as an identifier write(": "); emit(node.name); @@ -2736,7 +2729,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(".bind.apply("); emit(target); write(", [void 0].concat("); - emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiline*/ false, /*trailingComma*/ false, /*useConcat*/ false); + emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*trailingComma*/ false, /*useConcat*/ false); write(")))"); write("()"); } @@ -2953,7 +2946,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi synthesizedLHS = createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false); - const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldEmitCommaBeforeAssignment*/ false); + const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral && @@ -2972,7 +2965,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write("("); synthesizedLHS = createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false); - const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; (synthesizedLHS).dotToken = leftHandSideExpression.dotToken; @@ -3152,10 +3145,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitDoStatementWorker(node: DoStatement, loop: ConvertedLoop) { write("do"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } if (node.statement.kind === SyntaxKind.Block) { write(" "); @@ -3178,10 +3171,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } @@ -3197,7 +3190,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } if (convertedLoopState && (getCombinedNodeFlags(decl) & NodeFlags.BlockScoped) === 0) { - // we are inside a converted loop - this can only happen in downlevel scenarios + // we are inside a converted loop - this can only happen in downlevel scenarios // record names for all variable declarations for (const varDecl of decl.declarations) { hoistVariableDeclarationFromLoop(convertedLoopState, varDecl); @@ -3503,8 +3496,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`switch(${loopResultVariable}) {`); increaseIndent(); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /* isBreak */ true, loopResultVariable, outerLoop); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /* isBreak */ false, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /*isBreak*/ true, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /*isBreak*/ false, loopResultVariable, outerLoop); decreaseIndent(); writeLine(); @@ -3522,7 +3515,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`case "${labelMarker}": `); // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue - // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do + // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { if (isBreak) { write("break "); @@ -3568,10 +3561,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } @@ -3609,10 +3602,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitToken(SyntaxKind.CloseParenToken, node.expression.end); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } @@ -3752,10 +3745,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (loop) { writeLine(); - emitConvertedLoopCall(loop, /* emitAsBlock */ false); + emitConvertedLoopCall(loop, /*emitAsBlock*/ false); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ false); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ false); } writeLine(); @@ -3789,11 +3782,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let labelMarker: string; if (node.kind === SyntaxKind.BreakStatement) { labelMarker = `break-${node.label.text}`; - setLabeledJump(convertedLoopState, /* isBreak */ true, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } else { labelMarker = `continue-${node.label.text}`; - setLabeledJump(convertedLoopState, /* isBreak */ false, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ false, node.label.text, labelMarker); } write(`return "${labelMarker}";`); } @@ -4215,15 +4208,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return node; } - function createPropertyAccessForDestructuringProperty(object: Expression, propName: Identifier | LiteralExpression): Expression { - // We create a synthetic copy of the identifier in order to avoid the rewriting that might - // otherwise occur when the identifier is emitted. - const syntheticName = createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== SyntaxKind.Identifier) { - return createElementAccessExpression(object, syntheticName); + function createPropertyAccessForDestructuringProperty(object: Expression, propName: PropertyName): Expression { + let index: Expression; + const nameIsComputed = propName.kind === SyntaxKind.ComputedPropertyName; + if (nameIsComputed) { + index = ensureIdentifier((propName).expression, /*reuseIdentifierExpressions*/ false); } - return createPropertyAccessExpression(object, syntheticName); + else { + // We create a synthetic copy of the identifier in order to avoid the rewriting that might + // otherwise occur when the identifier is emitted. + index = createSynthesizedNode(propName.kind); + (index).text = (propName).text; + } + + return !nameIsComputed && index.kind === SyntaxKind.Identifier + ? createPropertyAccessExpression(object, index) + : createElementAccessExpression(object, index); } function createSliceCall(value: Expression, sliceIndex: number): CallExpression { @@ -4967,8 +4967,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi increaseIndent(); writeLine(); emitLeadingComments(node.body); + emitStart(body); write("return "); emit(body); + emitEnd(body); write(";"); emitTrailingComments(node.body); @@ -5342,7 +5344,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitEnd(baseTypeElement); } } - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ false)); if (ctor) { let statements: Node[] = (ctor.body).statements; if (superCall) { @@ -5464,7 +5466,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // // This keeps the expression as an expression, while ensuring that the static parts // of it have been initialized by the time it is used. - const staticProperties = getInitializedProperties(node, /*static:*/ true); + const staticProperties = getInitializedProperties(node, /*isStatic*/ true); const isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === SyntaxKind.ClassExpression; let tempVariable: Identifier; @@ -5526,7 +5528,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi for (var property of staticProperties) { write(","); writeLine(); - emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true); + emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true); } write(","); writeLine(); @@ -5600,7 +5602,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -5970,6 +5972,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi case SyntaxKind.UnionType: case SyntaxKind.IntersectionType: case SyntaxKind.AnyKeyword: + case SyntaxKind.ThisType: break; default: @@ -5988,9 +5991,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } // Clone the type name and parent it to a location outside of the current declaration. - const typeName = cloneEntityName(node.typeName); - typeName.parent = location; - + const typeName = cloneEntityName(node.typeName, location); const result = resolver.getTypeReferenceSerializationKind(typeName); switch (result) { case TypeReferenceSerializationKind.Unknown: @@ -7297,7 +7298,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write("}"); // execute } - function emitSystemModule(node: SourceFile): void { + function writeModuleName(node: SourceFile, emitRelativePathAsModuleName?: boolean): void { + let moduleName = node.moduleName; + if (moduleName || (emitRelativePathAsModuleName && (moduleName = getResolvedExternalModuleName(host, node)))) { + write(`"${moduleName}", `); + } + } + + function emitSystemModule(node: SourceFile, emitRelativePathAsModuleName?: boolean): void { collectExternalModuleInfo(node); // System modules has the following shape // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) @@ -7312,16 +7320,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi exportFunctionForFile = makeUniqueName("exports"); writeLine(); write("System.register("); - if (node.moduleName) { - write(`"${node.moduleName}", `); - } + writeModuleName(node, emitRelativePathAsModuleName); write("["); const groupIndices: Map = {}; const dependencyGroups: DependencyGroup[] = []; for (let i = 0; i < externalImports.length; ++i) { - const text = getExternalModuleNameText(externalImports[i]); + let text = getExternalModuleNameText(externalImports[i]); if (hasProperty(groupIndices, text)) { // deduplicate/group entries in dependency list by the dependency name const groupIndex = groupIndices[text]; @@ -7337,6 +7343,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(", "); } + if (emitRelativePathAsModuleName) { + const name = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); + if (name) { + text = `"${name}"`; + } + } write(text); } write(`], function(${exportFunctionForFile}) {`); @@ -7357,7 +7369,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi importAliasNames: string[]; } - function getAMDDependencyNames(node: SourceFile, includeNonAmdDependencies: boolean): AMDDependencyNames { + function getAMDDependencyNames(node: SourceFile, includeNonAmdDependencies: boolean, emitRelativePathAsModuleName?: boolean): AMDDependencyNames { // names of modules with corresponding parameter in the factory function const aliasedModuleNames: string[] = []; // names of modules with no corresponding parameters in factory function @@ -7379,7 +7391,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi for (const importNode of externalImports) { // Find the name of the external module - const externalModuleName = getExternalModuleNameText(importNode); + let externalModuleName = getExternalModuleNameText(importNode); + + if (emitRelativePathAsModuleName) { + const name = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name) { + externalModuleName = `"${name}"`; + } + } // Find the name of the module alias, if there is one const importAliasName = getLocalNameForExternalImport(importNode); @@ -7395,7 +7414,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return { aliasedModuleNames, unaliasedModuleNames, importAliasNames }; } - function emitAMDDependencies(node: SourceFile, includeNonAmdDependencies: boolean) { + function emitAMDDependencies(node: SourceFile, includeNonAmdDependencies: boolean, emitRelativePathAsModuleName?: boolean) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // @@ -7408,7 +7427,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - const dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies); + const dependencyNames = getAMDDependencyNames(node, includeNonAmdDependencies, emitRelativePathAsModuleName); emitAMDDependencyList(dependencyNames); write(", "); emitAMDFactoryHeader(dependencyNames); @@ -7436,16 +7455,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(") {"); } - function emitAMDModule(node: SourceFile) { + function emitAMDModule(node: SourceFile, emitRelativePathAsModuleName?: boolean) { emitEmitHelpers(node); collectExternalModuleInfo(node); writeLine(); write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, /*includeNonAmdDependencies*/ true); + writeModuleName(node, emitRelativePathAsModuleName); + emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName); increaseIndent(); const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); emitExportStarHelper(); @@ -7694,8 +7711,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitDetachedCommentsAndUpdateCommentsInfo(node); if (isExternalModule(node) || compilerOptions.isolatedModules) { - const emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[ModuleKind.CommonJS]; - emitModule(node); + if (isOwnFileEmit || (!isExternalModule(node) && compilerOptions.isolatedModules)) { + const emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[ModuleKind.CommonJS]; + emitModule(node); + } + else { + bundleEmitDelegates[modulekind](node, /*emitRelativePathAsModuleName*/true); + } } else { // emit prologue directives prior to __extends @@ -8035,11 +8057,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * Emit comments associated with node that will not be emitted into JS file */ function emitCommentsOnNotEmittedNode(node: Node) { - emitLeadingCommentsWorker(node, /*isEmittedNode:*/ false); + emitLeadingCommentsWorker(node, /*isEmittedNode*/ false); } function emitLeadingComments(node: Node) { - return emitLeadingCommentsWorker(node, /*isEmittedNode:*/ true); + return emitLeadingCommentsWorker(node, /*isEmittedNode*/ true); } function emitLeadingCommentsWorker(node: Node, isEmittedNode: boolean) { @@ -8068,7 +8090,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitTrailingComments(node: Node) { @@ -8141,11 +8163,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } - function emitFile(jsFilePath: string, sourceFile?: SourceFile) { - emitJavaScript(jsFilePath, sourceFile); + function emitFile({ jsFilePath, sourceMapFilePath, declarationFilePath}: { jsFilePath: string, sourceMapFilePath: string, declarationFilePath: string }, + sourceFiles: SourceFile[], isBundledEmit: boolean) { + // Make sure not to write js File and source map file if any of them cannot be written + if (!host.isEmitBlocked(jsFilePath)) { + emitJavaScript(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + else { + emitSkipped = true; + } - if (compilerOptions.declaration) { - writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); + if (declarationFilePath) { + emitSkipped = writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) || emitSkipped; } } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ec2aeb25af9..212594f7b7d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1,5 +1,5 @@ -/// /// +/// namespace ts { /* @internal */ export let parseTime = 0; @@ -534,7 +534,8 @@ namespace ts { let parseErrorBeforeNextFinishedNode = false; export function parseSourceFile(fileName: string, _sourceText: string, languageVersion: ScriptTarget, _syntaxCursor: IncrementalParser.SyntaxCursor, setParentNodes?: boolean): SourceFile { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); + const isJavaScriptFile = hasJavaScriptFileExtension(fileName) || _sourceText.lastIndexOf("// @language=javascript", 0) === 0; + initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor); const result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); @@ -543,7 +544,12 @@ namespace ts { return result; } - function initializeState(fileName: string, _sourceText: string, languageVersion: ScriptTarget, _syntaxCursor: IncrementalParser.SyntaxCursor) { + function getLanguageVariant(fileName: string) { + // .tsx and .jsx files are treated as jsx language variant. + return fileExtensionIs(fileName, ".tsx") || fileExtensionIs(fileName, ".jsx") ? LanguageVariant.JSX : LanguageVariant.Standard; + } + + function initializeState(fileName: string, _sourceText: string, languageVersion: ScriptTarget, isJavaScriptFile: boolean, _syntaxCursor: IncrementalParser.SyntaxCursor) { NodeConstructor = objectAllocator.getNodeConstructor(); SourceFileConstructor = objectAllocator.getSourceFileConstructor(); @@ -556,14 +562,14 @@ namespace ts { identifierCount = 0; nodeCount = 0; - contextFlags = isJavaScript(fileName) ? ParserContextFlags.JavaScriptFile : ParserContextFlags.None; + contextFlags = isJavaScriptFile ? ParserContextFlags.JavaScriptFile : ParserContextFlags.None; parseErrorBeforeNextFinishedNode = false; // Initialize and prime the scanner before parsing the source elements. scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(isTsx(fileName) ? LanguageVariant.JSX : LanguageVariant.Standard); + scanner.setLanguageVariant(getLanguageVariant(fileName)); } function clearState() { @@ -582,6 +588,10 @@ namespace ts { function parseSourceFileWorker(fileName: string, languageVersion: ScriptTarget, setParentNodes: boolean): SourceFile { sourceFile = createSourceFile(fileName, languageVersion); + if (contextFlags & ParserContextFlags.JavaScriptFile) { + sourceFile.parserContextFlags = ParserContextFlags.JavaScriptFile; + } + // Prime the scanner. token = nextToken(); processReferenceComments(sourceFile); @@ -604,7 +614,7 @@ namespace ts { // If this is a javascript file, proactively see if we can get JSDoc comments for // relevant nodes in the file. We'll use these to provide typing informaion if they're // available. - if (isJavaScript(fileName)) { + if (isSourceFileJavaScript(sourceFile)) { addJSDocComments(); } @@ -677,7 +687,7 @@ namespace ts { sourceFile.languageVersion = languageVersion; sourceFile.fileName = normalizePath(fileName); sourceFile.flags = fileExtensionIs(sourceFile.fileName, ".d.ts") ? NodeFlags.DeclarationFile : 0; - sourceFile.languageVariant = isTsx(sourceFile.fileName) ? LanguageVariant.JSX : LanguageVariant.Standard; + sourceFile.languageVariant = getLanguageVariant(sourceFile.fileName); return sourceFile; } @@ -717,10 +727,10 @@ namespace ts { const contextFlagsToClear = context & contextFlags; if (contextFlagsToClear) { // clear the requested context flags - setContextFlag(false, contextFlagsToClear); + setContextFlag(/*val*/ false, contextFlagsToClear); const result = func(); // restore the context flags we just cleared - setContextFlag(true, contextFlagsToClear); + setContextFlag(/*val*/ true, contextFlagsToClear); return result; } @@ -738,10 +748,10 @@ namespace ts { const contextFlagsToSet = context & ~contextFlags; if (contextFlagsToSet) { // set the requested context flags - setContextFlag(true, contextFlagsToSet); + setContextFlag(/*val*/ true, contextFlagsToSet); const result = func(); // reset the context flags we just set - setContextFlag(false, contextFlagsToSet); + setContextFlag(/*val*/ false, contextFlagsToSet); return result; } @@ -1082,7 +1092,7 @@ namespace ts { token === SyntaxKind.NumericLiteral; } - function parsePropertyNameWorker(allowComputedPropertyNames: boolean): DeclarationName { + function parsePropertyNameWorker(allowComputedPropertyNames: boolean): PropertyName { if (token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral) { return parseLiteralNode(/*internName*/ true); } @@ -1092,12 +1102,12 @@ namespace ts { return parseIdentifierName(); } - function parsePropertyName(): DeclarationName { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ true); + function parsePropertyName(): PropertyName { + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ true); } function parseSimplePropertyName(): Identifier | LiteralExpression { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ false); + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ false); } function isSimplePropertyName() { @@ -1152,7 +1162,7 @@ namespace ts { } function parseAnyContextualModifier(): boolean { - return isModifier(token) && tryParse(nextTokenCanFollowModifier); + return isModifierKind(token) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier(): boolean { @@ -1202,7 +1212,7 @@ namespace ts { case ParsingContext.ObjectLiteralMembers: return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isLiteralPropertyName(); case ParsingContext.ObjectBindingElements: - return isLiteralPropertyName(); + return token === SyntaxKind.OpenBracketToken || isLiteralPropertyName(); case ParsingContext.HeritageClauseElement: // If we see { } then only consume it as an expression if it is followed by , or { // That way we won't consume the body of a class in its heritage clause. @@ -1380,7 +1390,7 @@ namespace ts { function isInSomeParsingContext(): boolean { for (let kind = 0; kind < ParsingContext.Count; kind++) { if (parsingContext & (1 << kind)) { - if (isListElement(kind, /* inErrorRecovery */ true) || isListTerminator(kind)) { + if (isListElement(kind, /*inErrorRecovery*/ true) || isListTerminator(kind)) { return true; } } @@ -1397,7 +1407,7 @@ namespace ts { result.pos = getNodePos(); while (!isListTerminator(kind)) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { const element = parseListElement(kind, parseElement); result.push(element); @@ -1746,7 +1756,7 @@ namespace ts { let commaStart = -1; // Meaning the previous token was not a comma while (true) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { result.push(parseListElement(kind, parseElement)); commaStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.CommaToken)) { @@ -1854,7 +1864,7 @@ namespace ts { // Report that we need an identifier. However, report it right after the dot, // and not on the next token. This is because the next token might actually // be an identifier and the error would be quite confusing. - return createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentToken*/ true, Diagnostics.Identifier_expected); + return createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ true, Diagnostics.Identifier_expected); } } @@ -1951,6 +1961,12 @@ namespace ts { return finishNode(node); } + function parseThisTypeNode(): TypeNode { + const node = createNode(SyntaxKind.ThisType); + nextToken(); + return finishNode(node); + } + function parseTypeQuery(): TypeQueryNode { const node = createNode(SyntaxKind.TypeQuery); parseExpected(SyntaxKind.TypeOfKeyword); @@ -1992,16 +2008,14 @@ namespace ts { function parseParameterType(): TypeNode { if (parseOptional(SyntaxKind.ColonToken)) { - return token === SyntaxKind.StringLiteral - ? parseLiteralNode(/*internName*/ true) - : parseType(); + return parseType(); } return undefined; } function isStartOfParameter(): boolean { - return token === SyntaxKind.DotDotDotToken || isIdentifierOrPattern() || isModifier(token) || token === SyntaxKind.AtToken; + return token === SyntaxKind.DotDotDotToken || isIdentifierOrPattern() || isModifierKind(token) || token === SyntaxKind.AtToken; } function setModifiers(node: Node, modifiers: ModifiersArray) { @@ -2022,7 +2036,7 @@ namespace ts { node.name = parseIdentifierOrPattern(); - if (getFullWidth(node.name) === 0 && node.flags === 0 && isModifier(token)) { + if (getFullWidth(node.name) === 0 && node.flags === 0 && isModifierKind(token)) { // in cases like // 'use strict' // function foo(static) @@ -2129,8 +2143,8 @@ namespace ts { parseSemicolon(); } - function parseSignatureMember(kind: SyntaxKind): SignatureDeclaration { - const node = createNode(kind); + function parseSignatureMember(kind: SyntaxKind): CallSignatureDeclaration | ConstructSignatureDeclaration { + const node = createNode(kind); if (kind === SyntaxKind.ConstructSignature) { parseExpected(SyntaxKind.NewKeyword); } @@ -2169,7 +2183,7 @@ namespace ts { return true; } - if (isModifier(token)) { + if (isModifierKind(token)) { nextToken(); if (isIdentifier()) { return true; @@ -2212,13 +2226,13 @@ namespace ts { return finishNode(node); } - function parsePropertyOrMethodSignature(): Declaration { + function parsePropertyOrMethodSignature(): PropertySignature | MethodSignature { const fullStart = scanner.getStartPos(); const name = parsePropertyName(); const questionToken = parseOptionalToken(SyntaxKind.QuestionToken); if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - const method = createNode(SyntaxKind.MethodSignature, fullStart); + const method = createNode(SyntaxKind.MethodSignature, fullStart); method.name = name; method.questionToken = questionToken; @@ -2229,7 +2243,7 @@ namespace ts { return finishNode(method); } else { - const property = createNode(SyntaxKind.PropertySignature, fullStart); + const property = createNode(SyntaxKind.PropertySignature, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -2245,7 +2259,7 @@ namespace ts { case SyntaxKind.OpenBracketToken: // Both for indexers and computed properties return true; default: - if (isModifier(token)) { + if (isModifierKind(token)) { const result = lookAhead(isStartOfIndexSignatureDeclaration); if (result) { return result; @@ -2257,7 +2271,7 @@ namespace ts { } function isStartOfIndexSignatureDeclaration() { - while (isModifier(token)) { + while (isModifierKind(token)) { nextToken(); } @@ -2273,7 +2287,7 @@ namespace ts { canParseSemicolon(); } - function parseTypeMember(): Declaration { + function parseTypeMember(): TypeElement { switch (token) { case SyntaxKind.OpenParenToken: case SyntaxKind.LessThanToken: @@ -2298,7 +2312,7 @@ namespace ts { // when incrementally parsing as the parser will produce the Index declaration // if it has the same text regardless of whether it is inside a class or an // object type. - if (isModifier(token)) { + if (isModifierKind(token)) { const result = tryParse(parseIndexSignatureWithModifiers); if (result) { return result; @@ -2331,14 +2345,14 @@ namespace ts { return finishNode(node); } - function parseObjectTypeMembers(): NodeArray { - let members: NodeArray; + function parseObjectTypeMembers(): NodeArray { + let members: NodeArray; if (parseExpected(SyntaxKind.OpenBraceToken)) { members = parseList(ParsingContext.TypeMembers, parseTypeMember); parseExpected(SyntaxKind.CloseBraceToken); } else { - members = createMissingList(); + members = createMissingList(); } return members; @@ -2382,9 +2396,12 @@ namespace ts { // If these are followed by a dot, then parse these out as a dotted type reference instead. const node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); + case SyntaxKind.StringLiteral: + return parseLiteralNode(/*internName*/ true); case SyntaxKind.VoidKeyword: - case SyntaxKind.ThisKeyword: return parseTokenNode(); + case SyntaxKind.ThisKeyword: + return parseThisTypeNode(); case SyntaxKind.TypeOfKeyword: return parseTypeQuery(); case SyntaxKind.OpenBraceToken: @@ -2412,6 +2429,7 @@ namespace ts { case SyntaxKind.OpenBracketToken: case SyntaxKind.LessThanToken: case SyntaxKind.NewKeyword: + case SyntaxKind.StringLiteral: return true; case SyntaxKind.OpenParenToken: // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, @@ -2477,11 +2495,11 @@ namespace ts { // ( ... return true; } - if (isIdentifier() || isModifier(token)) { + if (isIdentifier() || isModifierKind(token)) { nextToken(); if (token === SyntaxKind.ColonToken || token === SyntaxKind.CommaToken || token === SyntaxKind.QuestionToken || token === SyntaxKind.EqualsToken || - isIdentifier() || isModifier(token)) { + isIdentifier() || isModifierKind(token)) { // ( id : // ( id , // ( id ? @@ -2603,7 +2621,7 @@ namespace ts { // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator const saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } let expr = parseAssignmentExpressionOrHigher(); @@ -2613,7 +2631,7 @@ namespace ts { } if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return expr; } @@ -2767,7 +2785,7 @@ namespace ts { node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, false, Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ false); return finishNode(node); @@ -2888,7 +2906,7 @@ namespace ts { } // This *could* be a parenthesized arrow function. - // Return Unknown to const the caller know. + // Return Unknown to let the caller know. return Tristate.Unknown; } else { @@ -2987,7 +3005,7 @@ namespace ts { // user meant to supply a block. For example, if the user wrote: // // a => - // const v = 0; + // let v = 0; // } // // they may be missing an open brace. Check to see if that's the case so we can @@ -3214,7 +3232,7 @@ namespace ts { /** * Parse ES7 unary expression and await expression - * + * * ES7 UnaryExpression: * 1) SimpleUnaryExpression[?yield] * 2) IncrementExpression[?yield] ** UnaryExpression[?yield] @@ -3567,7 +3585,7 @@ namespace ts { parseExpected(SyntaxKind.GreaterThanToken); } else { - parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } node = createNode(SyntaxKind.JsxSelfClosingElement, fullStart); @@ -3603,7 +3621,7 @@ namespace ts { parseExpected(SyntaxKind.CloseBraceToken); } else { - parseExpected(SyntaxKind.CloseBraceToken, /*message*/ undefined, /*advance*/ false); + parseExpected(SyntaxKind.CloseBraceToken, /*message*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } @@ -3648,7 +3666,7 @@ namespace ts { parseExpected(SyntaxKind.GreaterThanToken); } else { - parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); @@ -3967,7 +3985,7 @@ namespace ts { // function BindingIdentifier[opt](FormalParameters){ FunctionBody } const saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } const node = createNode(SyntaxKind.FunctionExpression); @@ -3987,7 +4005,7 @@ namespace ts { node.body = parseFunctionBlock(/*allowYield*/ isGenerator, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return finishNode(node); @@ -4033,13 +4051,13 @@ namespace ts { // arrow function. The body of the function is not in [Decorator] context. const saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } const block = parseBlock(ignoreMissingOpenBrace, diagnosticMessage); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } setYieldContext(savedYieldContext); @@ -4581,7 +4599,6 @@ namespace ts { function parseObjectBindingElement(): BindingElement { const node = createNode(SyntaxKind.BindingElement); - // TODO(andersh): Handle computed properties const tokenIsIdentifier = isIdentifier(); const propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== SyntaxKind.ColonToken) { @@ -4589,7 +4606,7 @@ namespace ts { } else { parseExpected(SyntaxKind.ColonToken); - node.propertyName = propertyName; + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseBindingElementInitializer(/*inParameter*/ false); @@ -4715,7 +4732,7 @@ namespace ts { return finishNode(node); } - function parseMethodDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, asteriskToken: Node, name: DeclarationName, questionToken: Node, diagnosticMessage?: DiagnosticMessage): MethodDeclaration { + function parseMethodDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, asteriskToken: Node, name: PropertyName, questionToken: Node, diagnosticMessage?: DiagnosticMessage): MethodDeclaration { const method = createNode(SyntaxKind.MethodDeclaration, fullStart); method.decorators = decorators; setModifiers(method, modifiers); @@ -4729,7 +4746,7 @@ namespace ts { return finishNode(method); } - function parsePropertyDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, name: DeclarationName, questionToken: Node): ClassElement { + function parsePropertyDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, name: PropertyName, questionToken: Node): ClassElement { const property = createNode(SyntaxKind.PropertyDeclaration, fullStart); property.decorators = decorators; setModifiers(property, modifiers); @@ -4803,7 +4820,7 @@ namespace ts { } // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. - while (isModifier(token)) { + while (isModifierKind(token)) { idToken = token; // If the idToken is a class modifier (protected, private, public, and static), it is // certain that we are starting to parse class member. This allows better error recovery @@ -5013,8 +5030,8 @@ namespace ts { // implements is a future reserved word so // 'class implements' might mean either // - class expression with omitted name, 'implements' starts heritage clause - // - class with name 'implements' - // 'isImplementsClause' helps to disambiguate between these two cases + // - class with name 'implements' + // 'isImplementsClause' helps to disambiguate between these two cases return isIdentifier() && !isImplementsClause() ? parseIdentifier() : undefined; @@ -5518,7 +5535,7 @@ namespace ts { } export function parseJSDocTypeExpressionForTests(content: string, start: number, length: number) { - initializeState("file.js", content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, ScriptTarget.Latest, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); const jsDocTypeExpression = parseJSDocTypeExpression(start, length); const diagnostics = parseDiagnostics; clearState(); @@ -5629,6 +5646,7 @@ namespace ts { return parseTokenNode(); } + // TODO (drosen): Parse string literal types in JSDoc as well. return parseJSDocTypeReference(); } @@ -5838,7 +5856,7 @@ namespace ts { } export function parseIsolatedJSDocComment(content: string, start: number, length: number) { - initializeState("file.js", content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined); + initializeState("file.js", content, ScriptTarget.Latest, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); const jsDocComment = parseJSDocComment(/*parent:*/ undefined, start, length); const diagnostics = parseDiagnostics; clearState(); @@ -6156,7 +6174,7 @@ namespace ts { if (sourceFile.statements.length === 0) { // If we don't have any statements in the current source file, then there's no real // way to incrementally parse. So just do a full parse instead. - return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true); + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true); } // Make sure we're not trying to incrementally update a source file more than once. Once @@ -6220,7 +6238,7 @@ namespace ts { // inconsistent tree. Setting the parents on the new tree should be very fast. We // will immediately bail out of walking any subtrees when we can see that their parents // are already correct. - const result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true); + const result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true); return result; } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 4600d489c45..bfd87a239ac 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -14,10 +14,10 @@ namespace ts { export const version = "1.8.0"; - export function findConfigFile(searchPath: string): string { + export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string { let fileName = "tsconfig.json"; while (true) { - if (sys.fileExists(fileName)) { + if (fileExists(fileName)) { return fileName; } const parentPath = getDirectoryPath(searchPath); @@ -42,24 +42,24 @@ namespace ts { : compilerOptions.module === ModuleKind.CommonJS ? ModuleResolutionKind.NodeJs : ModuleResolutionKind.Classic; switch (moduleResolution) { - case ModuleResolutionKind.NodeJs: return nodeModuleNameResolver(moduleName, containingFile, host); + case ModuleResolutionKind.NodeJs: return nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); case ModuleResolutionKind.Classic: return classicNameResolver(moduleName, containingFile, compilerOptions, host); } } - export function nodeModuleNameResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { + export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { const containingDirectory = getDirectoryPath(containingFile); - + const supportedExtensions = getSupportedExtensions(compilerOptions); if (getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { const failedLookupLocations: string[] = []; const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - let resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + let resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName }, failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, host); return resolvedFileName ? { resolvedModule: { resolvedFileName }, failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations }; @@ -69,8 +69,8 @@ namespace ts { } } - function loadNodeModuleFromFile(candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { - return forEach(moduleFileExtensions, tryLoad); + function loadNodeModuleFromFile(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { + return forEach(extensions, tryLoad); function tryLoad(ext: string): string { const fileName = fileExtensionIs(candidate, ext) ? candidate : candidate + ext; @@ -84,7 +84,7 @@ namespace ts { } } - function loadNodeModuleFromDirectory(candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { + function loadNodeModuleFromDirectory(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { const packageJsonPath = combinePaths(candidate, "package.json"); if (host.fileExists(packageJsonPath)) { @@ -100,7 +100,7 @@ namespace ts { } if (jsonContent.typings) { - const result = loadNodeModuleFromFile(normalizePath(combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + const result = loadNodeModuleFromFile(extensions, normalizePath(combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); if (result) { return result; } @@ -111,7 +111,7 @@ namespace ts { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocation, host); } function loadModuleFromNodeModules(moduleName: string, directory: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { @@ -122,12 +122,13 @@ namespace ts { if (baseName !== "node_modules") { const nodeModulesFolder = combinePaths(directory, "node_modules"); const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName)); - let result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + // Load only typescript files irrespective of allowJs option if loading from node modules + let result = loadNodeModuleFromFile(supportedTypeScriptExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } @@ -162,6 +163,7 @@ namespace ts { const failedLookupLocations: string[] = []; let referencedSourceFile: string; + const supportedExtensions = getSupportedExtensions(compilerOptions); while (true) { searchName = normalizePath(combinePaths(searchPath, moduleName)); referencedSourceFile = forEach(supportedExtensions, extension => { @@ -284,13 +286,13 @@ namespace ts { } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[] { - const diagnostics = program.getOptionsDiagnostics(cancellationToken).concat( + let diagnostics = program.getOptionsDiagnostics(cancellationToken).concat( program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return sortAndDeduplicateDiagnostics(diagnostics); @@ -334,10 +336,13 @@ namespace ts { let classifiableNames: Map; let skipDefaultLib = options.noLib; + const supportedExtensions = getSupportedExtensions(options); const start = new Date().getTime(); host = host || createCompilerHost(options); + // Map storing if there is emit blocking diagnostics for given input + const hasEmitBlockingDiagnostics = createFileMap(getCanonicalFileName); const currentDirectory = host.getCurrentDirectory(); const resolveModuleNamesWorker = host.resolveModuleNames @@ -357,29 +362,26 @@ namespace ts { (oldOptions.noResolve !== options.noResolve) || (oldOptions.target !== options.target) || (oldOptions.noLib !== options.noLib) || - (oldOptions.jsx !== options.jsx)) { + (oldOptions.jsx !== options.jsx) || + (oldOptions.allowJs !== options.allowJs)) { oldProgram = undefined; } } if (!tryReuseStructureFromOldProgram()) { - forEach(rootNames, name => processRootFile(name, false)); + forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false)); // Do not process the default library if: // - The '--noLib' flag is used. // - A 'no-default-lib' reference comment is encountered in // processing the root files. if (!skipDefaultLib) { - processRootFile(host.getDefaultLibFileName(options), true); + processRootFile(host.getDefaultLibFileName(options), /*isDefaultLib*/ true); } } - verifyCompilerOptions(); - // unconditionally set oldProgram to undefined to prevent it from being captured in closure oldProgram = undefined; - programTime += new Date().getTime() - start; - program = { getRootFileNames: () => rootNames, getSourceFile, @@ -402,6 +404,11 @@ namespace ts { getTypeCount: () => getDiagnosticsProducingTypeChecker().getTypeCount(), getFileProcessingDiagnostics: () => fileProcessingDiagnostics }; + + verifyCompilerOptions(); + + programTime += new Date().getTime() - start; + return program; function getClassifiableNames() { @@ -523,6 +530,7 @@ namespace ts { getSourceFiles: program.getSourceFiles, writeFile: writeFileCallback || ( (fileName, data, writeByteOrderMark, onError) => host.writeFile(fileName, data, writeByteOrderMark, onError)), + isEmitBlocked, }; } @@ -538,6 +546,10 @@ namespace ts { return runWithCancellationToken(() => emitWorker(this, sourceFile, writeFileCallback, cancellationToken)); } + function isEmitBlocked(emitFileName: string): boolean { + return hasEmitBlockingDiagnostics.contains(toPath(emitFileName, currentDirectory, getCanonicalFileName)); + } + function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken): EmitResult { // If the noEmitOnError flag is set, then check if we have any errors so far. If so, // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we @@ -630,6 +642,13 @@ namespace ts { } function getSemanticDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { + // For JavaScript files, we don't want to report the normal typescript semantic errors. + // Instead, we just report errors for using TypeScript-only constructs from within a + // JavaScript file. + if (isSourceFileJavaScript(sourceFile)) { + return getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken); + } + return runWithCancellationToken(() => { const typeChecker = getDiagnosticsProducingTypeChecker(); @@ -643,6 +662,165 @@ namespace ts { }); } + function getJavaScriptSemanticDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { + return runWithCancellationToken(() => { + const diagnostics: Diagnostic[] = []; + walk(sourceFile); + + return diagnostics; + + function walk(node: Node): boolean { + if (!node) { + return false; + } + + switch (node.kind) { + case SyntaxKind.ImportEqualsDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ExportAssignment: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ClassDeclaration: + let classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case SyntaxKind.HeritageClause: + let heritageClause = node; + if (heritageClause.token === SyntaxKind.ImplementsKeyword) { + diagnostics.push(createDiagnosticForNode(node, Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.InterfaceDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.ModuleDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.TypeAliasDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + const functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case SyntaxKind.VariableStatement: + const variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case SyntaxKind.VariableDeclaration: + const variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + const expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + const start = expression.typeArguments.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, + Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.Parameter: + const parameter = node; + if (parameter.modifiers) { + const start = parameter.modifiers.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, + Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(createDiagnosticForNode(parameter.questionToken, Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); + return true; + } + if (parameter.type) { + diagnostics.push(createDiagnosticForNode(parameter.type, Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case SyntaxKind.PropertyDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.EnumDeclaration: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.TypeAssertionExpression: + let typeAssertionExpression = node; + diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case SyntaxKind.Decorator: + diagnostics.push(createDiagnosticForNode(node, Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + + return forEachChild(node, walk); + } + + function checkTypeParameters(typeParameters: NodeArray): boolean { + if (typeParameters) { + const start = typeParameters.pos; + diagnostics.push(createFileDiagnostic(sourceFile, start, typeParameters.end - start, Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + + function checkTypeAnnotation(type: TypeNode): boolean { + if (type) { + diagnostics.push(createDiagnosticForNode(type, Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + + return false; + } + + function checkModifiers(modifiers: ModifiersArray): boolean { + if (modifiers) { + for (const modifier of modifiers) { + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.DeclareKeyword: + diagnostics.push(createDiagnosticForNode(modifier, Diagnostics._0_can_only_be_used_in_a_ts_file, tokenToString(modifier.kind))); + return true; + + // These are all legal modifiers. + case SyntaxKind.StaticKeyword: + case SyntaxKind.ExportKeyword: + case SyntaxKind.ConstKeyword: + case SyntaxKind.DefaultKeyword: + case SyntaxKind.AbstractKeyword: + } + } + } + + return false; + } + }); + } + function getDeclarationDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { return runWithCancellationToken(() => { if (!isDeclarationFile(sourceFile)) { @@ -688,45 +866,60 @@ namespace ts { return; } + const isJavaScriptFile = isSourceFileJavaScript(file); + let imports: LiteralExpression[]; for (const node of file.statements) { - collect(node, /* allowRelativeModuleNames */ true); + collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); } file.imports = imports || emptyArray; - function collect(node: Node, allowRelativeModuleNames: boolean): void { - switch (node.kind) { - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ExportDeclaration: - let moduleNameExpr = getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== SyntaxKind.StringLiteral) { - break; - } - if (!(moduleNameExpr).text) { - break; - } + return; - if (allowRelativeModuleNames || !isExternalModuleNameRelative((moduleNameExpr).text)) { - (imports || (imports = [])).push(moduleNameExpr); - } - break; - case SyntaxKind.ModuleDeclaration: - if ((node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || isDeclarationFile(file))) { - // 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 => { + function collect(node: Node, allowRelativeModuleNames: boolean, collectOnlyRequireCalls: boolean): void { + if (!collectOnlyRequireCalls) { + switch (node.kind) { + case SyntaxKind.ImportDeclaration: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ExportDeclaration: + let moduleNameExpr = getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== SyntaxKind.StringLiteral) { + break; + } + if (!(moduleNameExpr).text) { + break; + } + + if (allowRelativeModuleNames || !isExternalModuleNameRelative((moduleNameExpr).text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case SyntaxKind.ModuleDeclaration: + if ((node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || isDeclarationFile(file))) { // 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. - collect(node, /* allowRelativeModuleNames */ false); - }); - } - break; + // 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 => { + // 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. + collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); + }); + } + break; + } + } + + if (isJavaScriptFile) { + if (isRequireCall(node)) { + (imports || (imports = [])).push((node).arguments[0]); + } + else { + forEachChild(node, node => collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true)); + } } } } @@ -784,12 +977,12 @@ namespace ts { } // Get source file from normalized fileName - function findSourceFile(fileName: string, normalizedAbsolutePath: Path, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number): SourceFile { - if (filesByName.contains(normalizedAbsolutePath)) { - const file = filesByName.get(normalizedAbsolutePath); + function findSourceFile(fileName: string, path: Path, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number): SourceFile { + if (filesByName.contains(path)) { + const file = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path // NOTE: this only makes sense for case-insensitive file systems - if (file && options.forceConsistentCasingInFileNames && getNormalizedAbsolutePath(file.fileName, currentDirectory) !== normalizedAbsolutePath) { + if (file && options.forceConsistentCasingInFileNames && getNormalizedAbsolutePath(file.fileName, currentDirectory) !== getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file.fileName, refFile, refPos, refEnd); } @@ -807,18 +1000,18 @@ namespace ts { } }); - filesByName.set(normalizedAbsolutePath, file); + filesByName.set(path, file); if (file) { - file.path = normalizedAbsolutePath; + file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case - const existingFile = filesByNameIgnoreCase.get(normalizedAbsolutePath); + const existingFile = filesByNameIgnoreCase.get(path); if (existingFile) { reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd); } else { - filesByNameIgnoreCase.set(normalizedAbsolutePath, file); + filesByNameIgnoreCase.set(path, file); } } @@ -833,7 +1026,6 @@ namespace ts { processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -847,7 +1039,7 @@ namespace ts { function processReferencedFiles(file: SourceFile, basePath: string) { forEach(file.referencedFiles, ref => { const referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName); - processSourceFile(referencedFileName, /* isDefaultLib */ false, file, ref.pos, ref.end); + processSourceFile(referencedFileName, /*isDefaultLib*/ false, file, ref.pos, ref.end); }); } @@ -865,7 +1057,7 @@ namespace ts { const resolution = resolutions[i]; setResolvedModule(file, moduleNames[i], resolution); if (resolution && !options.noResolve) { - const importedFile = findSourceFile(resolution.resolvedFileName, toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /* isDefaultLib */ false, file, skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); + const importedFile = findSourceFile(resolution.resolvedFileName, toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { if (!isExternalModule(importedFile)) { @@ -889,7 +1081,7 @@ namespace ts { function computeCommonSourceDirectory(sourceFiles: SourceFile[]): string { let commonPathComponents: string[]; - forEach(files, sourceFile => { + const failed = forEach(files, sourceFile => { // Each file contributes into common source file path if (isDeclarationFile(sourceFile)) { return; @@ -905,10 +1097,10 @@ namespace ts { } for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { - programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; + // Failed to find any common path component + return true; } // New common path found that is 0 -> i-1 @@ -923,6 +1115,15 @@ namespace ts { } }); + // A common path can not be found when paths span multiple drives on windows, for example + if (failed) { + return ""; + } + + if (!commonPathComponents) { // Can happen when all input files are .d.ts files + return currentDirectory; + } + return getNormalizedPathFromPathComponents(commonPathComponents); } @@ -971,16 +1172,15 @@ namespace ts { if (options.mapRoot) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")); } - if (options.sourceRoot) { - programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap")); - } } - if (options.inlineSources) { if (!options.sourceMap && !options.inlineSourceMap) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); } + if (options.sourceRoot) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources")); + } } if (options.out && options.outFile) { @@ -992,10 +1192,9 @@ namespace ts { if (options.mapRoot) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap")); } - if (options.sourceRoot) { + if (options.sourceRoot && !options.inlineSourceMap) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap")); } - return; } const languageVersion = options.target || ScriptTarget.ES3; @@ -1024,12 +1223,16 @@ namespace ts { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); } + // Cannot specify module gen that isn't amd or system with --out + if (outFile && options.module && !(options.module === ModuleKind.AMD || options.module === ModuleKind.System)) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile")); + } + // there has to be common source directory if user specified --outdir || --sourceRoot // 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 - (!outFile || firstExternalModuleSourceFile !== undefined))) { + options.mapRoot) { // there is --mapRoot specified if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { // If a rootDir is specified and is valid use it as the commonSourceDirectory @@ -1038,6 +1241,10 @@ namespace ts { else { // Compute the commonSourceDirectory from the input files commonSourceDirectory = computeCommonSourceDirectory(files); + // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure + if (options.outDir && commonSourceDirectory === "" && forEach(files, file => getRootLength(file.fileName) > 1)) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + } } if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { @@ -1065,11 +1272,49 @@ namespace ts { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration")); } } + else if (options.allowJs && options.declaration) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + + // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files + if (!options.noEmit) { + const emitHost = getEmitHost(); + const emitFilesSeen = createFileMap(!host.useCaseSensitiveFileNames() ? key => key.toLocaleLowerCase() : undefined); + forEachExpectedEmitFile(emitHost, (emitFileNames, sourceFiles, isBundledEmit) => { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + + // Verify that all the emit files are unique and don't overwrite input files + function verifyEmitFilePath(emitFileName: string, emitFilesSeen: FileMap) { + if (emitFileName) { + const emitFilePath = toPath(emitFileName, currentDirectory, getCanonicalFileName); + // Report error if the output overwrites input file + if (filesByName.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + } + + // Report error if multiple files write into same file + if (emitFilesSeen.contains(emitFilePath)) { + // Already seen the same emit file - report error + createEmitBlockingDiagnostics(emitFileName, emitFilePath, Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + } + else { + emitFilesSeen.set(emitFilePath, true); + } + } + } + } + + function createEmitBlockingDiagnostics(emitFileName: string, emitFilePath: Path, message: DiagnosticMessage) { + hasEmitBlockingDiagnostics.set(toPath(emitFileName, currentDirectory, getCanonicalFileName), true); + programDiagnostics.add(createCompilerDiagnostic(message, emitFileName)); } } } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 9703ef8517b..4289d910608 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1634,11 +1634,11 @@ namespace ts { } function lookAhead(callback: () => T): T { - return speculationHelper(callback, /*isLookahead:*/ true); + return speculationHelper(callback, /*isLookahead*/ true); } function tryScan(callback: () => T): T { - return speculationHelper(callback, /*isLookahead:*/ false); + return speculationHelper(callback, /*isLookahead*/ false); } function setText(newText: string, start: number, length: number) { diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 79158cf4e9d..c288e11eb24 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -280,7 +280,7 @@ namespace ts { } if (commandLine.options.version) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, ts.version), /* compilerHost */ undefined); + printVersion(); return sys.exit(ExitStatus.Success); } @@ -303,7 +303,7 @@ namespace ts { } else if (commandLine.fileNames.length === 0 && isJSONSupported()) { const searchPath = normalizePath(sys.getCurrentDirectory()); - configFileName = findConfigFile(searchPath); + configFileName = findConfigFile(searchPath, sys.fileExists); } if (commandLine.fileNames.length === 0 && !configFileName) { @@ -346,10 +346,21 @@ namespace ts { return; } } + if (!cachedConfigFileText) { + const error = createCompilerDiagnostic(Diagnostics.File_0_not_found, configFileName); + reportDiagnostics([error], /* compilerHost */ undefined); + sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + return; + } const result = parseConfigFileTextToJson(configFileName, cachedConfigFileText); const configObject = result.config; - const configParseResult = parseJsonConfigFileContent(configObject, sys, getDirectoryPath(configFileName)); + if (!configObject) { + reportDiagnostics([result.error], /* compilerHost */ undefined); + sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + return; + } + const configParseResult = parseJsonConfigFileContent(configObject, sys, getDirectoryPath(configFileName), commandLine.options); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors, /* compilerHost */ undefined); sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); @@ -365,7 +376,7 @@ namespace ts { if (configFileName) { const configParseResult = parseConfigFile(); rootFileNames = configParseResult.fileNames; - compilerOptions = extend(commandLine.options, configParseResult.options); + compilerOptions = configParseResult.options; } else { rootFileNames = commandLine.fileNames; @@ -458,7 +469,7 @@ namespace ts { } function watchedDirectoryChanged(fileName: string) { - if (fileName && !ts.isSupportedSourceFileName(fileName)) { + if (fileName && !ts.isSupportedSourceFileName(fileName, commandLine.options)) { return; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b846dc88aab..dafb1c1f4f1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -204,6 +204,7 @@ namespace ts { UnionType, IntersectionType, ParenthesizedType, + ThisType, // Binding patterns ObjectBindingPattern, ArrayBindingPattern, @@ -348,8 +349,8 @@ namespace ts { LastKeyword = OfKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, - FirstTypeNode = TypeReference, - LastTypeNode = ParenthesizedType, + FirstTypeNode = TypePredicate, + LastTypeNode = ThisType, FirstPunctuation = OpenBraceToken, LastPunctuation = CaretEqualsToken, FirstToken = Unknown, @@ -474,15 +475,29 @@ namespace ts { hasTrailingComma?: boolean; } - export interface ModifiersArray extends NodeArray { + export interface ModifiersArray extends NodeArray { flags: number; } + // @kind(SyntaxKind.AbstractKeyword) + // @kind(SyntaxKind.AsyncKeyword) + // @kind(SyntaxKind.ConstKeyword) + // @kind(SyntaxKind.DeclareKeyword) + // @kind(SyntaxKind.DefaultKeyword) + // @kind(SyntaxKind.ExportKeyword) + // @kind(SyntaxKind.PublicKeyword) + // @kind(SyntaxKind.PrivateKeyword) + // @kind(SyntaxKind.ProtectedKeyword) + // @kind(SyntaxKind.StaticKeyword) + export interface Modifier extends Node { } + + // @kind(SyntaxKind.Identifier) export interface Identifier extends PrimaryExpression { text: string; // Text of identifier (with escapes converted to characters) originalKeywordKind?: SyntaxKind; // Original syntaxKind which get set so that we can report an error later } + // @kind(SyntaxKind.QualifiedName) export interface QualifiedName extends Node { // Must have same layout as PropertyAccess left: EntityName; @@ -491,6 +506,8 @@ namespace ts { export type EntityName = Identifier | QualifiedName; + export type PropertyName = Identifier | LiteralExpression | ComputedPropertyName; + export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; export interface Declaration extends Node { @@ -498,14 +515,21 @@ namespace ts { name?: DeclarationName; } + export interface DeclarationStatement extends Declaration, Statement { + name?: Identifier; + } + + // @kind(SyntaxKind.ComputedPropertyName) export interface ComputedPropertyName extends Node { expression: Expression; } + // @kind(SyntaxKind.Decorator) export interface Decorator extends Node { expression: LeftHandSideExpression; } + // @kind(SyntaxKind.TypeParameter) export interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -515,12 +539,19 @@ namespace ts { } export interface SignatureDeclaration extends Declaration { + name?: PropertyName; typeParameters?: NodeArray; parameters: NodeArray; type?: TypeNode; } - // SyntaxKind.VariableDeclaration + // @kind(SyntaxKind.CallSignature) + export interface CallSignatureDeclaration extends SignatureDeclaration, TypeElement { } + + // @kind(SyntaxKind.ConstructSignature) + export interface ConstructSignatureDeclaration extends SignatureDeclaration, TypeElement { } + + // @kind(SyntaxKind.VariableDeclaration) export interface VariableDeclaration extends Declaration { parent?: VariableDeclarationList; name: Identifier | BindingPattern; // Declared variable name @@ -528,11 +559,12 @@ namespace ts { initializer?: Expression; // Optional initializer } + // @kind(SyntaxKind.VariableDeclarationList) export interface VariableDeclarationList extends Node { declarations: NodeArray; } - // SyntaxKind.Parameter + // @kind(SyntaxKind.Parameter) export interface ParameterDeclaration extends Declaration { dotDotDotToken?: Node; // Present on rest parameter name: Identifier | BindingPattern; // Declared parameter name @@ -541,35 +573,43 @@ namespace ts { initializer?: Expression; // Optional initializer } - // SyntaxKind.BindingElement + // @kind(SyntaxKind.BindingElement) export interface BindingElement extends Declaration { - propertyName?: Identifier; // Binding property name (in object binding pattern) + propertyName?: PropertyName; // Binding property name (in object binding pattern) dotDotDotToken?: Node; // Present on rest binding element name: Identifier | BindingPattern; // Declared binding element name initializer?: Expression; // Optional initializer } - // SyntaxKind.Property - export interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; // Declared property name + // @kind(SyntaxKind.PropertySignature) + export interface PropertySignature extends TypeElement { + name: PropertyName; // Declared property name questionToken?: Node; // Present on optional property type?: TypeNode; // Optional type annotation + } + + // @kind(SyntaxKind.PropertyDeclaration) + export interface PropertyDeclaration extends ClassElement { + questionToken?: Node; // Present for use with reporting a grammar error + name: PropertyName; + type?: TypeNode; initializer?: Expression; // Optional initializer } export interface ObjectLiteralElement extends Declaration { _objectLiteralBrandBrand: any; - } + name?: PropertyName; + } - // SyntaxKind.PropertyAssignment + // @kind(SyntaxKind.PropertyAssignment) export interface PropertyAssignment extends ObjectLiteralElement { _propertyAssignmentBrand: any; - name: DeclarationName; + name: PropertyName; questionToken?: Node; initializer: Expression; } - // SyntaxKind.ShorthandPropertyAssignment + // @kind(SyntaxKind.ShorthandPropertyAssignment) export interface ShorthandPropertyAssignment extends ObjectLiteralElement { name: Identifier; questionToken?: Node; @@ -587,7 +627,7 @@ namespace ts { // SyntaxKind.ShorthandPropertyAssignment // SyntaxKind.EnumMember export interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: DeclarationName; questionToken?: Node; @@ -595,10 +635,20 @@ namespace ts { initializer?: Expression; } + export interface PropertyLikeDeclaration extends Declaration { + name: PropertyName; + } + export interface BindingPattern extends Node { elements: NodeArray; } + // @kind(SyntaxKind.ObjectBindingPattern) + export interface ObjectBindingPattern extends BindingPattern { } + + // @kind(SyntaxKind.ArrayBindingPattern) + export interface ArrayBindingPattern extends BindingPattern { } + /** * Several node kinds share function-like features such as a signature, * a name, and a body. These nodes should extend FunctionLikeDeclaration. @@ -615,9 +665,15 @@ namespace ts { body?: Block | Expression; } - export interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { + // @kind(SyntaxKind.FunctionDeclaration) + export interface FunctionDeclaration extends FunctionLikeDeclaration, DeclarationStatement { name?: Identifier; - body?: Block; + body?: FunctionBody; + } + + // @kind(SyntaxKind.MethodSignature) + export interface MethodSignature extends SignatureDeclaration, TypeElement { + name: PropertyName; } // Note that a MethodDeclaration is considered both a ClassElement and an ObjectLiteralElement. @@ -629,15 +685,19 @@ namespace ts { // Because of this, it may be necessary to determine what sort of MethodDeclaration you have // at later stages of the compiler pipeline. In that case, you can either check the parent kind // of the method, or use helpers like isObjectLiteralMethodDeclaration + // @kind(SyntaxKind.MethodDeclaration) export interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; + name: PropertyName; + body?: FunctionBody; } + // @kind(SyntaxKind.Constructor) export interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; + body?: FunctionBody; } // For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. + // @kind(SyntaxKind.SemicolonClassElement) export interface SemicolonClassElement extends ClassElement { _semicolonClassElementBrand: any; } @@ -646,13 +706,28 @@ namespace ts { // ClassElement and an ObjectLiteralElement. export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; - body: Block; + name: PropertyName; + body: FunctionBody; } - export interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { + // @kind(SyntaxKind.GetAccessor) + export interface GetAccessorDeclaration extends AccessorDeclaration { } + + // @kind(SyntaxKind.SetAccessor) + export interface SetAccessorDeclaration extends AccessorDeclaration { } + + // @kind(SyntaxKind.IndexSignature) + export interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { _indexSignatureDeclarationBrand: any; } + // @kind(SyntaxKind.AnyKeyword) + // @kind(SyntaxKind.NumberKeyword) + // @kind(SyntaxKind.BooleanKeyword) + // @kind(SyntaxKind.StringKeyword) + // @kind(SyntaxKind.SymbolKeyword) + // @kind(SyntaxKind.VoidKeyword) + // @kind(SyntaxKind.ThisType) export interface TypeNode extends Node { _typeNodeBrand: any; } @@ -661,29 +736,41 @@ namespace ts { _functionOrConstructorTypeNodeBrand: any; } + // @kind(SyntaxKind.FunctionType) + export interface FunctionTypeNode extends FunctionOrConstructorTypeNode { } + + // @kind(SyntaxKind.ConstructorType) + export interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { } + + // @kind(SyntaxKind.TypeReference) export interface TypeReferenceNode extends TypeNode { typeName: EntityName; typeArguments?: NodeArray; } + // @kind(SyntaxKind.TypePredicate) export interface TypePredicateNode extends TypeNode { parameterName: Identifier; type: TypeNode; } + // @kind(SyntaxKind.TypeQuery) export interface TypeQueryNode extends TypeNode { exprName: EntityName; } // A TypeLiteral is the declaration node for an anonymous symbol. + // @kind(SyntaxKind.TypeLiteral) export interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; + members: NodeArray; } + // @kind(SyntaxKind.ArrayType) export interface ArrayTypeNode extends TypeNode { elementType: TypeNode; } + // @kind(SyntaxKind.TupleType) export interface TupleTypeNode extends TypeNode { elementTypes: NodeArray; } @@ -692,16 +779,20 @@ namespace ts { types: NodeArray; } + // @kind(SyntaxKind.UnionType) export interface UnionTypeNode extends UnionOrIntersectionTypeNode { } + // @kind(SyntaxKind.IntersectionType) export interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { } + // @kind(SyntaxKind.ParenthesizedType) export interface ParenthesizedTypeNode extends TypeNode { type: TypeNode; } // Note that a StringLiteral AST node is both an Expression and a TypeNode. The latter is - // because string literals can appear in the type annotation of a parameter node. + // because string literals can appear in type annotations as well. + // @kind(SyntaxKind.StringLiteral) export interface StringLiteral extends LiteralExpression, TypeNode { _stringLiteralBrand: any; } @@ -718,6 +809,9 @@ namespace ts { contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution } + // @kind(SyntaxKind.OmittedExpression) + export interface OmittedExpression extends Expression { } + export interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -726,11 +820,13 @@ namespace ts { _incrementExpressionBrand: any; } + // @kind(SyntaxKind.PrefixUnaryExpression) export interface PrefixUnaryExpression extends IncrementExpression { operator: SyntaxKind; operand: UnaryExpression; } + // @kind(SyntaxKind.PostfixUnaryExpression) export interface PostfixUnaryExpression extends IncrementExpression { operand: LeftHandSideExpression; operator: SyntaxKind; @@ -748,37 +844,50 @@ namespace ts { _memberExpressionBrand: any; } + // @kind(SyntaxKind.TrueKeyword) + // @kind(SyntaxKind.FalseKeyword) + // @kind(SyntaxKind.NullKeyword) + // @kind(SyntaxKind.ThisKeyword) + // @kind(SyntaxKind.SuperKeyword) export interface PrimaryExpression extends MemberExpression { _primaryExpressionBrand: any; } + // @kind(SyntaxKind.DeleteExpression) export interface DeleteExpression extends UnaryExpression { expression: UnaryExpression; } + // @kind(SyntaxKind.TypeOfExpression) export interface TypeOfExpression extends UnaryExpression { expression: UnaryExpression; } + // @kind(SyntaxKind.VoidExpression) export interface VoidExpression extends UnaryExpression { expression: UnaryExpression; } + // @kind(SyntaxKind.AwaitExpression) export interface AwaitExpression extends UnaryExpression { expression: UnaryExpression; } + // @kind(SyntaxKind.YieldExpression) export interface YieldExpression extends Expression { asteriskToken?: Node; expression?: Expression; } - export interface BinaryExpression extends Expression { + // @kind(SyntaxKind.BinaryExpression) + // Binary expressions can be declarations if they are 'exports.foo = bar' expressions in JS files + export interface BinaryExpression extends Expression, Declaration { left: Expression; operatorToken: Node; right: Expression; } + // @kind(SyntaxKind.ConditionalExpression) export interface ConditionalExpression extends Expression { condition: Expression; questionToken: Node; @@ -787,24 +896,37 @@ namespace ts { whenFalse: Expression; } + export type FunctionBody = Block; + export type ConciseBody = FunctionBody | Expression; + + // @kind(SyntaxKind.FunctionExpression) export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { name?: Identifier; - body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional + body: FunctionBody; // Required, whereas the member inherited from FunctionDeclaration is optional } + // @kind(SyntaxKind.ArrowFunction) export interface ArrowFunction extends Expression, FunctionLikeDeclaration { equalsGreaterThanToken: Node; + body: ConciseBody; } // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral, // or any literal of a template, 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". + // @kind(SyntaxKind.NumericLiteral) + // @kind(SyntaxKind.RegularExpressionLiteral) + // @kind(SyntaxKind.NoSubstitutionTemplateLiteral) + // @kind(SyntaxKind.TemplateHead) + // @kind(SyntaxKind.TemplateMiddle) + // @kind(SyntaxKind.TemplateTail) export interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; } + // @kind(SyntaxKind.TemplateExpression) export interface TemplateExpression extends PrimaryExpression { head: LiteralExpression; templateSpans: NodeArray; @@ -812,52 +934,63 @@ namespace ts { // Each of these corresponds to a substitution expression and a template literal, in that order. // The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral. + // @kind(SyntaxKind.TemplateSpan) export interface TemplateSpan extends Node { expression: Expression; literal: LiteralExpression; } + // @kind(SyntaxKind.ParenthesizedExpression) export interface ParenthesizedExpression extends PrimaryExpression { expression: Expression; } + // @kind(SyntaxKind.ArrayLiteralExpression) export interface ArrayLiteralExpression extends PrimaryExpression { elements: NodeArray; } + // @kind(SyntaxKind.SpreadElementExpression) export interface SpreadElementExpression extends Expression { expression: Expression; } // An ObjectLiteralExpression is the declaration node for an anonymous symbol. + // @kind(SyntaxKind.ObjectLiteralExpression) export interface ObjectLiteralExpression extends PrimaryExpression, Declaration { properties: NodeArray; } - export interface PropertyAccessExpression extends MemberExpression { + // @kind(SyntaxKind.PropertyAccessExpression) + export interface PropertyAccessExpression extends MemberExpression, Declaration { expression: LeftHandSideExpression; dotToken: Node; name: Identifier; } + // @kind(SyntaxKind.ElementAccessExpression) export interface ElementAccessExpression extends MemberExpression { expression: LeftHandSideExpression; argumentExpression?: Expression; } + // @kind(SyntaxKind.CallExpression) export interface CallExpression extends LeftHandSideExpression { expression: LeftHandSideExpression; typeArguments?: NodeArray; arguments: NodeArray; } + // @kind(SyntaxKind.ExpressionWithTypeArguments) export interface ExpressionWithTypeArguments extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } + // @kind(SyntaxKind.NewExpression) export interface NewExpression extends CallExpression, PrimaryExpression { } + // @kind(SyntaxKind.TaggedTemplateExpression) export interface TaggedTemplateExpression extends MemberExpression { tag: LeftHandSideExpression; template: LiteralExpression | TemplateExpression; @@ -865,11 +998,13 @@ namespace ts { export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator; + // @kind(SyntaxKind.AsExpression) export interface AsExpression extends Expression { expression: Expression; type: TypeNode; } + // @kind(SyntaxKind.TypeAssertionExpression) export interface TypeAssertion extends UnaryExpression { type: TypeNode; expression: UnaryExpression; @@ -878,6 +1013,7 @@ namespace ts { export type AssertionExpression = TypeAssertion | AsExpression; /// A JSX expression of the form ... + // @kind(SyntaxKind.JsxElement) export interface JsxElement extends PrimaryExpression { openingElement: JsxOpeningElement; children: NodeArray; @@ -885,6 +1021,7 @@ namespace ts { } /// The opening element of a ... JsxElement + // @kind(SyntaxKind.JsxOpeningElement) export interface JsxOpeningElement extends Expression { _openingElementBrand?: any; tagName: EntityName; @@ -892,6 +1029,7 @@ namespace ts { } /// A JSX expression of the form + // @kind(SyntaxKind.JsxSelfClosingElement) export interface JsxSelfClosingElement extends PrimaryExpression, JsxOpeningElement { _selfClosingElementBrand?: any; } @@ -899,24 +1037,29 @@ namespace ts { /// Either the opening tag in a ... pair, or the lone in a self-closing form export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; + // @kind(SyntaxKind.JsxAttribute) export interface JsxAttribute extends Node { name: Identifier; /// JSX attribute initializers are optional; is sugar for initializer?: Expression; } + // @kind(SyntaxKind.JsxSpreadAttribute) export interface JsxSpreadAttribute extends Node { expression: Expression; } + // @kind(SyntaxKind.JsxClosingElement) export interface JsxClosingElement extends Node { tagName: EntityName; } + // @kind(SyntaxKind.JsxExpression) export interface JsxExpression extends Expression { expression?: Expression; } + // @kind(SyntaxKind.JsxText) export interface JsxText extends Node { _jsxTextExpressionBrand: any; } @@ -927,18 +1070,35 @@ namespace ts { _statementBrand: any; } + // @kind(SyntaxKind.EmptyStatement) + export interface EmptyStatement extends Statement { } + + // @kind(SyntaxKind.DebuggerStatement) + export interface DebuggerStatement extends Statement { } + + // @kind(SyntaxKind.MissingDeclaration) + export interface MissingDeclaration extends DeclarationStatement, ClassElement, ObjectLiteralElement, TypeElement { + name?: Identifier; + } + + export type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; + + // @kind(SyntaxKind.Block) export interface Block extends Statement { statements: NodeArray; } + // @kind(SyntaxKind.VariableStatement) export interface VariableStatement extends Statement { declarationList: VariableDeclarationList; } + // @kind(SyntaxKind.ExpressionStatement) export interface ExpressionStatement extends Statement { expression: Expression; } + // @kind(SyntaxKind.IfStatement) export interface IfStatement extends Statement { expression: Expression; thenStatement: Statement; @@ -949,78 +1109,101 @@ namespace ts { statement: Statement; } + // @kind(SyntaxKind.DoStatement) export interface DoStatement extends IterationStatement { expression: Expression; } + // @kind(SyntaxKind.WhileStatement) export interface WhileStatement extends IterationStatement { expression: Expression; } + // @kind(SyntaxKind.ForStatement) export interface ForStatement extends IterationStatement { initializer?: VariableDeclarationList | Expression; condition?: Expression; incrementor?: Expression; } + // @kind(SyntaxKind.ForInStatement) export interface ForInStatement extends IterationStatement { initializer: VariableDeclarationList | Expression; expression: Expression; } + // @kind(SyntaxKind.ForOfStatement) export interface ForOfStatement extends IterationStatement { initializer: VariableDeclarationList | Expression; expression: Expression; } - export interface BreakOrContinueStatement extends Statement { + // @kind(SyntaxKind.BreakStatement) + export interface BreakStatement extends Statement { label?: Identifier; } + // @kind(SyntaxKind.ContinueStatement) + export interface ContinueStatement extends Statement { + label?: Identifier; + } + + export type BreakOrContinueStatement = BreakStatement | ContinueStatement; + + // @kind(SyntaxKind.ReturnStatement) export interface ReturnStatement extends Statement { expression?: Expression; } + // @kind(SyntaxKind.WithStatement) export interface WithStatement extends Statement { expression: Expression; statement: Statement; } + // @kind(SyntaxKind.SwitchStatement) export interface SwitchStatement extends Statement { expression: Expression; caseBlock: CaseBlock; } + // @kind(SyntaxKind.CaseBlock) export interface CaseBlock extends Node { clauses: NodeArray; } + // @kind(SyntaxKind.CaseClause) export interface CaseClause extends Node { expression?: Expression; statements: NodeArray; } + // @kind(SyntaxKind.DefaultClause) export interface DefaultClause extends Node { statements: NodeArray; } export type CaseOrDefaultClause = CaseClause | DefaultClause; + // @kind(SyntaxKind.LabeledStatement) export interface LabeledStatement extends Statement { label: Identifier; statement: Statement; } + // @kind(SyntaxKind.ThrowStatement) export interface ThrowStatement extends Statement { expression: Expression; } + // @kind(SyntaxKind.TryStatement) export interface TryStatement extends Statement { tryBlock: Block; catchClause?: CatchClause; finallyBlock?: Block; } + // @kind(SyntaxKind.CatchClause) export interface CatchClause extends Node { variableDeclaration: VariableDeclaration; block: Block; @@ -1033,34 +1216,48 @@ namespace ts { members: NodeArray; } - export interface ClassDeclaration extends ClassLikeDeclaration, Statement { + // @kind(SyntaxKind.ClassDeclaration) + export interface ClassDeclaration extends ClassLikeDeclaration, DeclarationStatement { + name?: Identifier; } + // @kind(SyntaxKind.ClassExpression) export interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { } export interface ClassElement extends Declaration { _classElementBrand: any; + name?: PropertyName; } - export interface InterfaceDeclaration extends Declaration, Statement { + export interface TypeElement extends Declaration { + _typeElementBrand: any; + name?: PropertyName; + questionToken?: Node; + } + + // @kind(SyntaxKind.InterfaceDeclaration) + export interface InterfaceDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; - members: NodeArray; + members: NodeArray; } + // @kind(SyntaxKind.HeritageClause) export interface HeritageClause extends Node { token: SyntaxKind; types?: NodeArray; } - export interface TypeAliasDeclaration extends Declaration, Statement { + // @kind(SyntaxKind.TypeAliasDeclaration) + export interface TypeAliasDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; type: TypeNode; } + // @kind(SyntaxKind.EnumMember) export interface EnumMember extends Declaration { // This does include ComputedPropertyName, but the parser will give an error // if it parses a ComputedPropertyName in an EnumMember @@ -1068,21 +1265,27 @@ namespace ts { initializer?: Expression; } - export interface EnumDeclaration extends Declaration, Statement { + // @kind(SyntaxKind.EnumDeclaration) + export interface EnumDeclaration extends DeclarationStatement { name: Identifier; members: NodeArray; } - export interface ModuleDeclaration extends Declaration, Statement { + export type ModuleBody = ModuleBlock | ModuleDeclaration; + + // @kind(SyntaxKind.ModuleDeclaration) + export interface ModuleDeclaration extends DeclarationStatement { name: Identifier | LiteralExpression; body: ModuleBlock | ModuleDeclaration; } + // @kind(SyntaxKind.ModuleBlock) export interface ModuleBlock extends Node, Statement { statements: NodeArray; } - export interface ImportEqualsDeclaration extends Declaration, Statement { + // @kind(SyntaxKind.ImportEqualsDeclaration) + export interface ImportEqualsDeclaration extends DeclarationStatement { name: Identifier; // 'EntityName' for an internal module reference, 'ExternalModuleReference' for an external @@ -1090,6 +1293,7 @@ namespace ts { moduleReference: EntityName | ExternalModuleReference; } + // @kind(SyntaxKind.ExternalModuleReference) export interface ExternalModuleReference extends Node { expression?: Expression; } @@ -1098,6 +1302,7 @@ namespace ts { // import "mod" => importClause = undefined, moduleSpecifier = "mod" // In rest of the cases, module specifier is string literal corresponding to module // ImportClause information is shown at its declaration below. + // @kind(SyntaxKind.ImportDeclaration) export interface ImportDeclaration extends Statement { importClause?: ImportClause; moduleSpecifier: Expression; @@ -1109,36 +1314,51 @@ namespace ts { // import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns } // import { a, b as x } from "mod" => name = undefined, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]} // import d, { a, b as x } from "mod" => name = d, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]} + // @kind(SyntaxKind.ImportClause) export interface ImportClause extends Declaration { name?: Identifier; // Default binding namedBindings?: NamespaceImport | NamedImports; } + // @kind(SyntaxKind.NamespaceImport) export interface NamespaceImport extends Declaration { name: Identifier; } - export interface ExportDeclaration extends Declaration, Statement { + // @kind(SyntaxKind.ExportDeclaration) + export interface ExportDeclaration extends DeclarationStatement { exportClause?: NamedExports; moduleSpecifier?: Expression; } - export interface NamedImportsOrExports extends Node { - elements: NodeArray; + // @kind(SyntaxKind.NamedImports) + export interface NamedImports extends Node { + elements: NodeArray; } - export type NamedImports = NamedImportsOrExports; - export type NamedExports = NamedImportsOrExports; + // @kind(SyntaxKind.NamedExports) + export interface NamedExports extends Node { + elements: NodeArray; + } - export interface ImportOrExportSpecifier extends Declaration { + export type NamedImportsOrExports = NamedImports | NamedExports; + + // @kind(SyntaxKind.ImportSpecifier) + export interface ImportSpecifier extends Declaration { propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent) name: Identifier; // Declared name } - export type ImportSpecifier = ImportOrExportSpecifier; - export type ExportSpecifier = ImportOrExportSpecifier; + // @kind(SyntaxKind.ExportSpecifier) + export interface ExportSpecifier extends Declaration { + propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent) + name: Identifier; // Declared name + } - export interface ExportAssignment extends Declaration, Statement { + export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + + // @kind(SyntaxKind.ExportAssignment) + export interface ExportAssignment extends DeclarationStatement { isExportEquals?: boolean; expression: Expression; } @@ -1153,6 +1373,7 @@ namespace ts { } // represents a top level: { type } expression in a JSDoc comment. + // @kind(SyntaxKind.JSDocTypeExpression) export interface JSDocTypeExpression extends Node { type: JSDocType; } @@ -1161,90 +1382,111 @@ namespace ts { _jsDocTypeBrand: any; } + // @kind(SyntaxKind.JSDocAllType) export interface JSDocAllType extends JSDocType { _JSDocAllTypeBrand: any; } + // @kind(SyntaxKind.JSDocUnknownType) export interface JSDocUnknownType extends JSDocType { _JSDocUnknownTypeBrand: any; } + // @kind(SyntaxKind.JSDocArrayType) export interface JSDocArrayType extends JSDocType { elementType: JSDocType; } + // @kind(SyntaxKind.JSDocUnionType) export interface JSDocUnionType extends JSDocType { types: NodeArray; } + // @kind(SyntaxKind.JSDocTupleType) export interface JSDocTupleType extends JSDocType { types: NodeArray; } + // @kind(SyntaxKind.JSDocNonNullableType) export interface JSDocNonNullableType extends JSDocType { type: JSDocType; } + // @kind(SyntaxKind.JSDocNullableType) export interface JSDocNullableType extends JSDocType { type: JSDocType; } + // @kind(SyntaxKind.JSDocRecordType) export interface JSDocRecordType extends JSDocType, TypeLiteralNode { members: NodeArray; } + // @kind(SyntaxKind.JSDocTypeReference) export interface JSDocTypeReference extends JSDocType { name: EntityName; typeArguments: NodeArray; } + // @kind(SyntaxKind.JSDocOptionalType) export interface JSDocOptionalType extends JSDocType { type: JSDocType; } + // @kind(SyntaxKind.JSDocFunctionType) export interface JSDocFunctionType extends JSDocType, SignatureDeclaration { parameters: NodeArray; type: JSDocType; } + // @kind(SyntaxKind.JSDocVariadicType) export interface JSDocVariadicType extends JSDocType { type: JSDocType; } + // @kind(SyntaxKind.JSDocConstructorType) export interface JSDocConstructorType extends JSDocType { type: JSDocType; } + // @kind(SyntaxKind.JSDocThisType) export interface JSDocThisType extends JSDocType { type: JSDocType; } - export interface JSDocRecordMember extends PropertyDeclaration { + // @kind(SyntaxKind.JSDocRecordMember) + export interface JSDocRecordMember extends PropertySignature { name: Identifier | LiteralExpression; type?: JSDocType; } + // @kind(SyntaxKind.JSDocComment) export interface JSDocComment extends Node { tags: NodeArray; } + // @kind(SyntaxKind.JSDocTag) export interface JSDocTag extends Node { atToken: Node; tagName: Identifier; } + // @kind(SyntaxKind.JSDocTemplateTag) export interface JSDocTemplateTag extends JSDocTag { typeParameters: NodeArray; } + // @kind(SyntaxKind.JSDocReturnTag) export interface JSDocReturnTag extends JSDocTag { typeExpression: JSDocTypeExpression; } + // @kind(SyntaxKind.JSDocTypeTag) export interface JSDocTypeTag extends JSDocTag { typeExpression: JSDocTypeExpression; } + // @kind(SyntaxKind.JSDocParameterTag) export interface JSDocParameterTag extends JSDocTag { preParameterName?: Identifier; typeExpression?: JSDocTypeExpression; @@ -1252,7 +1494,13 @@ namespace ts { isBracketed: boolean; } + export interface AmdDependency { + path: string; + name: string; + } + // Source files are declarations when they are external modules. + // @kind(SyntaxKind.SourceFile) export interface SourceFile extends Declaration { statements: NodeArray; endOfFileToken: Node; @@ -1261,7 +1509,7 @@ namespace ts { /* internal */ path: Path; text: string; - amdDependencies: {path: string; name: string}[]; + amdDependencies: AmdDependency[]; moduleName: string; referencedFiles: FileReference[]; languageVariant: LanguageVariant; @@ -1284,8 +1532,9 @@ namespace ts { // The first node that causes this file to be an external module /* @internal */ externalModuleIndicator: Node; + // The first node that causes this file to be a CommonJS module + /* @internal */ commonJsModuleIndicator: Node; - /* @internal */ isDefaultLib: boolean; /* @internal */ identifiers: Map; /* @internal */ nodeCount: number; /* @internal */ identifierCount: number; @@ -1622,6 +1871,7 @@ namespace ts { getTypeReferenceSerializationKind(typeName: EntityName): TypeReferenceSerializationKind; isOptionalParameter(node: ParameterDeclaration): boolean; isArgumentsLocalBinding(node: Identifier): boolean; + getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): SourceFile; } export const enum SymbolFlags { @@ -1821,6 +2071,7 @@ namespace ts { ContainsAnyFunctionType = 0x00800000, // Type is or contains object literal type ESSymbol = 0x01000000, // Type of symbol primitive introduced in ES6 ThisType = 0x02000000, // This type + ObjectLiteralPatternWithComputedProperties = 0x04000000, // Object literal type implied by binding pattern has computed properties /* @internal */ Intrinsic = Any | String | Number | Boolean | ESSymbol | Void | Undefined | Null, @@ -2110,6 +2361,7 @@ namespace ts { noFallthroughCasesInSwitch?: boolean; forceConsistentCasingInFileNames?: boolean; allowSyntheticDefaultImports?: boolean; + allowJs?: boolean; /* @internal */ stripInternal?: boolean; // Skip checking lib.d.ts to help speed up tests. @@ -2175,17 +2427,17 @@ namespace ts { /* @internal */ export interface CommandLineOptionBase { name: string; - type: string | Map; // "string", "number", "boolean", or an object literal mapping named values to actual values - isFilePath?: boolean; // True if option value is a path or fileName - shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help' - description?: DiagnosticMessage; // The message describing what the command line switch does - paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter + type: "string" | "number" | "boolean" | Map; // a value of a primitive type, or an object literal mapping named values to actual values + isFilePath?: boolean; // True if option value is a path or fileName + shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help' + description?: DiagnosticMessage; // The message describing what the command line switch does + paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter experimental?: boolean; } /* @internal */ export interface CommandLineOptionOfPrimitiveType extends CommandLineOptionBase { - type: string; // "string" | "number" | "boolean" + type: "string" | "number" | "boolean"; } /* @internal */ @@ -2337,7 +2589,7 @@ namespace ts { export interface ModuleResolutionHost { fileExists(fileName: string): boolean; // readFile function is used to read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json' - // to determine location of bundled typings for node module + // to determine location of bundled typings for node module readFile(fileName: string): string; } @@ -2345,7 +2597,7 @@ namespace ts { resolvedFileName: string; /* * Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be proper external module: - * - be a .d.ts file + * - be a .d.ts file * - use top level imports\exports * - don't use tripleslash references */ @@ -2368,11 +2620,11 @@ namespace ts { getNewLine(): string; /* - * CompilerHost must either implement resolveModuleNames (in case if it wants to be completely in charge of - * module name resolution) or provide implementation for methods from ModuleResolutionHost (in this case compiler + * CompilerHost must either implement resolveModuleNames (in case if it wants to be completely in charge of + * module name resolution) or provide implementation for methods from ModuleResolutionHost (in this case compiler * will appply built-in module resolution logic and use members of ModuleResolutionHost to ask host specific questions). - * If resolveModuleNames is implemented then implementation for members from ModuleResolutionHost can be just - * 'throw new Error("NotImplemented")' + * If resolveModuleNames is implemented then implementation for members from ModuleResolutionHost can be just + * 'throw new Error("NotImplemented")' */ resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[]; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 38d4fd9c7da..1884cee1516 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1,4 +1,3 @@ -/// /// /* @internal */ @@ -39,6 +38,8 @@ namespace ts { getCanonicalFileName(fileName: string): string; getNewLine(): string; + isEmitBlocked(emitFileName: string): boolean; + writeFile: WriteFileCallback; } @@ -362,6 +363,10 @@ namespace ts { return file.externalModuleIndicator !== undefined; } + export function isExternalOrCommonJsModule(file: SourceFile): boolean { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; + } + export function isDeclarationFile(file: SourceFile): boolean { return (file.flags & NodeFlags.DeclarationFile) !== 0; } @@ -1056,6 +1061,57 @@ namespace ts { return node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind !== SyntaxKind.ExternalModuleReference; } + export function isSourceFileJavaScript(file: SourceFile): boolean { + return isInJavaScriptFile(file); + } + + export function isInJavaScriptFile(node: Node): boolean { + return node && !!(node.parserContextFlags & ParserContextFlags.JavaScriptFile); + } + + /** + * Returns true if the node is a CallExpression to the identifier 'require' with + * exactly one string literal argument. + * This function does not test if the node is in a JavaScript file or not. + */ + export function isRequireCall(expression: Node): expression is CallExpression { + // of the form 'require("name")' + return expression.kind === SyntaxKind.CallExpression && + (expression).expression.kind === SyntaxKind.Identifier && + ((expression).expression).text === "require" && + (expression).arguments.length === 1 && + (expression).arguments[0].kind === SyntaxKind.StringLiteral; + } + + /** + * Returns true if the node is an assignment to a property on the identifier 'exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + export function isExportsPropertyAssignment(expression: Node): boolean { + // of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === SyntaxKind.BinaryExpression) && + ((expression).operatorToken.kind === SyntaxKind.EqualsToken) && + ((expression).left.kind === SyntaxKind.PropertyAccessExpression) && + (((expression).left).expression.kind === SyntaxKind.Identifier) && + (((((expression).left).expression)).text === "exports"); + } + + /** + * Returns true if the node is an assignment to the property access expression 'module.exports'. + * This function does not test if the node is in a JavaScript file or not. + */ + export function isModuleExportsAssignment(expression: Node): boolean { + // of the form 'module.exports = expr' where 'expr' is arbitrary + return isInJavaScriptFile(expression) && + (expression.kind === SyntaxKind.BinaryExpression) && + ((expression).operatorToken.kind === SyntaxKind.EqualsToken) && + ((expression).left.kind === SyntaxKind.PropertyAccessExpression) && + (((expression).left).expression.kind === SyntaxKind.Identifier) && + (((((expression).left).expression)).text === "module") && + (((expression).left).name.text === "exports"); + } + export function getExternalModuleName(node: Node): Expression { if (node.kind === SyntaxKind.ImportDeclaration) { return (node).moduleSpecifier; @@ -1273,7 +1329,7 @@ namespace ts { } // True if the given identifier, string literal, or number literal is the name of a declaration node - export function isDeclarationName(name: Node): boolean { + export function isDeclarationName(name: Node): name is Identifier | StringLiteral | LiteralExpression { if (name.kind !== SyntaxKind.Identifier && name.kind !== SyntaxKind.StringLiteral && name.kind !== SyntaxKind.NumericLiteral) { return false; } @@ -1435,6 +1491,10 @@ namespace ts { return isFunctionLike(node) && (node.flags & NodeFlags.Async) !== 0 && !isAccessor(node); } + export function isStringOrNumericLiteral(kind: SyntaxKind): boolean { + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral; + } + /** * A declaration has a dynamic name if both of the following are true: * 1. The declaration has a computed property name @@ -1443,9 +1503,13 @@ namespace ts { * Symbol. */ export function hasDynamicName(declaration: Declaration): boolean { - return declaration.name && - declaration.name.kind === SyntaxKind.ComputedPropertyName && - !isWellKnownSymbolSyntactically((declaration.name).expression); + return declaration.name && isDynamicName(declaration.name); + } + + export function isDynamicName(name: DeclarationName): boolean { + return name.kind === SyntaxKind.ComputedPropertyName && + !isStringOrNumericLiteral((name).expression.kind) && + !isWellKnownSymbolSyntactically((name).expression); } /** @@ -1483,7 +1547,7 @@ namespace ts { return node.kind === SyntaxKind.Identifier && (node).text === "Symbol"; } - export function isModifier(token: SyntaxKind): boolean { + export function isModifierKind(token: SyntaxKind): boolean { switch (token) { case SyntaxKind.AbstractKeyword: case SyntaxKind.AsyncKeyword: @@ -1516,20 +1580,60 @@ namespace ts { return isFunctionLike(n) || n.kind === SyntaxKind.ModuleDeclaration || n.kind === SyntaxKind.SourceFile; } - export function cloneEntityName(node: EntityName): EntityName { - if (node.kind === SyntaxKind.Identifier) { - const clone = createSynthesizedNode(SyntaxKind.Identifier); - clone.text = (node).text; - return clone; + /** + * Creates a shallow, memberwise clone of a node. The "kind", "pos", "end", "flags", and "parent" + * properties are excluded by default, and can be provided via the "location", "flags", and + * "parent" parameters. + * @param node The node to clone. + * @param location An optional TextRange to use to supply the new position. + * @param flags The NodeFlags to use for the cloned node. + * @param parent The parent for the new node. + */ + export function cloneNode(node: T, location?: TextRange, flags?: NodeFlags, parent?: Node): T { + // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of + // the original node. We also need to exclude specific properties and only include own- + // properties (to skip members already defined on the shared prototype). + const clone = location !== undefined + ? createNode(node.kind, location.pos, location.end) + : createSynthesizedNode(node.kind); + + for (const key in node) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { + continue; + } + + (clone)[key] = (node)[key]; } - else { - const clone = createSynthesizedNode(SyntaxKind.QualifiedName); - clone.left = cloneEntityName((node).left); - clone.left.parent = clone; - clone.right = cloneEntityName((node).right); - clone.right.parent = clone; - return clone; + + if (flags !== undefined) { + clone.flags = flags; } + + if (parent !== undefined) { + clone.parent = parent; + } + + return clone; + } + + /** + * Creates a deep clone of an EntityName, with new parent pointers. + * @param node The EntityName to clone. + * @param parent The parent for the cloned node. + */ + export function cloneEntityName(node: EntityName, parent?: Node): EntityName { + const clone = cloneNode(node, node, node.flags, parent); + if (isQualifiedName(clone)) { + const { left, right } = clone; + clone.left = cloneEntityName(left, clone); + clone.right = cloneNode(right, right, right.flags, parent); + } + + return clone; + } + + export function isQualifiedName(node: Node): node is QualifiedName { + return node.kind === SyntaxKind.QualifiedName; } export function nodeIsSynthesized(node: Node): boolean { @@ -1660,6 +1764,7 @@ namespace ts { "\u0085": "\\u0085" // nextLine }; + /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) @@ -1800,6 +1905,15 @@ namespace ts { }; } + /** + * Resolves a local path to a path which is absolute to the base of the emit + */ + export function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string { + const dir = host.getCurrentDirectory(); + const relativePath = getRelativePathToDirectoryOrUrl(dir, fileName, dir, f => host.getCanonicalFileName(f), /*isAbsolutePathAnUrl*/ false); + return removeFileExtension(relativePath); + } + export function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string) { const compilerOptions = host.getCompilerOptions(); let emitOutputFilePathWithoutExtension: string; @@ -1813,15 +1927,85 @@ namespace ts { return emitOutputFilePathWithoutExtension + extension; } + export function getEmitScriptTarget(compilerOptions: CompilerOptions) { + return compilerOptions.target || ScriptTarget.ES3; + } + + export function getEmitModuleKind(compilerOptions: CompilerOptions) { + return compilerOptions.module ? + compilerOptions.module : + getEmitScriptTarget(compilerOptions) === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None; + } + + export interface EmitFileNames { + jsFilePath: string; + sourceMapFilePath: string; + declarationFilePath: string; + } + + export function forEachExpectedEmitFile(host: EmitHost, + action: (emitFileNames: EmitFileNames, sourceFiles: SourceFile[], isBundledEmit: boolean) => void, + targetSourceFile?: SourceFile) { + const options = host.getCompilerOptions(); + // Emit on each source file + if (options.outFile || options.out) { + onBundledEmit(host); + } + else { + const sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + for (const sourceFile of sourceFiles) { + if (!isDeclarationFile(sourceFile)) { + onSingleFileEmit(host, sourceFile); + } + } + } + + function onSingleFileEmit(host: EmitHost, sourceFile: SourceFile) { + const jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, + sourceFile.languageVariant === LanguageVariant.JSX && options.jsx === JsxEmit.Preserve ? ".jsx" : ".js"); + const emitFileNames: EmitFileNames = { + jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: !isSourceFileJavaScript(sourceFile) ? getDeclarationEmitFilePath(jsFilePath, options) : undefined + }; + action(emitFileNames, [sourceFile], /*isBundledEmit*/false); + } + + function onBundledEmit(host: EmitHost) { + // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified + const bundledSources = filter(host.getSourceFiles(), + sourceFile => !isDeclarationFile(sourceFile) && // Not a declaration file + (!isExternalModule(sourceFile) || // non module file + (getEmitModuleKind(options) && isExternalModule(sourceFile)))); // module that can emit - note falsy value from getEmitModuleKind means the module kind that shouldn't be emitted + if (bundledSources.length) { + const jsFilePath = options.outFile || options.out; + const emitFileNames: EmitFileNames = { + jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: getDeclarationEmitFilePath(jsFilePath, options) + }; + action(emitFileNames, bundledSources, /*isBundledEmit*/true); + } + } + + function getSourceMapFilePath(jsFilePath: string, options: CompilerOptions) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + + function getDeclarationEmitFilePath(jsFilePath: string, options: CompilerOptions) { + return options.declaration ? removeFileExtension(jsFilePath) + ".d.ts" : undefined; + } + } + export function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string) { let sourceFilePath = getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); return combinePaths(newDirPath, sourceFilePath); } - export function writeFile(host: EmitHost, diagnostics: Diagnostic[], fileName: string, data: string, writeByteOrderMark: boolean) { + export function writeFile(host: EmitHost, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean) { host.writeFile(fileName, data, writeByteOrderMark, hostErrorMessage => { - diagnostics.push(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }); } @@ -1845,18 +2029,6 @@ namespace ts { return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } - export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) { - // 1. in-browser single file compilation scenario - // 2. non .js file - return compilerOptions.isolatedModules || !fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - export function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration) { let firstAccessor: AccessorDeclaration; let secondAccessor: AccessorDeclaration; @@ -2200,12 +2372,8 @@ namespace ts { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined; } - export function isJavaScript(fileName: string) { - return fileExtensionIs(fileName, ".js"); - } - - export function isTsx(fileName: string) { - return fileExtensionIs(fileName, ".tsx"); + export function hasJavaScriptFileExtension(fileName: string) { + return forEach(supportedJavascriptExtensions, extension => fileExtensionIs(fileName, extension)); } /** diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 848f229f109..4f3607cf182 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -40,89 +40,79 @@ class CompilerBaselineRunner extends RunnerBase { this.basePath += "/" + this.testSuiteName; } + private makeUnitName(name: string, root: string) { + return ts.isRootedDiskPath(name) ? name : ts.combinePaths(root, name); + }; + public checkTestCodeOutput(fileName: string) { describe("compiler tests for " + fileName, () => { // Mocha holds onto the closure environment of the describe callback even after the test is done. // Everything declared here should be cleared out in the "after" callback. let justName: string; - let content: string; - let testCaseContent: { settings: Harness.TestCaseParser.CompilerSettings; testUnitData: Harness.TestCaseParser.TestUnitData[]; }; - - let units: Harness.TestCaseParser.TestUnitData[]; - let tcSettings: Harness.TestCaseParser.CompilerSettings; let lastUnit: Harness.TestCaseParser.TestUnitData; - let rootDir: string; + let harnessSettings: Harness.TestCaseParser.CompilerSettings; + let hasNonDtsFiles: boolean; let result: Harness.Compiler.CompilerResult; - let program: ts.Program; let options: ts.CompilerOptions; // equivalent to the files that will be passed on the command line - let toBeCompiled: { unitName: string; content: string }[]; + let toBeCompiled: Harness.Compiler.TestFile[]; // equivalent to other files on the file system not directly passed to the compiler (ie things that are referenced by other files) - let otherFiles: { unitName: string; content: string }[]; - let harnessCompiler: Harness.Compiler.HarnessCompiler; + let otherFiles: Harness.Compiler.TestFile[]; before(() => { justName = fileName.replace(/^.*[\\\/]/, ""); // strips the fileName from the path. - content = Harness.IO.readFile(fileName); - testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName); - units = testCaseContent.testUnitData; - tcSettings = testCaseContent.settings; + const content = Harness.IO.readFile(fileName); + const testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName); + const units = testCaseContent.testUnitData; + harnessSettings = testCaseContent.settings; lastUnit = units[units.length - 1]; - rootDir = lastUnit.originalFilePath.indexOf("conformance") === -1 ? "tests/cases/compiler/" : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf("/")) + "/"; - harnessCompiler = Harness.Compiler.getCompiler(); + hasNonDtsFiles = ts.forEach(units, unit => !ts.fileExtensionIs(unit.name, ".d.ts")); + const rootDir = lastUnit.originalFilePath.indexOf("conformance") === -1 ? "tests/cases/compiler/" : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf("/")) + "/"; // 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 = []; if (/require\(/.test(lastUnit.content) || /reference\spath/.test(lastUnit.content)) { - toBeCompiled.push({ unitName: rootDir + lastUnit.name, content: lastUnit.content }); + toBeCompiled.push({ unitName: this.makeUnitName(lastUnit.name, rootDir), content: lastUnit.content }); units.forEach(unit => { if (unit.name !== lastUnit.name) { - otherFiles.push({ unitName: rootDir + unit.name, content: unit.content }); + otherFiles.push({ unitName: this.makeUnitName(unit.name, rootDir), content: unit.content }); } }); } else { toBeCompiled = units.map(unit => { - return { unitName: rootDir + unit.name, content: unit.content }; + return { unitName: this.makeUnitName(unit.name, rootDir), content: unit.content }; }); } - options = harnessCompiler.compileFiles(toBeCompiled, otherFiles, function (compileResult, _program) { - result = compileResult; - // The program will be used by typeWriter - program = _program; - }, function (settings) { - harnessCompiler.setCompilerSettings(tcSettings); - }); + const output = Harness.Compiler.compileFiles( + toBeCompiled, otherFiles, harnessSettings, /* options */ undefined, /* currentDirectory */ undefined); + + options = output.options; + result = output.result; }); after(() => { // Mocha holds onto the closure environment of the describe callback even after the test is done. // Therefore we have to clean out large objects after the test is done. justName = undefined; - content = undefined; - testCaseContent = undefined; - units = undefined; - tcSettings = undefined; lastUnit = undefined; - rootDir = undefined; + hasNonDtsFiles = undefined; result = undefined; - program = undefined; options = undefined; toBeCompiled = undefined; otherFiles = undefined; - harnessCompiler = undefined; }); function getByteOrderMarkText(file: Harness.Compiler.GeneratedFile): string { return file.writeByteOrderMark ? "\u00EF\u00BB\u00BF" : ""; } - function getErrorBaseline(toBeCompiled: { unitName: string; content: string }[], otherFiles: { unitName: string; content: string }[], result: Harness.Compiler.CompilerResult) { + function getErrorBaseline(toBeCompiled: Harness.Compiler.TestFile[], otherFiles: Harness.Compiler.TestFile[], result: Harness.Compiler.CompilerResult) { return Harness.Compiler.getErrorBaseline(toBeCompiled.concat(otherFiles), result.errors); } @@ -151,7 +141,7 @@ class CompilerBaselineRunner extends RunnerBase { }); it("Correct JS output for " + fileName, () => { - if (!ts.fileExtensionIs(lastUnit.name, ".d.ts") && this.emit) { + if (hasNonDtsFiles && 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."); } @@ -184,9 +174,9 @@ class CompilerBaselineRunner extends RunnerBase { } } - const declFileCompilationResult = harnessCompiler.compileDeclarationFiles(toBeCompiled, otherFiles, result, function (settings) { - harnessCompiler.setCompilerSettings(tcSettings); - }, options); + const declFileCompilationResult = + Harness.Compiler.compileDeclarationFiles( + toBeCompiled, otherFiles, result, harnessSettings, options, /*currentDirectory*/ undefined); if (declFileCompilationResult && declFileCompilationResult.declResult.errors.length) { jsCode += "\r\n\r\n//// [DtsFileErrors]\r\n"; @@ -257,10 +247,11 @@ class CompilerBaselineRunner extends RunnerBase { // These types are equivalent, but depend on what order the compiler observed // certain parts of the program. + const program = result.program; const allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName)); - const fullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ true); - const pullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ false); + const fullWalker = new TypeWriterWalker(program, /*fullTypeCheck*/ true); + const pullWalker = new TypeWriterWalker(program, /*fullTypeCheck*/ false); const fullResults: ts.Map = {}; const pullResults: ts.Map = {}; @@ -274,14 +265,14 @@ class CompilerBaselineRunner extends RunnerBase { // The second gives symbols for all identifiers. let e1: Error, e2: Error; try { - checkBaseLines(/*isSymbolBaseLine:*/ false); + checkBaseLines(/*isSymbolBaseLine*/ false); } catch (e) { e1 = e; } try { - checkBaseLines(/*isSymbolBaseLine:*/ true); + checkBaseLines(/*isSymbolBaseLine*/ true); } catch (e) { e2 = e; @@ -367,7 +358,6 @@ class CompilerBaselineRunner extends RunnerBase { public initializeTests() { describe(this.testSuiteName + " tests", () => { describe("Setup compiler for compiler baselines", () => { - const harnessCompiler = Harness.Compiler.getCompiler(); this.parseOptions(); }); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index bf8b9493829..9d729345781 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -48,12 +48,6 @@ namespace FourSlash { ranges: Range[]; } - export interface TestXmlData { - invalidReason: string; - originalName: string; - actions: string[]; - } - interface MemberListData { result: { maybeInaccurate: boolean; @@ -84,14 +78,14 @@ namespace FourSlash { marker?: Marker; } - interface ILocationInformation { + interface LocationInformation { position: number; sourcePosition: number; sourceLine: number; sourceColumn: number; } - interface IRangeLocationInformation extends ILocationInformation { + interface RangeLocationInformation extends LocationInformation { marker?: Marker; } @@ -134,11 +128,6 @@ namespace FourSlash { return settings; } - export let currentTestState: TestState = null; - function assertionMessage(msg: string) { - return "\nMarker: " + currentTestState.lastKnownMarker + "\nChecking: " + msg + "\n\n"; - } - export class TestCancellationToken implements ts.HostCancellationToken { // 0 - cancelled // >0 - not cancelled @@ -216,17 +205,26 @@ namespace FourSlash { public formatCodeOptions: ts.FormatCodeOptions; - private scenarioActions: string[] = []; - private taoInvalidReason: string = null; - private inputFiles: ts.Map = {}; // Map between inputFile's fileName and its content for easily looking up when resolving references // Add input file which has matched file name with the given reference-file path. // This is necessary when resolveReference flag is specified - private addMatchedInputFile(referenceFilePath: string) { - const inputFile = this.inputFiles[referenceFilePath]; - if (inputFile && !Harness.isLibraryFile(referenceFilePath)) { - this.languageServiceAdapterHost.addScript(referenceFilePath, inputFile); + private addMatchedInputFile(referenceFilePath: string, extensions: string[]) { + const inputFiles = this.inputFiles; + const languageServiceAdapterHost = this.languageServiceAdapterHost; + if (!extensions) { + tryAdd(referenceFilePath); + } + else { + tryAdd(referenceFilePath) || ts.forEach(extensions, ext => tryAdd(referenceFilePath + ext)); + } + + function tryAdd(path: string) { + const inputFile = inputFiles[path]; + if (inputFile && !Harness.isLibraryFile(path)) { + languageServiceAdapterHost.addScript(path, inputFile); + return true; + } } } @@ -280,15 +278,15 @@ namespace FourSlash { ts.forEach(referencedFiles, referenceFile => { // Fourslash insert tests/cases/fourslash into inputFile.unitName so we will properly append the same base directory to refFile path const referenceFilePath = this.basePath + "/" + referenceFile.fileName; - this.addMatchedInputFile(referenceFilePath); + this.addMatchedInputFile(referenceFilePath, /* extensions */ undefined); }); // Add import files into language-service host ts.forEach(importedFiles, importedFile => { // Fourslash insert tests/cases/fourslash into inputFile.unitName and import statement doesn't require ".ts" // so convert them before making appropriate comparison - const importedFilePath = this.basePath + "/" + importedFile.fileName + ".ts"; - this.addMatchedInputFile(importedFilePath); + const importedFilePath = this.basePath + "/" + importedFile.fileName; + this.addMatchedInputFile(importedFilePath, ts.getSupportedExtensions(compilationOptions)); }); // Check if no-default-lib flag is false and if so add default library @@ -326,7 +324,6 @@ namespace FourSlash { this.testData.files.forEach(file => { const fileName = file.fileName.replace(Harness.IO.directoryName(file.fileName), "").substr(1); const fileNameWithoutExtension = fileName.substr(0, fileName.lastIndexOf(".")); - this.scenarioActions.push(""); }); // Open the first file by default @@ -355,35 +352,22 @@ namespace FourSlash { public goToPosition(pos: number) { this.currentCaretPosition = pos; - - const lineStarts = ts.computeLineStarts(this.getFileContent(this.activeFile.fileName)); - const lineCharPos = ts.computeLineAndCharacterOfPosition(lineStarts, pos); - this.scenarioActions.push(``); } public moveCaretRight(count = 1) { this.currentCaretPosition += count; this.currentCaretPosition = Math.min(this.currentCaretPosition, this.getFileContent(this.activeFile.fileName).length); - 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) { + public openFile(index: number, content?: string): void; + public openFile(name: string, content?: string): void; + public openFile(indexOrName: any, content?: string) { const fileToOpen: FourSlashFile = this.findFile(indexOrName); fileToOpen.fileName = ts.normalizeSlashes(fileToOpen.fileName); this.activeFile = fileToOpen; - const fileName = fileToOpen.fileName.replace(Harness.IO.directoryName(fileToOpen.fileName), "").substr(1); - this.scenarioActions.push(``); - // Let the host know that this file is now open - this.languageServiceAdapterHost.openFile(fileToOpen.fileName); + this.languageServiceAdapterHost.openFile(fileToOpen.fileName, content); } public verifyErrorExistsBetweenMarkers(startMarkerName: string, endMarkerName: string, negative: boolean) { @@ -395,8 +379,6 @@ namespace FourSlash { const exists = this.anyErrorInRange(predicate, startMarker, endMarker); - this.taoInvalidReason = "verifyErrorExistsBetweenMarkers NYI"; - if (exists !== negative) { this.printErrorLog(negative, this.getAllDiagnostics()); throw new Error("Failure between markers: " + startMarkerName + ", " + endMarkerName); @@ -409,7 +391,11 @@ namespace FourSlash { } private messageAtLastKnownMarker(message: string) { - return "Marker: " + currentTestState.lastKnownMarker + "\n" + message; + return "Marker: " + this.lastKnownMarker + "\n" + message; + } + + private assertionMessageAtLastKnownMarker(msg: string) { + return "\nMarker: " + this.lastKnownMarker + "\nChecking: " + msg + "\n\n"; } private getDiagnostics(fileName: string): ts.Diagnostic[] { @@ -449,8 +435,6 @@ namespace FourSlash { }; } - this.taoInvalidReason = "verifyErrorExistsAfterMarker NYI"; - const exists = this.anyErrorInRange(predicate, marker); const diagnostics = this.getAllDiagnostics(); @@ -499,10 +483,8 @@ namespace FourSlash { const errors = this.getDiagnostics(this.activeFile.fileName); const actual = errors.length; - this.scenarioActions.push(``); - if (actual !== expected) { - this.printErrorLog(false, errors); + this.printErrorLog(/*expectErrors*/ false, errors); const errorMsg = "Actual number of errors (" + actual + ") does not match expected number (" + expected + ")"; Harness.IO.log(errorMsg); this.raiseError(errorMsg); @@ -515,8 +497,6 @@ namespace FourSlash { throw new Error("Expected exactly one output from emit of " + this.activeFile.fileName); } - this.taoInvalidReason = "verifyEval impossible"; - const evaluation = new Function(`${emit.outputFiles[0].text};\r\nreturn (${expr});`)(); if (evaluation !== value) { this.raiseError(`Expected evaluation of expression "${expr}" to equal "${value}", but got "${evaluation}"`); @@ -528,21 +508,22 @@ namespace FourSlash { if (emit.outputFiles.length !== 1) { throw new Error("Expected exactly one output from emit of " + this.activeFile.fileName); } - this.taoInvalidReason = "verifyGetEmitOutputForCurrentFile impossible"; const actual = emit.outputFiles[0].text; if (actual !== expected) { this.raiseError(`Expected emit output to be "${expected}", but got "${actual}"`); } } - public verifyMemberListContains(symbol: string, text?: string, documentation?: string, kind?: string) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); - - if (text || documentation || kind) { - this.taoInvalidReason = "verifyMemberListContains only supports the \"symbol\" parameter"; + public verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void { + const emit = this.languageService.getEmitOutput(this.activeFile.fileName); + assert.equal(emit.outputFiles.length, expected.length, "Number of emit output files"); + for (let i = 0; i < emit.outputFiles.length; i++) { + assert.equal(emit.outputFiles[i].name, expected[i].name, "FileName"); + assert.equal(emit.outputFiles[i].text, expected[i].text, "Content"); } + } + public verifyMemberListContains(symbol: string, text?: string, documentation?: string, kind?: string) { const members = this.getMemberListAtCaret(); if (members) { this.assertItemInCompletionList(members.entries, symbol, text, documentation, kind); @@ -553,18 +534,9 @@ namespace FourSlash { } 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(``); + if (expectedCount === 0 && negative) { + this.verifyMemberListIsEmpty(/*negative*/ false); + return; } const members = this.getMemberListAtCaret(); @@ -582,9 +554,6 @@ namespace FourSlash { } public verifyMemberListDoesNotContain(symbol: string) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); - const members = this.getMemberListAtCaret(); if (members && members.entries.filter(e => e.name === symbol).length !== 0) { this.raiseError(`Member list did contain ${symbol}`); @@ -592,8 +561,6 @@ namespace FourSlash { } public verifyCompletionListItemsCountIsGreaterThan(count: number, negative: boolean) { - this.taoInvalidReason = "verifyCompletionListItemsCountIsGreaterThan NYI"; - const completions = this.getCompletionListAtCaret(); const itemsCount = completions.entries.length; @@ -610,13 +577,6 @@ namespace FourSlash { } public verifyMemberListIsEmpty(negative: boolean) { - if (negative) { - this.scenarioActions.push(""); - } - else { - this.scenarioActions.push(""); - } - const members = this.getMemberListAtCaret(); if ((!members || members.entries.length === 0) && negative) { this.raiseError("Member list is empty at Caret"); @@ -635,8 +595,6 @@ namespace FourSlash { } public verifyCompletionListIsEmpty(negative: boolean) { - this.scenarioActions.push(""); - const completions = this.getCompletionListAtCaret(); if ((!completions || completions.entries.length === 0) && negative) { this.raiseError("Completion list is empty at caret at position " + this.activeFile.fileName + " " + this.currentCaretPosition); @@ -704,8 +662,6 @@ namespace FourSlash { // and keep it in the list of filtered entry. return true; } - this.scenarioActions.push(""); - this.scenarioActions.push(``); const completions = this.getCompletionListAtCaret(); if (completions) { @@ -733,24 +689,20 @@ namespace FourSlash { } public verifyCompletionEntryDetails(entryName: string, expectedText: string, expectedDocumentation?: string, kind?: string) { - this.taoInvalidReason = "verifyCompletionEntryDetails NYI"; - const details = this.getCompletionEntryDetails(entryName); - assert.equal(ts.displayPartsToString(details.displayParts), expectedText, assertionMessage("completion entry details text")); + assert.equal(ts.displayPartsToString(details.displayParts), expectedText, this.assertionMessageAtLastKnownMarker("completion entry details text")); if (expectedDocumentation !== undefined) { - assert.equal(ts.displayPartsToString(details.documentation), expectedDocumentation, assertionMessage("completion entry documentation")); + assert.equal(ts.displayPartsToString(details.documentation), expectedDocumentation, this.assertionMessageAtLastKnownMarker("completion entry documentation")); } if (kind !== undefined) { - assert.equal(details.kind, kind, assertionMessage("completion entry kind")); + assert.equal(details.kind, kind, this.assertionMessageAtLastKnownMarker("completion entry kind")); } } public verifyReferencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) { - this.taoInvalidReason = "verifyReferencesAtPositionListContains NYI"; - const references = this.getReferencesAtCaret(); if (!references || references.length === 0) { @@ -772,8 +724,6 @@ namespace FourSlash { } public verifyReferencesCountIs(count: number, localFilesOnly = true) { - this.taoInvalidReason = "verifyReferences NYI"; - const references = this.getReferencesAtCaret(); let referencesCount = 0; @@ -833,13 +783,6 @@ namespace FourSlash { } public verifyQuickInfoString(negative: boolean, expectedText?: string, expectedDocumentation?: string) { - [expectedText, expectedDocumentation].forEach(str => { - if (str) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); - } - }); - const actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); const actualQuickInfoText = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.displayParts) : ""; const actualQuickInfoDocumentation = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.documentation) : ""; @@ -859,7 +802,7 @@ namespace FourSlash { } // TODO: should be '==='? if (expectedDocumentation != undefined) { - assert.equal(actualQuickInfoDocumentation, expectedDocumentation, assertionMessage("quick info doc")); + assert.equal(actualQuickInfoDocumentation, expectedDocumentation, this.assertionMessageAtLastKnownMarker("quick info doc")); } } } @@ -867,8 +810,6 @@ namespace FourSlash { public verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { start: number; length: number; }, displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[]) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); function getDisplayPartsJson(displayParts: ts.SymbolDisplayPart[]) { let result = ""; @@ -935,8 +876,6 @@ namespace FourSlash { } public verifyQuickInfoExists(negative: boolean) { - this.taoInvalidReason = "verifyQuickInfoExists NYI"; - const actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); if (negative) { if (actualQuickInfo) { @@ -951,8 +890,6 @@ namespace FourSlash { } public verifyCurrentSignatureHelpIs(expected: string) { - this.taoInvalidReason = "verifyCurrentSignatureHelpIs NYI"; - const help = this.getActiveSignatureHelpItem(); assert.equal( ts.displayPartsToString(help.prefixDisplayParts) + @@ -961,75 +898,51 @@ namespace FourSlash { } public verifyCurrentParameterIsletiable(isVariable: boolean) { - this.taoInvalidReason = "verifyCurrentParameterIsletiable NYI"; - const signature = this.getActiveSignatureHelpItem(); assert.isNotNull(signature); assert.equal(isVariable, signature.isVariadic); } public verifyCurrentParameterHelpName(name: string) { - this.taoInvalidReason = "verifyCurrentParameterHelpName NYI"; - const activeParameter = this.getActiveParameter(); const activeParameterName = activeParameter.name; assert.equal(activeParameterName, name); } public verifyCurrentParameterSpanIs(parameter: string) { - this.taoInvalidReason = "verifyCurrentParameterSpanIs NYI"; - const activeSignature = this.getActiveSignatureHelpItem(); const activeParameter = this.getActiveParameter(); assert.equal(ts.displayPartsToString(activeParameter.displayParts), parameter); } public verifyCurrentParameterHelpDocComment(docComment: string) { - this.taoInvalidReason = "verifyCurrentParameterHelpDocComment NYI"; - const activeParameter = this.getActiveParameter(); const activeParameterDocComment = activeParameter.documentation; - assert.equal(ts.displayPartsToString(activeParameterDocComment), docComment, assertionMessage("current parameter Help DocComment")); + assert.equal(ts.displayPartsToString(activeParameterDocComment), docComment, this.assertionMessageAtLastKnownMarker("current parameter Help DocComment")); } public verifyCurrentSignatureHelpParameterCount(expectedCount: number) { - this.taoInvalidReason = "verifyCurrentSignatureHelpParameterCount NYI"; - assert.equal(this.getActiveSignatureHelpItem().parameters.length, expectedCount); } - public verifyCurrentSignatureHelpTypeParameterCount(expectedCount: number) { - this.taoInvalidReason = "verifyCurrentSignatureHelpTypeParameterCount NYI"; - - // assert.equal(this.getActiveSignatureHelpItem().typeParameters.length, expectedCount); - } - public verifyCurrentSignatureHelpDocComment(docComment: string) { - this.taoInvalidReason = "verifyCurrentSignatureHelpDocComment NYI"; - const actualDocComment = this.getActiveSignatureHelpItem().documentation; - assert.equal(ts.displayPartsToString(actualDocComment), docComment, assertionMessage("current signature help doc comment")); + assert.equal(ts.displayPartsToString(actualDocComment), docComment, this.assertionMessageAtLastKnownMarker("current signature help doc comment")); } public verifySignatureHelpCount(expected: number) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); - const help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); const actual = help && help.items ? help.items.length : 0; assert.equal(actual, expected); } public verifySignatureHelpArgumentCount(expected: number) { - this.taoInvalidReason = "verifySignatureHelpArgumentCount NYI"; const signatureHelpItems = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); const actual = signatureHelpItems.argumentCount; assert.equal(actual, expected); } public verifySignatureHelpPresent(shouldBePresent = true) { - this.taoInvalidReason = "verifySignatureHelpPresent NYI"; - const actual = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); if (shouldBePresent) { if (!actual) { @@ -1172,13 +1085,10 @@ namespace FourSlash { } public getBreakpointStatementLocation(pos: number) { - this.taoInvalidReason = "getBreakpointStatementLocation NYI"; return this.languageService.getBreakpointStatementAtPosition(this.activeFile.fileName, pos); } public baselineCurrentFileBreakpointLocations() { - this.taoInvalidReason = "baselineCurrentFileBreakpointLocations impossible"; - Harness.Baseline.runBaseline( "Breakpoint Locations for " + this.activeFile.fileName, this.testData.globalOptions[metadataOptionNames.baselineFile], @@ -1189,7 +1099,6 @@ namespace FourSlash { } public baselineGetEmitOutput() { - this.taoInvalidReason = "baselineGetEmitOutput impossible"; // Find file to be emitted const emitFiles: FourSlashFile[] = []; // List of FourSlashFile that has emitThisFile flag on @@ -1315,8 +1224,6 @@ namespace FourSlash { } public deleteChar(count = 1) { - this.scenarioActions.push(``); - let offset = this.currentCaretPosition; const ch = ""; @@ -1328,14 +1235,14 @@ namespace FourSlash { this.updateMarkersForEdit(this.activeFile.fileName, offset, offset + 1, ch); if (i % checkCadence === 0) { - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } // Handle post-keystroke formatting if (this.enableFormatting) { const edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); if (edits.length) { - offset += this.applyEdits(this.activeFile.fileName, edits, true); + offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); // this.checkPostEditInletiants(); } } @@ -1345,20 +1252,16 @@ namespace FourSlash { this.currentCaretPosition = offset; this.fixCaretPosition(); - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } public replace(start: number, length: number, text: string) { - this.taoInvalidReason = "replace NYI"; - this.languageServiceAdapterHost.editScript(this.activeFile.fileName, start, start + length, text); this.updateMarkersForEdit(this.activeFile.fileName, start, start + length, text); - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } public deleteCharBehindMarker(count = 1) { - this.scenarioActions.push(``); - let offset = this.currentCaretPosition; const ch = ""; const checkCadence = (count >> 2) + 1; @@ -1370,14 +1273,14 @@ namespace FourSlash { this.updateMarkersForEdit(this.activeFile.fileName, offset, offset + 1, ch); if (i % checkCadence === 0) { - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } // Handle post-keystroke formatting if (this.enableFormatting) { const edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); if (edits.length) { - offset += this.applyEdits(this.activeFile.fileName, edits, true); + offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); } } } @@ -1386,18 +1289,11 @@ namespace FourSlash { this.currentCaretPosition = offset; this.fixCaretPosition(); - this.checkPostEditInletiants(); + 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(``); - } - return this.typeHighFidelity(text); } @@ -1428,7 +1324,7 @@ namespace FourSlash { } if (i % checkCadence === 0) { - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); // this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); // this.languageService.getSemanticDiagnostics(this.activeFile.fileName); } @@ -1437,7 +1333,7 @@ namespace FourSlash { if (this.enableFormatting) { const edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); if (edits.length) { - offset += this.applyEdits(this.activeFile.fileName, edits, true); + offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); // this.checkPostEditInletiants(); } } @@ -1447,26 +1343,24 @@ namespace FourSlash { this.currentCaretPosition = offset; this.fixCaretPosition(); - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } // Enters text as if the user had pasted it public paste(text: string) { - this.scenarioActions.push(``); - const start = this.currentCaretPosition; let offset = this.currentCaretPosition; this.languageServiceAdapterHost.editScript(this.activeFile.fileName, offset, offset, text); this.updateMarkersForEdit(this.activeFile.fileName, offset, offset, text); - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); offset += text.length; // Handle formatting if (this.enableFormatting) { const edits = this.languageService.getFormattingEditsForRange(this.activeFile.fileName, start, offset, this.formatCodeOptions); if (edits.length) { - offset += this.applyEdits(this.activeFile.fileName, edits, true); - this.checkPostEditInletiants(); + offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); + this.checkPostEditInvariants(); } } @@ -1474,10 +1368,10 @@ namespace FourSlash { this.currentCaretPosition = offset; this.fixCaretPosition(); - this.checkPostEditInletiants(); + this.checkPostEditInvariants(); } - private checkPostEditInletiants() { + private checkPostEditInvariants() { if (this.testType !== FourSlashTestType.Native) { // getSourcefile() results can not be serialized. Only perform these verifications // if running against a native LS object. @@ -1548,18 +1442,14 @@ namespace FourSlash { } public formatDocument() { - this.scenarioActions.push(""); - const edits = this.languageService.getFormattingEditsForDocument(this.activeFile.fileName, this.formatCodeOptions); - this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, true); + this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); this.fixCaretPosition(); } public formatSelection(start: number, end: number) { - this.taoInvalidReason = "formatSelection NYI"; - const edits = this.languageService.getFormattingEditsForRange(this.activeFile.fileName, start, end, this.formatCodeOptions); - this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, true); + this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true); this.fixCaretPosition(); } @@ -1591,13 +1481,6 @@ namespace FourSlash { } public goToDefinition(definitionIndex: number) { - if (definitionIndex === 0) { - this.scenarioActions.push(""); - } - else { - this.taoInvalidReason = "GoToDefinition not supported for non-zero definition indices"; - } - const definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); if (!definitions || !definitions.length) { this.raiseError("goToDefinition failed - expected to at least one definition location but got 0"); @@ -1613,13 +1496,6 @@ namespace FourSlash { } public goToTypeDefinition(definitionIndex: number) { - if (definitionIndex === 0) { - this.scenarioActions.push(""); - } - else { - this.taoInvalidReason = "GoToTypeDefinition not supported for non-zero definition indices"; - } - const definitions = this.languageService.getTypeDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); if (!definitions || !definitions.length) { this.raiseError("goToTypeDefinition failed - expected to at least one definition location but got 0"); @@ -1635,8 +1511,6 @@ namespace FourSlash { } public verifyDefinitionLocationExists(negative: boolean) { - this.taoInvalidReason = "verifyDefinitionLocationExists NYI"; - const definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); const foundDefinitions = definitions && definitions.length; @@ -1668,8 +1542,6 @@ namespace FourSlash { } public verifyDefinitionsName(negative: boolean, expectedName: string, expectedContainerName: string) { - this.taoInvalidReason = "verifyDefinititionsInfo NYI"; - const definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); const actualDefinitionName = definitions && definitions.length ? definitions[0].name : ""; const actualDefinitionContainerName = definitions && definitions.length ? definitions[0].containerName : ""; @@ -1694,8 +1566,6 @@ namespace FourSlash { } public verifyCaretAtMarker(markerName = "") { - this.taoInvalidReason = "verifyCaretAtMarker NYI"; - const 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}"`); @@ -1714,8 +1584,6 @@ namespace FourSlash { } public verifyIndentationAtCurrentPosition(numberOfSpaces: number, indentStyle: ts.IndentStyle = ts.IndentStyle.Smart) { - this.taoInvalidReason = "verifyIndentationAtCurrentPosition NYI"; - const actual = this.getIndentation(this.activeFile.fileName, this.currentCaretPosition, indentStyle); const lineCol = this.getLineColStringAtPosition(this.currentCaretPosition); if (actual !== numberOfSpaces) { @@ -1724,8 +1592,6 @@ namespace FourSlash { } public verifyIndentationAtPosition(fileName: string, position: number, numberOfSpaces: number, indentStyle: ts.IndentStyle = ts.IndentStyle.Smart) { - this.taoInvalidReason = "verifyIndentationAtPosition NYI"; - const actual = this.getIndentation(fileName, position, indentStyle); const lineCol = this.getLineColStringAtPosition(position); if (actual !== numberOfSpaces) { @@ -1734,8 +1600,6 @@ namespace FourSlash { } public verifyCurrentLineContent(text: string) { - this.taoInvalidReason = "verifyCurrentLineContent NYI"; - const actual = this.getCurrentLineContent(); if (actual !== text) { throw new Error("verifyCurrentLineContent\n" + @@ -1745,8 +1609,6 @@ namespace FourSlash { } public verifyCurrentFileContent(text: string) { - this.taoInvalidReason = "verifyCurrentFileContent NYI"; - const actual = this.getFileContent(this.activeFile.fileName); const replaceNewlines = (str: string) => str.replace(/\r\n/g, "\n"); if (replaceNewlines(actual) !== replaceNewlines(text)) { @@ -1757,8 +1619,6 @@ namespace FourSlash { } public verifyTextAtCaretIs(text: string) { - this.taoInvalidReason = "verifyCurrentFileContent NYI"; - const actual = this.getFileContent(this.activeFile.fileName).substring(this.currentCaretPosition, this.currentCaretPosition + text.length); if (actual !== text) { throw new Error("verifyTextAtCaretIs\n" + @@ -1768,8 +1628,6 @@ namespace FourSlash { } public verifyCurrentNameOrDottedNameSpanText(text: string) { - this.taoInvalidReason = "verifyCurrentNameOrDottedNameSpanText NYI"; - const span = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, this.currentCaretPosition, this.currentCaretPosition); if (!span) { this.raiseError("verifyCurrentNameOrDottedNameSpanText\n" + @@ -1786,13 +1644,10 @@ namespace FourSlash { } private getNameOrDottedNameSpan(pos: number) { - this.taoInvalidReason = "getNameOrDottedNameSpan NYI"; return this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, pos, pos); } public baselineCurrentFileNameOrDottedNameSpans() { - this.taoInvalidReason = "baselineCurrentFileNameOrDottedNameSpans impossible"; - Harness.Baseline.runBaseline( "Name OrDottedNameSpans for " + this.activeFile.fileName, this.testData.globalOptions[metadataOptionNames.baselineFile], @@ -1886,8 +1741,6 @@ namespace FourSlash { } public verifyOutliningSpans(spans: TextSpan[]) { - this.taoInvalidReason = "verifyOutliningSpans NYI"; - const actual = this.languageService.getOutliningSpans(this.activeFile.fileName); if (actual.length !== spans.length) { @@ -1956,8 +1809,6 @@ namespace FourSlash { } public verifyMatchingBracePosition(bracePosition: number, expectedMatchPosition: number) { - this.taoInvalidReason = "verifyMatchingBracePosition NYI"; - const actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); if (actual.length !== 2) { @@ -1981,8 +1832,6 @@ namespace FourSlash { } public verifyNoMatchingBracePosition(bracePosition: number) { - this.taoInvalidReason = "verifyNoMatchingBracePosition NYI"; - const actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); if (actual.length !== 0) { @@ -1995,8 +1844,6 @@ namespace FourSlash { Report an error if expected value and actual value do not match. */ public verifyNavigationItemsCount(expected: number, searchValue: string, matchKind?: string) { - this.taoInvalidReason = "verifyNavigationItemsCount NYI"; - const items = this.languageService.getNavigateToItems(searchValue); let actual = 0; let item: ts.NavigateToItem = null; @@ -2025,8 +1872,6 @@ namespace FourSlash { matchKind: string, fileName?: string, parentName?: string) { - this.taoInvalidReason = "verifyNavigationItemsListContains NYI"; - const items = this.languageService.getNavigateToItems(searchValue); if (!items || items.length === 0) { @@ -2051,8 +1896,6 @@ namespace FourSlash { } public verifyGetScriptLexicalStructureListCount(expected: number) { - this.taoInvalidReason = "verifyNavigationItemsListContains impossible"; - const items = this.languageService.getNavigationBarItems(this.activeFile.fileName); const actual = this.getNavigationBarItemsCount(items); @@ -2074,8 +1917,6 @@ namespace FourSlash { } public verifyGetScriptLexicalStructureListContains(name: string, kind: string) { - this.taoInvalidReason = "verifyGetScriptLexicalStructureListContains impossible"; - const items = this.languageService.getNavigationBarItems(this.activeFile.fileName); if (!items || items.length === 0) { @@ -2136,8 +1977,6 @@ namespace FourSlash { } public verifyOccurrencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) { - this.taoInvalidReason = "verifyOccurrencesAtPositionListContains NYI"; - const occurrences = this.getOccurrencesAtCurrentPosition(); if (!occurrences || occurrences.length === 0) { @@ -2158,8 +1997,6 @@ namespace FourSlash { } public verifyOccurrencesAtPositionListCount(expectedCount: number) { - this.taoInvalidReason = "verifyOccurrencesAtPositionListCount NYI"; - const occurrences = this.getOccurrencesAtCurrentPosition(); const actualCount = occurrences ? occurrences.length : 0; if (expectedCount !== actualCount) { @@ -2173,8 +2010,6 @@ namespace FourSlash { } public verifyDocumentHighlightsAtPositionListContains(fileName: string, start: number, end: number, fileNamesToSearch: string[], kind?: string) { - this.taoInvalidReason = "verifyDocumentHighlightsAtPositionListContains NYI"; - const documentHighlights = this.getDocumentHighlightsAtCurrentPosition(fileNamesToSearch); if (!documentHighlights || documentHighlights.length === 0) { @@ -2201,8 +2036,6 @@ namespace FourSlash { } public verifyDocumentHighlightsAtPositionListCount(expectedCount: number, fileNamesToSearch: string[]) { - this.taoInvalidReason = "verifyDocumentHighlightsAtPositionListCount NYI"; - const documentHighlights = this.getDocumentHighlightsAtCurrentPosition(fileNamesToSearch); const actualCount = documentHighlights ? documentHighlights.reduce((currentCount, { highlightSpans }) => currentCount + highlightSpans.length, 0) @@ -2243,13 +2076,6 @@ namespace FourSlash { } private assertItemInCompletionList(items: ts.CompletionEntry[], name: string, text?: string, documentation?: string, kind?: string) { - this.scenarioActions.push(""); - this.scenarioActions.push(``); - - if (text || documentation || kind) { - this.taoInvalidReason = "assertItemInCompletionList only supports the \"name\" parameter"; - } - for (let i = 0; i < items.length; i++) { const item = items[i]; if (item.name === name) { @@ -2257,15 +2083,15 @@ namespace FourSlash { const details = this.getCompletionEntryDetails(item.name); if (documentation !== undefined) { - assert.equal(ts.displayPartsToString(details.documentation), documentation, assertionMessage("completion item documentation")); + assert.equal(ts.displayPartsToString(details.documentation), documentation, this.assertionMessageAtLastKnownMarker("completion item documentation for " + name)); } if (text !== undefined) { - assert.equal(ts.displayPartsToString(details.displayParts), text, assertionMessage("completion item detail text")); + assert.equal(ts.displayPartsToString(details.displayParts), text, this.assertionMessageAtLastKnownMarker("completion item detail text for " + name)); } } if (kind !== undefined) { - assert.equal(item.kind, kind, assertionMessage("completion item kind")); + assert.equal(item.kind, kind, this.assertionMessageAtLastKnownMarker("completion item kind for " + name)); } return; @@ -2340,14 +2166,6 @@ namespace FourSlash { 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: "" - }; - } - public setCancelled(numberOfCalls: number): void { this.cancellationToken.setCancelled(numberOfCalls); } @@ -2360,43 +2178,33 @@ namespace FourSlash { // TOOD: should these just use the Harness's stdout/stderr? const fsOutput = new Harness.Compiler.WriterAggregator(); const fsErrors = new Harness.Compiler.WriterAggregator(); - export let xmlData: TestXmlData[] = []; export function runFourSlashTest(basePath: string, testType: FourSlashTestType, fileName: string) { const content = Harness.IO.readFile(fileName); - const xml = runFourSlashTestContent(basePath, testType, content, fileName); - xmlData.push(xml); + runFourSlashTestContent(basePath, testType, content, fileName); } - // We don't want to recompile 'fourslash.ts' for every test, so - // here we cache the JS output and reuse it for every test. - let fourslashJsOutput: string; - { - const host = Harness.Compiler.createCompilerHost([{ unitName: Harness.Compiler.fourslashFileName, content: undefined }], - (fn, contents) => fourslashJsOutput = contents, - ts.ScriptTarget.Latest, - Harness.IO.useCaseSensitiveFileNames()); - - const program = ts.createProgram([Harness.Compiler.fourslashFileName], { noResolve: true, target: ts.ScriptTarget.ES3 }, host); - - program.emit(host.getSourceFile(Harness.Compiler.fourslashFileName, ts.ScriptTarget.ES3)); - } - - - export function runFourSlashTestContent(basePath: string, testType: FourSlashTestType, content: string, fileName: string): TestXmlData { + export function runFourSlashTestContent(basePath: string, testType: FourSlashTestType, content: string, fileName: string): void { // Parse out the files and their metadata const testData = parseTestData(basePath, content, fileName); - currentTestState = new TestState(basePath, testType, testData); + const state = new TestState(basePath, testType, testData); let result = ""; + const fourslashFile: Harness.Compiler.TestFile = { + unitName: Harness.Compiler.fourslashFileName, + content: undefined, + }; + const testFile: Harness.Compiler.TestFile = { + unitName: fileName, + content: content + }; + const host = Harness.Compiler.createCompilerHost( - [ - { unitName: Harness.Compiler.fourslashFileName, content: undefined }, - { unitName: fileName, content: content } - ], + [ fourslashFile, testFile ], (fn, contents) => result = contents, ts.ScriptTarget.Latest, - Harness.IO.useCaseSensitiveFileNames()); + Harness.IO.useCaseSensitiveFileNames(), + Harness.IO.getCurrentDirectory()); const program = ts.createProgram([Harness.Compiler.fourslashFileName, fileName], { outFile: "fourslashTestOutput.js", noResolve: true, target: ts.ScriptTarget.ES3 }, host); @@ -2409,22 +2217,32 @@ namespace FourSlash { } program.emit(sourceFile); - result = result || ""; // Might have an empty fourslash file - result = fourslashJsOutput + "\r\n" + result; + ts.Debug.assert(!!result); + runCode(result, state); + } + function runCode(code: string, state: TestState): void { // Compile and execute the test + const wrappedCode = +`(function(test, goTo, verify, edit, debug, format, cancellation, classification, verifyOperationIsCancelled) { +${code} +})`; try { - eval(result); + const test = new FourSlashInterface.Test(state); + const goTo = new FourSlashInterface.GoTo(state); + const verify = new FourSlashInterface.Verify(state); + const edit = new FourSlashInterface.Edit(state); + const debug = new FourSlashInterface.Debug(state); + const format = new FourSlashInterface.Format(state); + const cancellation = new FourSlashInterface.Cancellation(state); + const f = eval(wrappedCode); + f(test, goTo, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, FourSlash.verifyOperationIsCancelled); } catch (err) { // Debugging: FourSlash.currentTestState.printCurrentFileState(); throw err; } - - const xmlData = currentTestState.getTestXmlData(); - xmlData.originalName = fileName; - return xmlData; } function chompLeadingSpace(content: string) { @@ -2592,7 +2410,7 @@ namespace FourSlash { throw new Error(errorMessage); } - function recordObjectMarker(fileName: string, location: ILocationInformation, text: string, markerMap: MarkerMap, markers: Marker[]): Marker { + function recordObjectMarker(fileName: string, location: LocationInformation, text: string, markerMap: MarkerMap, markers: Marker[]): Marker { let markerValue: any = undefined; try { // Attempt to parse the marker value as JSON @@ -2623,7 +2441,7 @@ namespace FourSlash { return marker; } - function recordMarker(fileName: string, location: ILocationInformation, name: string, markerMap: MarkerMap, markers: Marker[]): Marker { + function recordMarker(fileName: string, location: LocationInformation, name: string, markerMap: MarkerMap, markers: Marker[]): Marker { const marker: Marker = { fileName: fileName, position: location.position @@ -2652,10 +2470,10 @@ namespace FourSlash { let output = ""; /// The current marker (or maybe multi-line comment?) we're parsing, possibly - let openMarker: ILocationInformation = null; + let openMarker: LocationInformation = null; /// A stack of the open range markers that are still unclosed - const openRanges: IRangeLocationInformation[] = []; + const openRanges: RangeLocationInformation[] = []; /// A list of ranges we've collected so far */ let localRanges: Range[] = []; @@ -2841,3 +2659,632 @@ namespace FourSlash { }; } } + +namespace FourSlashInterface { + export class Test { + constructor(private state: FourSlash.TestState) { + } + + public markers(): FourSlash.Marker[] { + return this.state.getMarkers(); + } + + public marker(name?: string): FourSlash.Marker { + return this.state.getMarkerByName(name); + } + + public ranges(): FourSlash.Range[] { + return this.state.getRanges(); + } + + public markerByName(s: string): FourSlash.Marker { + return this.state.getMarkerByName(s); + } + } + + export class GoTo { + constructor(private state: FourSlash.TestState) { + } + // Moves the caret to the specified marker, + // or the anonymous marker ('/**/') if no name + // is given + public marker(name?: string) { + this.state.goToMarker(name); + } + + public bof() { + this.state.goToBOF(); + } + + public eof() { + this.state.goToEOF(); + } + + public definition(definitionIndex = 0) { + this.state.goToDefinition(definitionIndex); + } + + public type(definitionIndex = 0) { + this.state.goToTypeDefinition(definitionIndex); + } + + public position(position: number, fileIndex?: number): void; + public position(position: number, fileName?: string): void; + public position(position: number, fileNameOrIndex?: any): void { + if (fileNameOrIndex !== undefined) { + this.file(fileNameOrIndex); + } + this.state.goToPosition(position); + } + + // Opens a file, given either its index as it + // appears in the test source, or its filename + // as specified in the test metadata + public file(index: number, content?: string): void; + public file(name: string, content?: string): void; + public file(indexOrName: any, content?: string): void { + this.state.openFile(indexOrName, content); + } + } + + export class VerifyNegatable { + public not: VerifyNegatable; + + constructor(protected state: FourSlash.TestState, private negative = false) { + if (!negative) { + this.not = new VerifyNegatable(state, true); + } + } + + // Verifies the member list contains the specified symbol. The + // member list is brought up if necessary + public memberListContains(symbol: string, text?: string, documenation?: string, kind?: string) { + if (this.negative) { + this.state.verifyMemberListDoesNotContain(symbol); + } + else { + this.state.verifyMemberListContains(symbol, text, documenation, kind); + } + } + + public memberListCount(expectedCount: number) { + this.state.verifyMemberListCount(expectedCount, this.negative); + } + + // Verifies the completion list contains the specified symbol. The + // completion list is brought up if necessary + public completionListContains(symbol: string, text?: string, documentation?: string, kind?: string) { + if (this.negative) { + this.state.verifyCompletionListDoesNotContain(symbol, text, documentation, kind); + } + else { + this.state.verifyCompletionListContains(symbol, text, documentation, kind); + } + } + + // Verifies the completion list items count to be greater than the specified amount. The + // completion list is brought up if necessary + public completionListItemsCountIsGreaterThan(count: number) { + this.state.verifyCompletionListItemsCountIsGreaterThan(count, this.negative); + } + + public completionListIsEmpty() { + this.state.verifyCompletionListIsEmpty(this.negative); + } + + public completionListAllowsNewIdentifier() { + this.state.verifyCompletionListAllowsNewIdentifier(this.negative); + } + + public memberListIsEmpty() { + this.state.verifyMemberListIsEmpty(this.negative); + } + + public referencesCountIs(count: number) { + this.state.verifyReferencesCountIs(count, /*localFilesOnly*/ false); + } + + public referencesAtPositionContains(range: FourSlash.Range, isWriteAccess?: boolean) { + this.state.verifyReferencesAtPositionListContains(range.fileName, range.start, range.end, isWriteAccess); + } + + public signatureHelpPresent() { + this.state.verifySignatureHelpPresent(!this.negative); + } + + public errorExistsBetweenMarkers(startMarker: string, endMarker: string) { + this.state.verifyErrorExistsBetweenMarkers(startMarker, endMarker, !this.negative); + } + + public errorExistsAfterMarker(markerName = "") { + this.state.verifyErrorExistsAfterMarker(markerName, !this.negative, /*after*/ true); + } + + public errorExistsBeforeMarker(markerName = "") { + this.state.verifyErrorExistsAfterMarker(markerName, !this.negative, /*after*/ false); + } + + public quickInfoIs(expectedText?: string, expectedDocumentation?: string) { + this.state.verifyQuickInfoString(this.negative, expectedText, expectedDocumentation); + } + + public quickInfoExists() { + this.state.verifyQuickInfoExists(this.negative); + } + + public definitionCountIs(expectedCount: number) { + this.state.verifyDefinitionsCount(this.negative, expectedCount); + } + + public typeDefinitionCountIs(expectedCount: number) { + this.state.verifyTypeDefinitionsCount(this.negative, expectedCount); + } + + public definitionLocationExists() { + this.state.verifyDefinitionLocationExists(this.negative); + } + + public verifyDefinitionsName(name: string, containerName: string) { + this.state.verifyDefinitionsName(this.negative, name, containerName); + } + } + + export class Verify extends VerifyNegatable { + constructor(state: FourSlash.TestState) { + super(state); + } + + public caretAtMarker(markerName?: string) { + this.state.verifyCaretAtMarker(markerName); + } + + public indentationIs(numberOfSpaces: number) { + this.state.verifyIndentationAtCurrentPosition(numberOfSpaces); + } + + public indentationAtPositionIs(fileName: string, position: number, numberOfSpaces: number, indentStyle = ts.IndentStyle.Smart) { + this.state.verifyIndentationAtPosition(fileName, position, numberOfSpaces, indentStyle); + } + + public textAtCaretIs(text: string) { + this.state.verifyTextAtCaretIs(text); + } + + /** + * Compiles the current file and evaluates 'expr' in a context containing + * the emitted output, then compares (using ===) the result of that expression + * to 'value'. Do not use this function with external modules as it is not supported. + */ + public eval(expr: string, value: any) { + this.state.verifyEval(expr, value); + } + + public currentLineContentIs(text: string) { + this.state.verifyCurrentLineContent(text); + } + + public currentFileContentIs(text: string) { + this.state.verifyCurrentFileContent(text); + } + + public verifyGetEmitOutputForCurrentFile(expected: string): void { + this.state.verifyGetEmitOutputForCurrentFile(expected); + } + + public verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void { + this.state.verifyGetEmitOutputContentsForCurrentFile(expected); + } + + public currentParameterHelpArgumentNameIs(name: string) { + this.state.verifyCurrentParameterHelpName(name); + } + + public currentParameterSpanIs(parameter: string) { + this.state.verifyCurrentParameterSpanIs(parameter); + } + + public currentParameterHelpArgumentDocCommentIs(docComment: string) { + this.state.verifyCurrentParameterHelpDocComment(docComment); + } + + public currentSignatureHelpDocCommentIs(docComment: string) { + this.state.verifyCurrentSignatureHelpDocComment(docComment); + } + + public signatureHelpCountIs(expected: number) { + this.state.verifySignatureHelpCount(expected); + } + + public signatureHelpArgumentCountIs(expected: number) { + this.state.verifySignatureHelpArgumentCount(expected); + } + + public currentSignatureParameterCountIs(expected: number) { + this.state.verifyCurrentSignatureHelpParameterCount(expected); + } + + public currentSignatureHelpIs(expected: string) { + this.state.verifyCurrentSignatureHelpIs(expected); + } + + public numberOfErrorsInCurrentFile(expected: number) { + this.state.verifyNumberOfErrorsInCurrentFile(expected); + } + + public baselineCurrentFileBreakpointLocations() { + this.state.baselineCurrentFileBreakpointLocations(); + } + + public baselineCurrentFileNameOrDottedNameSpans() { + this.state.baselineCurrentFileNameOrDottedNameSpans(); + } + + public baselineGetEmitOutput() { + this.state.baselineGetEmitOutput(); + } + + public nameOrDottedNameSpanTextIs(text: string) { + this.state.verifyCurrentNameOrDottedNameSpanText(text); + } + + public outliningSpansInCurrentFile(spans: FourSlash.TextSpan[]) { + this.state.verifyOutliningSpans(spans); + } + + public todoCommentsInCurrentFile(descriptors: string[]) { + this.state.verifyTodoComments(descriptors, this.state.getRanges()); + } + + public matchingBracePositionInCurrentFile(bracePosition: number, expectedMatchPosition: number) { + this.state.verifyMatchingBracePosition(bracePosition, expectedMatchPosition); + } + + public noMatchingBracePositionInCurrentFile(bracePosition: number) { + this.state.verifyNoMatchingBracePosition(bracePosition); + } + + public DocCommentTemplate(expectedText: string, expectedOffset: number, empty?: boolean) { + this.state.verifyDocCommentTemplate(empty ? undefined : { newText: expectedText, caretOffset: expectedOffset }); + } + + public noDocCommentTemplate() { + this.DocCommentTemplate(/*expectedText*/ undefined, /*expectedOffset*/ undefined, /*empty*/ true); + } + + public getScriptLexicalStructureListCount(count: number) { + this.state.verifyGetScriptLexicalStructureListCount(count); + } + + // TODO: figure out what to do with the unused arguments. + public getScriptLexicalStructureListContains( + name: string, + kind: string, + fileName?: string, + parentName?: string, + isAdditionalSpan?: boolean, + markerPosition?: number) { + this.state.verifyGetScriptLexicalStructureListContains(name, kind); + } + + public navigationItemsListCount(count: number, searchValue: string, matchKind?: string) { + this.state.verifyNavigationItemsCount(count, searchValue, matchKind); + } + + public navigationItemsListContains( + name: string, + kind: string, + searchValue: string, + matchKind: string, + fileName?: string, + parentName?: string) { + this.state.verifyNavigationItemsListContains( + name, + kind, + searchValue, + matchKind, + fileName, + parentName); + } + + public occurrencesAtPositionContains(range: FourSlash.Range, isWriteAccess?: boolean) { + this.state.verifyOccurrencesAtPositionListContains(range.fileName, range.start, range.end, isWriteAccess); + } + + public occurrencesAtPositionCount(expectedCount: number) { + this.state.verifyOccurrencesAtPositionListCount(expectedCount); + } + + public documentHighlightsAtPositionContains(range: FourSlash.Range, fileNamesToSearch: string[], kind?: string) { + this.state.verifyDocumentHighlightsAtPositionListContains(range.fileName, range.start, range.end, fileNamesToSearch, kind); + } + + public documentHighlightsAtPositionCount(expectedCount: number, fileNamesToSearch: string[]) { + this.state.verifyDocumentHighlightsAtPositionListCount(expectedCount, fileNamesToSearch); + } + + public completionEntryDetailIs(entryName: string, text: string, documentation?: string, kind?: string) { + this.state.verifyCompletionEntryDetails(entryName, text, documentation, kind); + } + + /** + * This method *requires* a contiguous, complete, and ordered stream of classifications for a file. + */ + public syntacticClassificationsAre(...classifications: { classificationType: string; text: string }[]) { + this.state.verifySyntacticClassifications(classifications); + } + + /** + * This method *requires* an ordered stream of classifications for a file, and spans are highly recommended. + */ + public semanticClassificationsAre(...classifications: { classificationType: string; text: string; textSpan?: FourSlash.TextSpan }[]) { + this.state.verifySemanticClassifications(classifications); + } + + public renameInfoSucceeded(displayName?: string, fullDisplayName?: string, kind?: string, kindModifiers?: string) { + this.state.verifyRenameInfoSucceeded(displayName, fullDisplayName, kind, kindModifiers); + } + + public renameInfoFailed(message?: string) { + this.state.verifyRenameInfoFailed(message); + } + + public renameLocations(findInStrings: boolean, findInComments: boolean) { + this.state.verifyRenameLocations(findInStrings, findInComments); + } + + public verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { start: number; length: number; }, + displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[]) { + this.state.verifyQuickInfoDisplayParts(kind, kindModifiers, textSpan, displayParts, documentation); + } + + public getSyntacticDiagnostics(expected: string) { + this.state.getSyntacticDiagnostics(expected); + } + + public getSemanticDiagnostics(expected: string) { + this.state.getSemanticDiagnostics(expected); + } + + public ProjectInfo(expected: string []) { + this.state.verifyProjectInfo(expected); + } + } + + export class Edit { + constructor(private state: FourSlash.TestState) { + } + public backspace(count?: number) { + this.state.deleteCharBehindMarker(count); + } + + public deleteAtCaret(times?: number) { + this.state.deleteChar(times); + } + + public replace(start: number, length: number, text: string) { + this.state.replace(start, length, text); + } + + public paste(text: string) { + this.state.paste(text); + } + + public insert(text: string) { + this.insertLines(text); + } + + public insertLine(text: string) { + this.insertLines(text + "\n"); + } + + public insertLines(...lines: string[]) { + this.state.type(lines.join("\n")); + } + + public moveRight(count?: number) { + this.state.moveCaretRight(count); + } + + public moveLeft(count?: number) { + if (typeof count === "undefined") { + count = 1; + } + this.state.moveCaretRight(count * -1); + } + + public enableFormatting() { + this.state.enableFormatting = true; + } + + public disableFormatting() { + this.state.enableFormatting = false; + } + } + + export class Debug { + constructor(private state: FourSlash.TestState) { + } + + public printCurrentParameterHelp() { + this.state.printCurrentParameterHelp(); + } + + public printCurrentFileState() { + this.state.printCurrentFileState(); + } + + public printCurrentFileStateWithWhitespace() { + this.state.printCurrentFileState(/*makeWhitespaceVisible*/true); + } + + public printCurrentFileStateWithoutCaret() { + this.state.printCurrentFileState(/*makeWhitespaceVisible*/false, /*makeCaretVisible*/false); + } + + public printCurrentQuickInfo() { + this.state.printCurrentQuickInfo(); + } + + public printCurrentSignatureHelp() { + this.state.printCurrentSignatureHelp(); + } + + public printMemberListMembers() { + this.state.printMemberListMembers(); + } + + public printCompletionListMembers() { + this.state.printCompletionListMembers(); + } + + public printBreakpointLocation(pos: number) { + this.state.printBreakpointLocation(pos); + } + public printBreakpointAtCurrentLocation() { + this.state.printBreakpointAtCurrentLocation(); + } + + public printNameOrDottedNameSpans(pos: number) { + this.state.printNameOrDottedNameSpans(pos); + } + + public printErrorList() { + this.state.printErrorList(); + } + + public printNavigationItems(searchValue = ".*") { + this.state.printNavigationItems(searchValue); + } + + public printScriptLexicalStructureItems() { + this.state.printScriptLexicalStructureItems(); + } + + public printReferences() { + this.state.printReferences(); + } + + public printContext() { + this.state.printContext(); + } + } + + export class Format { + constructor(private state: FourSlash.TestState) { + } + + public document() { + this.state.formatDocument(); + } + + public copyFormatOptions(): ts.FormatCodeOptions { + return this.state.copyFormatOptions(); + } + + public setFormatOptions(options: ts.FormatCodeOptions) { + return this.state.setFormatOptions(options); + } + + public selection(startMarker: string, endMarker: string) { + this.state.formatSelection(this.state.getMarkerByName(startMarker).position, this.state.getMarkerByName(endMarker).position); + } + + public setOption(name: string, value: number): void; + public setOption(name: string, value: string): void; + public setOption(name: string, value: boolean): void; + public setOption(name: string, value: any): void { + this.state.formatCodeOptions[name] = value; + } + } + + export class Cancellation { + constructor(private state: FourSlash.TestState) { + } + + public resetCancelled() { + this.state.resetCancelled(); + } + + public setCancelled(numberOfCalls = 0) { + this.state.setCancelled(numberOfCalls); + } + } + + export namespace Classification { + export function comment(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("comment", text, position); + } + + export function identifier(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("identifier", text, position); + } + + export function keyword(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("keyword", text, position); + } + + export function numericLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("numericLiteral", text, position); + } + + export function operator(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("operator", text, position); + } + + export function stringLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("stringLiteral", text, position); + } + + export function whiteSpace(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("whiteSpace", text, position); + } + + export function text(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("text", text, position); + } + + export function punctuation(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("punctuation", text, position); + } + + export function docCommentTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("docCommentTagName", text, position); + } + + export function className(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("className", text, position); + } + + export function enumName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("enumName", text, position); + } + + export function interfaceName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("interfaceName", text, position); + } + + export function moduleName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("moduleName", text, position); + } + + export function typeParameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("typeParameterName", text, position); + } + + export function parameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("parameterName", text, position); + } + + export function typeAliasName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("typeAliasName", text, position); + } + + function getClassification(type: string, text: string, position?: number) { + return { + classificationType: type, + text: text, + textSpan: position === undefined ? undefined : { start: position, end: position + text.length } + }; + } + } +} diff --git a/src/harness/fourslashRunner.ts b/src/harness/fourslashRunner.ts index 7228f06c20f..84e352359c4 100644 --- a/src/harness/fourslashRunner.ts +++ b/src/harness/fourslashRunner.ts @@ -58,56 +58,6 @@ class FourSlashRunner extends RunnerBase { } }); }); - - describe("Generate Tao XML", () => { - const invalidReasons: any = {}; - FourSlash.xmlData.forEach(xml => { - if (xml.invalidReason !== null) { - invalidReasons[xml.invalidReason] = (invalidReasons[xml.invalidReason] || 0) + 1; - } - }); - const invalidReport: { reason: string; count: number }[] = []; - for (const 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); - - const 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")); - }); }); } } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 934b7a0a36b..ecde2f32db0 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -176,7 +176,9 @@ namespace Utils { ts.forEachChild(node, child => { childNodesAndArrays.push(child); }, array => { childNodesAndArrays.push(array); }); for (const childName in node) { - if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator") { + if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator" || + // for now ignore jsdoc comments + childName === "jsDocComment") { continue; } const child = (node)[childName]; @@ -628,7 +630,7 @@ namespace Harness { function getResolvedPathFromServer(path: string) { const xhr = new XMLHttpRequest(); try { - xhr.open("GET", path + "?resolve", false); + xhr.open("GET", path + "?resolve", /*async*/ false); xhr.send(); } catch (e) { @@ -647,7 +649,7 @@ namespace Harness { export function getFileFromServerSync(url: string): XHRResponse { const xhr = new XMLHttpRequest(); try { - xhr.open("GET", url, false); + xhr.open("GET", url, /*async*/ false); xhr.send(); } catch (e) { @@ -662,7 +664,7 @@ namespace Harness { const xhr = new XMLHttpRequest(); try { const actionMsg = "?action=" + action; - xhr.open("POST", url + actionMsg, false); + xhr.open("POST", url + actionMsg, /*async*/ false); xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); xhr.send(contents); } @@ -767,26 +769,9 @@ namespace Harness { } namespace Harness { - let tcServicesFileName = "typescriptServices.js"; - - export let libFolder: string; - switch (Utils.getExecutionEnvironment()) { - case Utils.ExecutionEnvironment.CScript: - libFolder = "built/local/"; - tcServicesFileName = "built/local/typescriptServices.js"; - break; - case Utils.ExecutionEnvironment.Node: - libFolder = "built/local/"; - tcServicesFileName = "built/local/typescriptServices.js"; - break; - case Utils.ExecutionEnvironment.Browser: - libFolder = "built/local/"; - tcServicesFileName = "built/local/typescriptServices.js"; - break; - default: - throw new Error("Unknown context"); - } - export let tcServicesFile = IO.readFile(tcServicesFileName); + export const libFolder = "built/local/"; + const tcServicesFileName = ts.combinePaths(libFolder, "typescriptServices.js"); + export const tcServicesFile = IO.readFile(tcServicesFileName); export interface SourceMapEmitterCallback { (emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string): void; @@ -827,57 +812,14 @@ namespace Harness { } } - 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 { - let 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; }[] { - const result: { fileName: string; file: WriterAggregator; }[] = []; - for (const p in this.fileCollection) { - if (this.fileCollection.hasOwnProperty(p)) { - const 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 function createSourceFileAndAssertInvariants( fileName: string, sourceText: string, languageVersion: ts.ScriptTarget) { - // We'll only assert inletiants outside of light mode. + // We'll only assert invariants outside of light mode. const shouldAssertInvariants = !Harness.lightMode; - // Only set the parent nodes if we're asserting inletiants. We don't need them otherwise. + // Only set the parent nodes if we're asserting invariants. We don't need them otherwise. const result = ts.createSourceFile(fileName, sourceText, languageVersion, /*setParentNodes:*/ shouldAssertInvariants); if (shouldAssertInvariants) { @@ -890,12 +832,12 @@ namespace Harness { const carriageReturnLineFeed = "\r\n"; const lineFeed = "\n"; - export let defaultLibFileName = "lib.d.ts"; - export let defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); - export let defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); + export const defaultLibFileName = "lib.d.ts"; + export const defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); + export const defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); // Cache these between executions so we don't have to re-parse them for every test - export let fourslashFileName = "fourslash.ts"; + export const fourslashFileName = "fourslash.ts"; export let fourslashSourceFile: ts.SourceFile; export function getCanonicalFileName(fileName: string): string { @@ -903,41 +845,32 @@ namespace Harness { } export function createCompilerHost( - inputFiles: { unitName: string; content: string; }[], + inputFiles: TestFile[], writeFile: (fn: string, contents: string, writeByteOrderMark: boolean) => void, scriptTarget: ts.ScriptTarget, useCaseSensitiveFileNames: boolean, // the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host - currentDirectory?: string, + currentDirectory: string, newLineKind?: ts.NewLineKind): ts.CompilerHost { // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames - function getCanonicalFileName(fileName: string): string { - return useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - } + const getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - const filemap: { [fileName: string]: ts.SourceFile; } = {}; - const getCurrentDirectory = currentDirectory === undefined ? Harness.IO.getCurrentDirectory : () => currentDirectory; - - // Register input files - function register(file: { unitName: string; content: string; }) { + const fileMap: ts.FileMap = ts.createFileMap(); + for (const file of inputFiles) { if (file.content !== undefined) { const fileName = ts.normalizePath(file.unitName); const sourceFile = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget); - filemap[getCanonicalFileName(fileName)] = sourceFile; - filemap[getCanonicalFileName(ts.getNormalizedAbsolutePath(fileName, getCurrentDirectory()))] = sourceFile; + const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName); + fileMap.set(path, sourceFile); } - }; - inputFiles.forEach(register); + } function getSourceFile(fn: string, languageVersion: ts.ScriptTarget) { fn = ts.normalizePath(fn); - if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) { - return filemap[getCanonicalFileName(fn)]; - } - else if (currentDirectory) { - const canonicalAbsolutePath = getCanonicalFileName(ts.getNormalizedAbsolutePath(fn, currentDirectory)); - return Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(canonicalAbsolutePath)) ? filemap[canonicalAbsolutePath] : undefined; + const path = ts.toPath(fn, currentDirectory, getCanonicalFileName); + if (fileMap.contains(path)) { + return fileMap.get(path); } else if (fn === fourslashFileName) { const tsFn = "tests/cases/fourslash/" + fourslashFileName; @@ -959,7 +892,7 @@ namespace Harness { Harness.IO.newLine(); return { - getCurrentDirectory, + getCurrentDirectory: () => currentDirectory, getSourceFile, getDefaultLibFileName: options => defaultLibFileName, writeFile, @@ -1034,177 +967,138 @@ namespace Harness { } } - export class HarnessCompiler { - private inputFiles: { unitName: string; content: string }[] = []; - private compileOptions: ts.CompilerOptions; - private settings: Harness.TestCaseParser.CompilerSettings = {}; + export interface TestFile { + unitName: string; + content: string; + } - private lastErrors: ts.Diagnostic[]; + export interface CompilationOutput { + result: CompilerResult; + options: ts.CompilerOptions & HarnessOptions; + } - public reset() { - this.inputFiles = []; - this.settings = {}; - this.lastErrors = []; + export function compileFiles( + inputFiles: TestFile[], + otherFiles: TestFile[], + harnessSettings: TestCaseParser.CompilerSettings, + compilerOptions: ts.CompilerOptions, + // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file + currentDirectory: string): CompilationOutput { + + const options: ts.CompilerOptions & HarnessOptions = compilerOptions ? ts.clone(compilerOptions) : { noResolve: false }; + options.target = options.target || ts.ScriptTarget.ES3; + options.module = options.module || ts.ModuleKind.None; + options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed; + options.noErrorTruncation = true; + options.skipDefaultLibCheck = true; + + currentDirectory = currentDirectory || Harness.IO.getCurrentDirectory(); + + // Parse settings + let useCaseSensitiveFileNames = Harness.IO.useCaseSensitiveFileNames(); + if (harnessSettings) { + setCompilerOptionsFromHarnessSetting(harnessSettings, options); + } + if (options.useCaseSensitiveFileNames !== undefined) { + useCaseSensitiveFileNames = options.useCaseSensitiveFileNames; } - public reportCompilationErrors() { - return this.lastErrors; + const programFiles: TestFile[] = inputFiles.slice(); + // Files from built\local that are requested by test "@includeBuiltFiles" to be in the context. + // Treat them as library files, so include them in build, but not in baselines. + if (options.includeBuiltFile) { + const builtFileName = ts.combinePaths(libFolder, options.includeBuiltFile); + const builtFile: TestFile = { + unitName: builtFileName, + content: normalizeLineEndings(IO.readFile(builtFileName), Harness.IO.newLine()), + }; + programFiles.push(builtFile); } - public setCompilerSettings(tcSettings: Harness.TestCaseParser.CompilerSettings) { - this.settings = tcSettings; + const fileOutputs: GeneratedFile[] = []; + + const programFileNames = programFiles.map(file => file.unitName); + + const compilerHost = createCompilerHost( + programFiles.concat(otherFiles), + (fileName, code, writeByteOrderMark) => fileOutputs.push({ fileName, code, writeByteOrderMark }), + options.target, + useCaseSensitiveFileNames, + currentDirectory, + options.newLine); + const program = ts.createProgram(programFileNames, options, compilerHost); + + const emitResult = program.emit(); + + const errors = ts.getPreEmitDiagnostics(program); + + const result = new CompilerResult(fileOutputs, errors, program, Harness.IO.getCurrentDirectory(), emitResult.sourceMaps); + return { result, options }; + } + + export function compileDeclarationFiles(inputFiles: TestFile[], + otherFiles: TestFile[], + result: CompilerResult, + harnessSettings: TestCaseParser.CompilerSettings & HarnessOptions, + options: ts.CompilerOptions, + // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file + currentDirectory: string) { + if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { + throw new Error("There were no errors and declFiles generated did not match number of js files generated"); } - public addInputFiles(files: { unitName: string; content: string }[]) { - files.forEach(file => this.addInputFile(file)); + const declInputFiles: TestFile[] = []; + const declOtherFiles: TestFile[] = []; + + // if the .d.ts is non-empty, confirm it compiles correctly as well + if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { + ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); + ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); + const output = compileFiles(declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory); + return { declInputFiles, declOtherFiles, declResult: output.result }; } - public addInputFile(file: { unitName: string; content: string }) { - this.inputFiles.push(file); - } - - public setCompilerOptions(options?: ts.CompilerOptions) { - this.compileOptions = options || { noResolve: false }; - } - - public emitAll(ioHost?: IEmitterIOHost) { - this.compileFiles(this.inputFiles, - /*otherFiles*/ [], - /*onComplete*/ result => { - result.files.forEach(writeFile); - result.declFilesCode.forEach(writeFile); - result.sourceMaps.forEach(writeFile); - }, - /*settingsCallback*/ () => { }, - this.compileOptions); - - function writeFile(file: GeneratedFile) { - ioHost.writeFile(file.fileName, file.code, false); + function addDtsFile(file: TestFile, dtsFiles: TestFile[]) { + if (isDTS(file.unitName)) { + dtsFiles.push(file); } - } - - public compileFiles(inputFiles: { unitName: string; content: string }[], - otherFiles: { unitName: string; content: string }[], - onComplete: (result: CompilerResult, program: ts.Program) => void, - settingsCallback?: (settings: ts.CompilerOptions) => void, - options?: ts.CompilerOptions & HarnessOptions, - // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file - currentDirectory?: string) { - - options = options || { noResolve: false }; - options.target = options.target || ts.ScriptTarget.ES3; - options.module = options.module || ts.ModuleKind.None; - options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed; - options.noErrorTruncation = true; - options.skipDefaultLibCheck = true; - - if (settingsCallback) { - settingsCallback(null); - } - - const newLine = "\r\n"; - - // Parse settings - setCompilerOptionsFromHarnessSetting(this.settings, options); - - // Files from built\local that are requested by test "@includeBuiltFiles" to be in the context. - // Treat them as library files, so include them in build, but not in baselines. - const includeBuiltFiles: { unitName: string; content: string }[] = []; - if (options.includeBuiltFile) { - const builtFileName = libFolder + options.includeBuiltFile; - includeBuiltFiles.push({ unitName: builtFileName, content: normalizeLineEndings(IO.readFile(builtFileName), newLine) }); - } - - const useCaseSensitiveFileNames = options.useCaseSensitiveFileNames !== undefined ? options.useCaseSensitiveFileNames : Harness.IO.useCaseSensitiveFileNames(); - - const fileOutputs: GeneratedFile[] = []; - - const programFiles = inputFiles.concat(includeBuiltFiles).map(file => file.unitName); - - const compilerHost = createCompilerHost( - inputFiles.concat(includeBuiltFiles).concat(otherFiles), - (fn, contents, writeByteOrderMark) => fileOutputs.push({ fileName: fn, code: contents, writeByteOrderMark: writeByteOrderMark }), - options.target, useCaseSensitiveFileNames, currentDirectory, options.newLine); - const program = ts.createProgram(programFiles, options, compilerHost); - - const emitResult = program.emit(); - - const errors = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - this.lastErrors = errors; - - const result = new CompilerResult(fileOutputs, errors, program, Harness.IO.getCurrentDirectory(), emitResult.sourceMaps); - onComplete(result, program); - - return options; - } - - public compileDeclarationFiles(inputFiles: { unitName: string; content: string; }[], - otherFiles: { unitName: string; content: string; }[], - result: CompilerResult, - settingsCallback?: (settings: ts.CompilerOptions) => void, - options?: ts.CompilerOptions, - // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file - currentDirectory?: string) { - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { - throw new Error("There were no errors and declFiles generated did not match number of js files generated"); - } - - const declInputFiles: { unitName: string; content: string }[] = []; - const declOtherFiles: { unitName: string; content: string }[] = []; - let declResult: Harness.Compiler.CompilerResult; - - // if the .d.ts is non-empty, confirm it compiles correctly as well - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { - ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); - ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); - this.compileFiles(declInputFiles, declOtherFiles, function (compileResult) { declResult = compileResult; }, - settingsCallback, options, currentDirectory); - - return { declInputFiles, declOtherFiles, declResult }; - } - - function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { - if (isDTS(file.unitName)) { - dtsFiles.push(file); - } - else if (isTS(file.unitName)) { - const declFile = findResultCodeFile(file.unitName); - if (!findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { - dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); - } - } - - function findResultCodeFile(fileName: string) { - const sourceFile = result.program.getSourceFile(fileName); - assert(sourceFile, "Program has no source file with name '" + fileName + "'"); - // Is this file going to be emitted separately - let sourceFileName: string; - const outFile = options.outFile || options.out; - if (ts.isExternalModule(sourceFile) || !outFile) { - if (options.outDir) { - let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, result.currentDirectoryForProgram); - sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), ""); - sourceFileName = ts.combinePaths(options.outDir, sourceFilePath); - } - else { - sourceFileName = sourceFile.fileName; - } - } - else { - // Goes to single --out file - sourceFileName = outFile; - } - - const dTsFileName = ts.removeFileExtension(sourceFileName) + ".d.ts"; - - return ts.forEach(result.declFilesCode, declFile => declFile.fileName === dTsFileName ? declFile : undefined); - } - - function findUnit(fileName: string, units: { unitName: string; content: string; }[]) { - return ts.forEach(units, unit => unit.unitName === fileName ? unit : undefined); + else if (isTS(file.unitName)) { + const declFile = findResultCodeFile(file.unitName); + if (declFile && !findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { + dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); } } } + + function findResultCodeFile(fileName: string) { + const sourceFile = result.program.getSourceFile(fileName); + assert(sourceFile, "Program has no source file with name '" + fileName + "'"); + // Is this file going to be emitted separately + let sourceFileName: string; + const outFile = options.outFile || options.out; + if (!outFile) { + if (options.outDir) { + let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, result.currentDirectoryForProgram); + sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), ""); + sourceFileName = ts.combinePaths(options.outDir, sourceFilePath); + } + else { + sourceFileName = sourceFile.fileName; + } + } + else { + // Goes to single --out file + sourceFileName = outFile; + } + + const dTsFileName = ts.removeFileExtension(sourceFileName) + ".d.ts"; + + return ts.forEach(result.declFilesCode, declFile => declFile.fileName === dTsFileName ? declFile : undefined); + } + + function findUnit(fileName: string, units: TestFile[]) { + return ts.forEach(units, unit => unit.unitName === fileName ? unit : undefined); + } } function normalizeLineEndings(text: string, lineEnding: string): string { @@ -1230,7 +1124,7 @@ namespace Harness { return errorOutput; } - export function getErrorBaseline(inputFiles: { unitName: string; content: string }[], diagnostics: ts.Diagnostic[]) { + export function getErrorBaseline(inputFiles: TestFile[], diagnostics: ts.Diagnostic[]) { diagnostics.sort(ts.compareDiagnostics); const outputLines: string[] = []; // Count up all errors that were found in files other than lib.d.ts so we don't miss any @@ -1371,16 +1265,6 @@ namespace Harness { } } - /** The harness' compiler instance used when tests are actually run. Reseting or changing settings of this compiler instance must be done within a test case (i.e., describe/it) */ - let 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() { - 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' @@ -1431,7 +1315,7 @@ namespace Harness { constructor(fileResults: GeneratedFile[], errors: ts.Diagnostic[], public program: ts.Program, public currentDirectoryForProgram: string, private sourceMapData: ts.SourceMapData[]) { - fileResults.forEach(emittedFile => { + for (const emittedFile of fileResults) { if (isDTS(emittedFile.fileName)) { // .d.ts file, add to declFiles emit this.declFilesCode.push(emittedFile); @@ -1446,7 +1330,7 @@ namespace Harness { else { throw new Error("Unrecognized file extension for file " + emittedFile.fileName); } - }); + } this.errors = errors; } @@ -1555,7 +1439,7 @@ namespace Harness { } // normalize the fileName for the single file case - currentFileName = testUnitData.length > 0 ? currentFileName : Path.getFileName(fileName); + currentFileName = testUnitData.length > 0 || currentFileName ? currentFileName : Path.getFileName(fileName); // EOF, push whatever remains const newTestFile2 = { @@ -1674,7 +1558,7 @@ namespace Harness { const encoded_actual = Utils.encodeString(actual); if (expected != encoded_actual) { // Overwrite & issue error - const errMsg = "The baseline file " + relativeFileName + " has changed"; + const errMsg = "The baseline file " + relativeFileName + " has changed."; throw new Error(errMsg); } } @@ -1711,12 +1595,9 @@ namespace Harness { return filePath.indexOf(Harness.libFolder) === 0; } - export function getDefaultLibraryFile(io: Harness.IO): { unitName: string, content: string } { + export function getDefaultLibraryFile(io: Harness.IO): Harness.Compiler.TestFile { const libFile = Harness.userSpecifiedRoot + Harness.libFolder + "lib.d.ts"; - return { - unitName: libFile, - content: io.readFile(libFile) - }; + return { unitName: libFile, content: io.readFile(libFile) }; } if (Error) (Error).stackTraceLimit = 1; diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 50dbef5a410..3c7814df562 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -7,7 +7,7 @@ namespace Harness.LanguageService { export class ScriptInfo { public version: number = 1; public editRanges: { length: number; textChangeRange: ts.TextChangeRange; }[] = []; - public lineMap: number[] = undefined; + private lineMap: number[] = undefined; constructor(public fileName: string, public content: string) { this.setContent(content); @@ -15,7 +15,11 @@ namespace Harness.LanguageService { private setContent(content: string): void { this.content = content; - this.lineMap = ts.computeLineStarts(content); + this.lineMap = undefined; + } + + public getLineMap(): number[] { + return this.lineMap || (this.lineMap = ts.computeLineStarts(this.content)); } public updateContent(content: string): void { @@ -153,7 +157,7 @@ namespace Harness.LanguageService { throw new Error("No script with name '" + fileName + "'"); } - public openFile(fileName: string): void { + public openFile(fileName: string, content?: string): void { } /** @@ -164,7 +168,7 @@ namespace Harness.LanguageService { const script: ScriptInfo = this.fileNameToScript[fileName]; assert.isNotNull(script); - return ts.computeLineAndCharacterOfPosition(script.lineMap, position); + return ts.computeLineAndCharacterOfPosition(script.getLineMap(), position); } } @@ -197,7 +201,7 @@ namespace Harness.LanguageService { getHost() { return this.host; } getLanguageService(): ts.LanguageService { return ts.createLanguageService(this.host); } getClassifier(): ts.Classifier { return ts.createClassifier(); } - getPreProcessedFileInfo(fileName: string, fileContents: string): ts.PreProcessedFileInfo { return ts.preProcessFile(fileContents); } + getPreProcessedFileInfo(fileName: string, fileContents: string): ts.PreProcessedFileInfo { return ts.preProcessFile(fileContents, /* readImportFiles */ true, ts.hasJavaScriptFileExtension(fileName)); } } /// Shim adapter @@ -493,9 +497,9 @@ namespace Harness.LanguageService { this.client = client; } - openFile(fileName: string): void { - super.openFile(fileName); - this.client.openFile(fileName); + openFile(fileName: string, content?: string): void { + super.openFile(fileName, content); + this.client.openFile(fileName, content); } editScript(fileName: string, start: number, end: number, newText: string) { diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index bf56f1aa3ea..0bae91f7976 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -174,7 +174,7 @@ namespace Playback { return true; } else { - return findResultByFields(replayLog.fileExists, { path }, false); + return findResultByFields(replayLog.fileExists, { path }, /*defaultValue*/ false); } }) ); diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 88bcfa7ddcc..52102663457 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -7,19 +7,11 @@ interface ProjectRunnerTestCase { scenario: string; projectRoot: string; // project where it lives - this also is the current directory 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 - noResolve?: boolean; - rootDir?: string; // --rootDir } interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { @@ -34,14 +26,14 @@ interface BatchCompileProjectTestCaseEmittedFile extends Harness.Compiler.Genera interface CompileProjectFilesResult { moduleKind: ts.ModuleKind; - program: ts.Program; + program?: ts.Program; + compilerOptions?: ts.CompilerOptions; errors: ts.Diagnostic[]; - sourceMapData: ts.SourceMapData[]; + sourceMapData?: ts.SourceMapData[]; } interface BatchCompileProjectTestCaseResult extends CompileProjectFilesResult { - outputFiles: BatchCompileProjectTestCaseEmittedFile[]; - nonSubfolderDiskFiles: number; + outputFiles?: BatchCompileProjectTestCaseEmittedFile[]; } class ProjectRunner extends RunnerBase { @@ -59,7 +51,7 @@ class ProjectRunner extends RunnerBase { } private runProjectTestCase(testCaseFileName: string) { - let testCase: ProjectRunnerTestCase; + let testCase: ProjectRunnerTestCase & ts.CompilerOptions; let testFileText: string = null; try { @@ -70,7 +62,7 @@ class ProjectRunner extends RunnerBase { } try { - testCase = JSON.parse(testFileText); + testCase = JSON.parse(testFileText); } catch (e) { assert(false, "Testcase: " + testCaseFileName + " does not contain valid json format: " + e.message); @@ -128,9 +120,10 @@ class ProjectRunner extends RunnerBase { function compileProjectFiles(moduleKind: ts.ModuleKind, getInputFiles: () => string[], getSourceFileTextImpl: (fileName: string) => string, - writeFile: (fileName: string, data: string, writeByteOrderMark: boolean) => void): CompileProjectFilesResult { + writeFile: (fileName: string, data: string, writeByteOrderMark: boolean) => void, + compilerOptions: ts.CompilerOptions): CompileProjectFilesResult { - const program = ts.createProgram(getInputFiles(), createCompilerOptions(), createCompilerHost()); + const program = ts.createProgram(getInputFiles(), compilerOptions, createCompilerHost()); let errors = ts.getPreEmitDiagnostics(program); const emitResult = program.emit(); @@ -155,21 +148,6 @@ class ProjectRunner extends RunnerBase { sourceMapData }; - function createCompilerOptions(): ts.CompilerOptions { - return { - declaration: !!testCase.declaration, - sourceMap: !!testCase.sourceMap, - outFile: testCase.out, - outDir: testCase.outDir, - mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? Harness.IO.resolvePath(testCase.mapRoot) : testCase.mapRoot, - sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? Harness.IO.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, - module: moduleKind, - moduleResolution: ts.ModuleResolutionKind.Classic, // currently all tests use classic module resolution kind, this will change in the future - noResolve: testCase.noResolve, - rootDir: testCase.rootDir - }; - } - function getSourceFileText(fileName: string): string { const text = getSourceFileTextImpl(fileName); return text !== undefined ? text : getSourceFileTextImpl(ts.getNormalizedAbsolutePath(fileName, getCurrentDirectory())); @@ -209,23 +187,105 @@ class ProjectRunner extends RunnerBase { let nonSubfolderDiskFiles = 0; const outputFiles: BatchCompileProjectTestCaseEmittedFile[] = []; + let inputFiles = testCase.inputFiles; + let compilerOptions = createCompilerOptions(); - const projectCompilerResult = compileProjectFiles(moduleKind, () => testCase.inputFiles, getSourceFileText, writeFile); + let configFileName: string; + if (compilerOptions.project) { + // Parse project + configFileName = ts.normalizePath(ts.combinePaths(compilerOptions.project, "tsconfig.json")); + assert(!inputFiles || inputFiles.length === 0, "cannot specify input files and project option together"); + } + else if (!inputFiles || inputFiles.length === 0) { + configFileName = ts.findConfigFile("", fileExists); + } + + if (configFileName) { + const result = ts.readConfigFile(configFileName, getSourceFileText); + if (result.error) { + return { + moduleKind, + errors: [result.error] + }; + } + + const configObject = result.config; + const configParseResult = ts.parseJsonConfigFileContent(configObject, { readDirectory }, ts.getDirectoryPath(configFileName), compilerOptions); + if (configParseResult.errors.length > 0) { + return { + moduleKind, + errors: configParseResult.errors + }; + } + inputFiles = configParseResult.fileNames; + compilerOptions = configParseResult.options; + } + + const projectCompilerResult = compileProjectFiles(moduleKind, () => inputFiles, getSourceFileText, writeFile, compilerOptions); return { moduleKind, program: projectCompilerResult.program, + compilerOptions, sourceMapData: projectCompilerResult.sourceMapData, outputFiles, errors: projectCompilerResult.errors, - nonSubfolderDiskFiles, }; + function createCompilerOptions() { + // Set the special options that depend on other testcase options + const compilerOptions: ts.CompilerOptions = { + mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? Harness.IO.resolvePath(testCase.mapRoot) : testCase.mapRoot, + sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? Harness.IO.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, + module: moduleKind, + moduleResolution: ts.ModuleResolutionKind.Classic, // currently all tests use classic module resolution kind, this will change in the future + }; + // Set the values specified using json + const optionNameMap: ts.Map = {}; + ts.forEach(ts.optionDeclarations, option => { + optionNameMap[option.name] = option; + }); + for (const name in testCase) { + if (name !== "mapRoot" && name !== "sourceRoot" && ts.hasProperty(optionNameMap, name)) { + const option = optionNameMap[name]; + const optType = option.type; + let value = testCase[name]; + if (typeof optType !== "string") { + const key = value.toLowerCase(); + if (ts.hasProperty(optType, key)) { + value = optType[key]; + } + } + compilerOptions[option.name] = value; + } + } + + return compilerOptions; + } + + function getFileNameInTheProjectTest(fileName: string): string { + return ts.isRootedDiskPath(fileName) + ? fileName + : ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(fileName); + } + + function readDirectory(rootDir: string, extension: string, exclude: string[]): string[] { + const harnessReadDirectoryResult = Harness.IO.readDirectory(getFileNameInTheProjectTest(rootDir), extension, exclude); + const result: string[] = []; + for (let i = 0; i < harnessReadDirectoryResult.length; i++) { + result[i] = ts.getRelativePathToDirectoryOrUrl(testCase.projectRoot, harnessReadDirectoryResult[i], + getCurrentDirectory(), Harness.Compiler.getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + return result; + } + + function fileExists(fileName: string): boolean { + return Harness.IO.fileExists(getFileNameInTheProjectTest(fileName)); + } + function getSourceFileText(fileName: string): string { let text: string = undefined; try { - text = Harness.IO.readFile(ts.isRootedDiskPath(fileName) - ? fileName - : ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(fileName)); + text = Harness.IO.readFile(getFileNameInTheProjectTest(fileName)); } catch (e) { // text doesn't get defined. @@ -288,13 +348,16 @@ class ProjectRunner extends RunnerBase { function compileCompileDTsFiles(compilerResult: BatchCompileProjectTestCaseResult) { const allInputFiles: { emittedFileName: string; code: string; }[] = []; + if (!compilerResult.program) { + return; + } const compilerOptions = compilerResult.program.getCompilerOptions(); ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => { - if (Harness.Compiler.isDTS(sourceFile.fileName)) { + if (ts.isDeclarationFile(sourceFile)) { allInputFiles.unshift({ emittedFileName: sourceFile.fileName, code: sourceFile.text }); } - else if (ts.shouldEmitToOwnFile(sourceFile, compilerResult.program.getCompilerOptions())) { + else if (!(compilerOptions.outFile || compilerOptions.out)) { let emitOutputFilePathWithoutExtension: string = undefined; if (compilerOptions.outDir) { let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, compilerResult.program.getCurrentDirectory()); @@ -306,7 +369,10 @@ class ProjectRunner extends RunnerBase { } const outputDtsFileName = emitOutputFilePathWithoutExtension + ".d.ts"; - allInputFiles.unshift(findOutpuDtsFile(outputDtsFileName)); + const file = findOutpuDtsFile(outputDtsFileName); + if (file) { + allInputFiles.unshift(file); + } } else { const outputDtsFileName = ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; @@ -317,7 +383,8 @@ class ProjectRunner extends RunnerBase { } }); - return compileProjectFiles(compilerResult.moduleKind, getInputFiles, getSourceFileText, writeFile); + // Dont allow config files since we are compiling existing source options + return compileProjectFiles(compilerResult.moduleKind, getInputFiles, getSourceFileText, writeFile, compilerResult.compilerOptions); function findOutpuDtsFile(fileName: string) { return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.emittedFileName === fileName ? outputFile : undefined); @@ -343,11 +410,16 @@ class ProjectRunner extends RunnerBase { } function getErrorsBaseline(compilerResult: CompileProjectFilesResult) { - const inputFiles = ts.map(ts.filter(compilerResult.program.getSourceFiles(), + const inputFiles = compilerResult.program ? ts.map(ts.filter(compilerResult.program.getSourceFiles(), sourceFile => sourceFile.fileName !== "lib.d.ts"), sourceFile => { - return { unitName: sourceFile.fileName, content: sourceFile.text }; - }); + return { + unitName: ts.isRootedDiskPath(sourceFile.fileName) ? + RunnerBase.removeFullPaths(sourceFile.fileName) : + sourceFile.fileName, + content: sourceFile.text + }; + }) : []; return Harness.Compiler.getErrorBaseline(inputFiles, compilerResult.errors); } @@ -360,34 +432,17 @@ class ProjectRunner extends RunnerBase { let compilerResult: BatchCompileProjectTestCaseResult; function getCompilerResolutionInfo() { - const 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, - rootDir: testCase.rootDir, - resolvedInputFiles: ts.map(compilerResult.program.getSourceFiles(), inputFile => { - return ts.convertToRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); - }), - emittedFiles: ts.map(compilerResult.outputFiles, outputFile => { - return ts.convertToRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); - }) - }; - + const resolutionInfo: ProjectRunnerTestCaseResolutionInfo & ts.CompilerOptions = JSON.parse(JSON.stringify(testCase)); + resolutionInfo.resolvedInputFiles = ts.map(compilerResult.program.getSourceFiles(), inputFile => { + return ts.convertToRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); + }); + resolutionInfo.emittedFiles = ts.map(compilerResult.outputFiles, outputFile => { + return ts.convertToRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); + }); return resolutionInfo; } - it(name + ": " + moduleNameToString(moduleKind) , () => { + it(name + ": " + moduleNameToString(moduleKind), () => { // Compile using node compilerResult = batchCompilerProjectTestCase(moduleKind); }); @@ -439,7 +494,7 @@ class ProjectRunner extends RunnerBase { it("Errors in generated Dts files for (" + moduleNameToString(moduleKind) + "): " + testCaseFileName, () => { if (!compilerResult.errors.length && testCase.declaration) { const dTsCompileResult = compileCompileDTsFiles(compilerResult); - if (dTsCompileResult.errors.length) { + if (dTsCompileResult && dTsCompileResult.errors.length) { Harness.Baseline.runBaseline("Errors in generated Dts files for (" + moduleNameToString(compilerResult.moduleKind) + "): " + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + ".dts.errors.txt", () => { return getErrorsBaseline(dTsCompileResult); }); diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index a350eda08f3..ce570a7d6ad 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -27,8 +27,8 @@ namespace RWC { export function runRWCTest(jsonPath: string) { describe("Testing a RWC project: " + jsonPath, () => { - let inputFiles: { unitName: string; content: string; }[] = []; - let otherFiles: { unitName: string; content: string; }[] = []; + let inputFiles: Harness.Compiler.TestFile[] = []; + let otherFiles: Harness.Compiler.TestFile[] = []; let compilerResult: Harness.Compiler.CompilerResult; let compilerOptions: ts.CompilerOptions; let baselineOpts: Harness.Baseline.BaselineOptions = { @@ -55,7 +55,6 @@ namespace RWC { }); it("can compile", () => { - const harnessCompiler = Harness.Compiler.getCompiler(); let opts: ts.ParsedCommandLine; const ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath)); @@ -71,8 +70,6 @@ namespace RWC { }); runWithIOLog(ioLog, oldIO => { - harnessCompiler.reset(); - let fileNames = opts.fileNames; const tsconfigFile = ts.forEach(ioLog.filesRead, f => isTsConfigFile(f) ? f : undefined); @@ -128,17 +125,21 @@ namespace RWC { opts.options.noLib = true; // Emit the results - compilerOptions = harnessCompiler.compileFiles( + compilerOptions = null; + const output = Harness.Compiler.compileFiles( inputFiles, otherFiles, - newCompilerResults => { compilerResult = newCompilerResults; }, - /*settingsCallback*/ undefined, opts.options, + /* harnessOptions */ undefined, + opts.options, // Since each RWC json file specifies its current directory in its json file, we need // to pass this information in explicitly instead of acquiring it from the process. currentDirectory); + + compilerOptions = output.options; + compilerResult = output.result; }); - function getHarnessCompilerInputUnit(fileName: string) { + function getHarnessCompilerInputUnit(fileName: string): Harness.Compiler.TestFile { const unitName = ts.normalizeSlashes(Harness.IO.resolvePath(fileName)); let content: string = null; try { @@ -201,8 +202,9 @@ namespace RWC { it("has the expected errors in generated declaration files", () => { if (compilerOptions.declaration && !compilerResult.errors.length) { Harness.Baseline.runBaseline("has the expected errors in generated declaration files", baseName + ".dts.errors.txt", () => { - const declFileCompilationResult = Harness.Compiler.getCompiler().compileDeclarationFiles(inputFiles, otherFiles, compilerResult, - /*settingscallback*/ undefined, compilerOptions, currentDirectory); + const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles( + inputFiles, otherFiles, compilerResult, /*harnessSettings*/ undefined, compilerOptions, currentDirectory); + if (declFileCompilationResult.declResult.errors.length === 0) { return null; } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index ce0a6a6528e..75246a9a266 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -190,7 +190,7 @@ namespace Harness.SourceMapRecoder { return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; } - createErrorIfCondition(true, "No encoded entry found"); + createErrorIfCondition(/*condition*/ true, "No encoded entry found"); } export function hasCompletedDecoding() { diff --git a/src/harness/test262Runner.ts b/src/harness/test262Runner.ts index f25e0c79b63..262145b4764 100644 --- a/src/harness/test262Runner.ts +++ b/src/harness/test262Runner.ts @@ -5,9 +5,9 @@ class Test262BaselineRunner extends RunnerBase { private static basePath = "internal/cases/test262"; private static helpersFilePath = "tests/cases/test262-harness/helpers.d.ts"; - private static helperFile = { + private static helperFile: Harness.Compiler.TestFile = { unitName: Test262BaselineRunner.helpersFilePath, - content: Harness.IO.readFile(Test262BaselineRunner.helpersFilePath) + content: Harness.IO.readFile(Test262BaselineRunner.helpersFilePath), }; private static testFileExtensionRegex = /\.js$/; private static options: ts.CompilerOptions = { @@ -31,8 +31,7 @@ class Test262BaselineRunner extends RunnerBase { let testState: { filename: string; compilerResult: Harness.Compiler.CompilerResult; - inputFiles: { unitName: string; content: string }[]; - program: ts.Program; + inputFiles: Harness.Compiler.TestFile[]; }; before(() => { @@ -40,8 +39,9 @@ class Test262BaselineRunner extends RunnerBase { const testFilename = ts.removeFileExtension(filePath).replace(/\//g, "_") + ".test"; const testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, testFilename); - const inputFiles = testCaseContent.testUnitData.map(unit => { - return { unitName: Test262BaselineRunner.getTestFilePath(unit.name), content: unit.content }; + const inputFiles: Harness.Compiler.TestFile[] = testCaseContent.testUnitData.map(unit => { + const unitName = Test262BaselineRunner.getTestFilePath(unit.name); + return { unitName, content: unit.content }; }); // Emit the results @@ -49,13 +49,16 @@ class Test262BaselineRunner extends RunnerBase { filename: testFilename, inputFiles: inputFiles, compilerResult: undefined, - program: undefined, }; - Harness.Compiler.getCompiler().compileFiles([Test262BaselineRunner.helperFile].concat(inputFiles), /*otherFiles*/ [], (compilerResult, program) => { - testState.compilerResult = compilerResult; - testState.program = program; - }, /*settingsCallback*/ undefined, Test262BaselineRunner.options); + const output = Harness.Compiler.compileFiles( + [Test262BaselineRunner.helperFile].concat(inputFiles), + /*otherFiles*/ [], + /* harnessOptions */ undefined, + Test262BaselineRunner.options, + /* currentDirectory */ undefined + ); + testState.compilerResult = output.result; }); after(() => { @@ -80,14 +83,14 @@ class Test262BaselineRunner extends RunnerBase { }, false, Test262BaselineRunner.baselineOptions); }); - it("satisfies inletiants", () => { - const sourceFile = testState.program.getSourceFile(Test262BaselineRunner.getTestFilePath(testState.filename)); + it("satisfies invariants", () => { + const sourceFile = testState.compilerResult.program.getSourceFile(Test262BaselineRunner.getTestFilePath(testState.filename)); Utils.assertInvariants(sourceFile, /*parent:*/ undefined); }); it("has the expected AST", () => { Harness.Baseline.runBaseline("has the expected AST", testState.filename + ".AST.txt", () => { - const sourceFile = testState.program.getSourceFile(Test262BaselineRunner.getTestFilePath(testState.filename)); + const sourceFile = testState.compilerResult.program.getSourceFile(Test262BaselineRunner.getTestFilePath(testState.filename)); return Utils.sourceFileToJSON(sourceFile); }, false, Test262BaselineRunner.baselineOptions); }); diff --git a/src/server/client.ts b/src/server/client.ts index ae234750d88..08939b2b44a 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -120,8 +120,8 @@ namespace ts.server { return response; } - openFile(fileName: string): void { - var args: protocol.FileRequestArgs = { file: fileName }; + openFile(fileName: string, content?: string): void { + var args: protocol.OpenRequestArgs = { file: fileName, fileContent: content }; this.processRequest(CommandNames.Open, args); } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 6543dc67af0..0305b7595c2 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -371,6 +371,10 @@ namespace ts.server { openRefCount = 0; constructor(public projectService: ProjectService, public projectOptions?: ProjectOptions) { + if (projectOptions && projectOptions.files) { + // If files are listed explicitly, allow all extensions + projectOptions.compilerOptions.allowNonTsExtensions = true; + } this.compilerService = new CompilerService(this, projectOptions && projectOptions.compilerOptions); } @@ -384,7 +388,7 @@ namespace ts.server { } openReferencedFile(filename: string) { - return this.projectService.openFile(filename, false); + return this.projectService.openFile(filename, /*openedByClient*/ false); } getRootFiles() { @@ -461,6 +465,7 @@ namespace ts.server { setProjectOptions(projectOptions: ProjectOptions) { this.projectOptions = projectOptions; if (projectOptions.compilerOptions) { + projectOptions.compilerOptions.allowNonTsExtensions = true; this.compilerService.setCompilerOptions(projectOptions.compilerOptions); } } @@ -559,7 +564,7 @@ namespace ts.server { // If a change was made inside "folder/file", node will trigger the callback twice: // one with the fileName being "folder/file", and the other one with "folder". // We don't respond to the second one. - if (fileName && !ts.isSupportedSourceFileName(fileName)) { + if (fileName && !ts.isSupportedSourceFileName(fileName, project.projectOptions ? project.projectOptions.compilerOptions : undefined)) { return; } @@ -1001,14 +1006,15 @@ namespace ts.server { /** * @param filename is absolute pathname + * @param fileContent is a known version of the file content that is more up to date than the one on disk */ - openFile(fileName: string, openedByClient: boolean) { + openFile(fileName: string, openedByClient: boolean, fileContent?: string) { fileName = ts.normalizePath(fileName); let info = ts.lookUp(this.filenameToScriptInfo, fileName); if (!info) { let content: string; if (this.host.fileExists(fileName)) { - content = this.host.readFile(fileName); + content = fileContent || this.host.readFile(fileName); } if (!content) { if (openedByClient) { @@ -1025,6 +1031,9 @@ namespace ts.server { } } if (info) { + if (fileContent) { + info.svc.reload(fileContent); + } if (openedByClient) { info.isOpen = true; } @@ -1055,10 +1064,11 @@ namespace ts.server { /** * Open file whose contents is managed by the client * @param filename is absolute pathname + * @param fileContent is a known version of the file content that is more up to date than the one on disk */ - openClientFile(fileName: string) { + openClientFile(fileName: string, fileContent?: string) { this.openOrUpdateConfiguredProjectForFile(fileName); - const info = this.openFile(fileName, true); + const info = this.openFile(fileName, /*openedByClient*/ true, fileContent); this.addOpenFile(info); this.printProjects(); return info; @@ -1267,7 +1277,7 @@ namespace ts.server { for (const fileName of fileNamesToAdd) { let info = this.getScriptInfo(fileName); if (!info) { - info = this.openFile(fileName, false); + info = this.openFile(fileName, /*openedByClient*/ false); } else { // if the root file was opened by client, it would belong to either @@ -1316,7 +1326,9 @@ namespace ts.server { this.setCompilerOptions(opt); } else { - this.setCompilerOptions(ts.getDefaultCompilerOptions()); + const defaultOpts = ts.getDefaultCompilerOptions(); + defaultOpts.allowNonTsExtensions = true; + this.setCompilerOptions(defaultOpts); } this.languageService = ts.createLanguageService(this.host, this.documentRegistry); this.classifier = ts.createClassifier(); diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index ad1fc5e92de..3a669753323 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -513,6 +513,11 @@ declare namespace ts.server.protocol { * Information found in an "open" request. */ export interface OpenRequestArgs extends FileRequestArgs { + /** + * Used when a version of the file content is known to be more up to date than the one on disk. + * Then the known content will be used upon opening instead of the disk copy + */ + fileContent?: string; } /** diff --git a/src/server/session.ts b/src/server/session.ts index 770256cc9f7..dae2384ce54 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -532,9 +532,13 @@ namespace ts.server { }; } - private openClientFile(fileName: string) { + /** + * @param fileName is the name of the file to be opened + * @param fileContent is a version of the file content that is known to be more up to date than the one on disk + */ + private openClientFile(fileName: string, fileContent?: string) { const file = ts.normalizePath(fileName); - this.projectService.openClientFile(file); + this.projectService.openClientFile(file, fileContent); } private getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody { @@ -897,7 +901,7 @@ namespace ts.server { } getDiagnosticsForProject(delay: number, fileName: string) { - const { configFileName, fileNames } = this.getProjectInfo(fileName, true); + const { configFileName, fileNames } = this.getProjectInfo(fileName, /*needFileNameList*/ true); // No need to analyze lib.d.ts let fileNamesInProject = fileNames.filter((value, index, array) => value.indexOf("lib.d.ts") < 0); @@ -968,7 +972,7 @@ namespace ts.server { }, [CommandNames.Open]: (request: protocol.Request) => { const openArgs = request.arguments; - this.openClientFile(openArgs.file); + this.openClientFile(openArgs.file, openArgs.fileContent); return {responseRequired: false}; }, [CommandNames.Quickinfo]: (request: protocol.Request) => { diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index 19185cdf78d..1afde613618 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -14,7 +14,7 @@ namespace ts.formatting { constructor(from: SyntaxKind, to: SyntaxKind, except: SyntaxKind[]) { this.tokens = []; for (let token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { + if (ts.indexOf(except, token) < 0) { this.tokens.push(token); } } @@ -123,4 +123,4 @@ namespace ts.formatting { static TypeNames = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.SymbolKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]); } } -} \ No newline at end of file +} diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index e822052a5b2..46ec807a881 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -2,7 +2,7 @@ /* @internal */ namespace ts.NavigationBar { - export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] { + export function getNavigationBarItems(sourceFile: SourceFile, compilerOptions: CompilerOptions): ts.NavigationBarItem[] { // If the source file has any child items, then it included in the tree // and takes lexical ownership of all other top-level items. let hasGlobalNode = false; diff --git a/src/services/services.ts b/src/services/services.ts index 113a52459e9..8d66b5c7b8a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -132,43 +132,43 @@ namespace ts { let scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); let emptyArray: any[] = []; - + const jsDocTagNames = [ - "augments", - "author", - "argument", - "borrows", - "class", - "constant", - "constructor", - "constructs", - "default", - "deprecated", - "description", - "event", - "example", - "extends", - "field", - "fileOverview", - "function", - "ignore", - "inner", - "lends", - "link", - "memberOf", - "name", - "namespace", - "param", - "private", - "property", - "public", - "requires", - "returns", - "see", - "since", - "static", - "throws", - "type", + "augments", + "author", + "argument", + "borrows", + "class", + "constant", + "constructor", + "constructs", + "default", + "deprecated", + "description", + "event", + "example", + "extends", + "field", + "fileOverview", + "function", + "ignore", + "inner", + "lends", + "link", + "memberOf", + "name", + "namespace", + "param", + "private", + "property", + "public", + "requires", + "returns", + "see", + "since", + "static", + "throws", + "type", "version" ]; let jsDocCompletionEntries: CompletionEntry[]; @@ -801,6 +801,7 @@ namespace ts { public isDefaultLib: boolean; public hasNoDefaultLib: boolean; public externalModuleIndicator: Node; // The first node that causes this file to be an external module + public commonJsModuleIndicator: Node; // The first node that causes this file to be a CommonJS module public nodeCount: number; public identifierCount: number; public symbolCount: number; @@ -816,7 +817,7 @@ namespace ts { constructor(kind: SyntaxKind, pos: number, end: number) { super(kind, pos, end) } - + public update(newText: string, textChangeRange: TextChangeRange): SourceFile { return updateSourceFile(this, newText, textChangeRange); } @@ -1030,7 +1031,7 @@ namespace ts { /* * LS host can optionally implement this method if it wants to be completely in charge of module name resolution. - * if implementation is omitted then language service will use built-in module resolution logic and get answers to + * if implementation is omitted then language service will use built-in module resolution logic and get answers to * host specific questions using 'getScriptSnapshot'. */ resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[]; @@ -1611,6 +1612,9 @@ namespace ts { public static typeAliasName = "type alias name"; public static parameterName = "parameter name"; public static docCommentTagName = "doc comment tag name"; + public static jsxOpenTagName = "jsx open tag name"; + public static jsxCloseTagName = "jsx close tag name"; + public static jsxSelfClosingTagName = "jsx self closing tag name"; } export const enum ClassificationType { @@ -1632,6 +1636,9 @@ namespace ts { typeAliasName = 16, parameterName = 17, docCommentTagName = 18, + jsxOpenTagName = 19, + jsxCloseTagName = 20, + jsxSelfClosingTagName = 21, } /// Language Service @@ -1854,7 +1861,7 @@ namespace ts { * - allowNonTsExtensions = true * - noLib = true * - noResolve = true - */ + */ export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput { let options = transpileOptions.compilerOptions ? clone(transpileOptions.compilerOptions) : getDefaultCompilerOptions(); @@ -2016,7 +2023,7 @@ namespace ts { let getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings: CompilerOptions): string { - return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx; + return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): FileMap { @@ -2124,7 +2131,7 @@ namespace ts { }; } - export function preProcessFile(sourceText: string, readImportFiles = true): PreProcessedFileInfo { + export function preProcessFile(sourceText: string, readImportFiles = true, detectJavaScriptImports = false): PreProcessedFileInfo { let referencedFiles: FileReference[] = []; let importedFiles: FileReference[] = []; let ambientExternalModules: string[]; @@ -2162,9 +2169,225 @@ namespace ts { }); } - function processImport(): void { + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeDeclare(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.DeclareKeyword) { + // declare module "mod" + token = scanner.scan(); + if (token === SyntaxKind.ModuleKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + recordAmbientExternalModule(); + } + } + return true; + } + + return false; + } + + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeImport(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.ImportKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // import "mod"; + recordModuleName(); + return true; + } + else { + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = scanner.scan(); + if (token === SyntaxKind.FromKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // import d from "mod"; + recordModuleName(); + return true; + } + } + else if (token === SyntaxKind.EqualsToken) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + else if (token === SyntaxKind.CommaToken) { + // consume comma and keep going + token = scanner.scan(); + } + else { + // unknown syntax + return true; + } + } + + if (token === SyntaxKind.OpenBraceToken) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure that it stops on EOF + while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { + token = scanner.scan(); + } + + if (token === SyntaxKind.CloseBraceToken) { + token = scanner.scan(); + if (token === SyntaxKind.FromKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === SyntaxKind.AsteriskToken) { + token = scanner.scan(); + if (token === SyntaxKind.AsKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = scanner.scan(); + if (token === SyntaxKind.FromKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // import * as NS from "mod" + // import d, * as NS from "mod" + recordModuleName(); + } + } + } + } + } + } + + return true; + } + + return false; + } + + function tryConsumeExport(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.ExportKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.OpenBraceToken) { + token = scanner.scan(); + // consume "{ a as B, c, d as D}" clauses + // make sure it stops on EOF + while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { + token = scanner.scan(); + } + + if (token === SyntaxKind.CloseBraceToken) { + token = scanner.scan(); + if (token === SyntaxKind.FromKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === SyntaxKind.AsteriskToken) { + token = scanner.scan(); + if (token === SyntaxKind.FromKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // export * from "mod" + recordModuleName(); + } + } + } + else if (token === SyntaxKind.ImportKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = scanner.scan(); + if (token === SyntaxKind.EqualsToken) { + if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + return true; + } + } + } + } + + return true; + } + + return false; + } + + function tryConsumeRequireCall(skipCurrentToken: boolean): boolean { + let token = skipCurrentToken ? scanner.scan() : scanner.getToken(); + if (token === SyntaxKind.RequireKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.OpenParenToken) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // require("mod"); + recordModuleName(); + } + } + return true; + } + return false; + } + + function tryConsumeDefine(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.Identifier && scanner.getTokenValue() === "define") { + token = scanner.scan(); + if (token !== SyntaxKind.OpenParenToken) { + return true; + } + + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + // looks like define ("modname", ... - skip string literal and comma + token = scanner.scan(); + if (token === SyntaxKind.CommaToken) { + token = scanner.scan(); + } + else { + // unexpected token + return true; + } + } + + // should be start of dependency list + if (token !== SyntaxKind.OpenBracketToken) { + return true; + } + + // skip open bracket + token = scanner.scan(); + let i = 0; + // scan until ']' or EOF + while (token !== SyntaxKind.CloseBracketToken && token !== SyntaxKind.EndOfFileToken) { + // record string literals as module names + if (token === SyntaxKind.StringLiteral) { + recordModuleName(); + i++; + } + + token = scanner.scan(); + } + return true; + + } + return false; + } + + function processImports(): void { scanner.setText(sourceText); - let token = scanner.scan(); + scanner.scan(); // Look for: // import "mod"; // import d from "mod" @@ -2176,157 +2399,30 @@ namespace ts { // export * from "mod" // export {a as b} from "mod" // export import i = require("mod") + // (for JavaScript files) require("mod") - while (token !== SyntaxKind.EndOfFileToken) { - if (token === SyntaxKind.DeclareKeyword) { - // declare module "mod" - token = scanner.scan(); - if (token === SyntaxKind.ModuleKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - recordAmbientExternalModule(); - continue; - } - } + while (true) { + if (scanner.getToken() === SyntaxKind.EndOfFileToken) { + break; } - else if (token === SyntaxKind.ImportKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // import "mod"; - recordModuleName(); - continue; - } - else { - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = scanner.scan(); - if (token === SyntaxKind.FromKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // import d from "mod"; - recordModuleName(); - continue - } - } - else if (token === SyntaxKind.EqualsToken) { - token = scanner.scan(); - if (token === SyntaxKind.RequireKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.OpenParenToken) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // import i = require("mod"); - recordModuleName(); - continue; - } - } - } - } - else if (token === SyntaxKind.CommaToken) { - // consume comma and keep going - token = scanner.scan(); - } - else { - // unknown syntax - continue; - } - } - if (token === SyntaxKind.OpenBraceToken) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== SyntaxKind.CloseBraceToken) { - token = scanner.scan(); - } - - if (token === SyntaxKind.CloseBraceToken) { - token = scanner.scan(); - if (token === SyntaxKind.FromKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // import {a as A} from "mod"; - // import d, {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === SyntaxKind.AsteriskToken) { - token = scanner.scan(); - if (token === SyntaxKind.AsKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = scanner.scan(); - if (token === SyntaxKind.FromKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // import * as NS from "mod" - // import d, * as NS from "mod" - recordModuleName(); - } - } - } - } - } - } + // check if at least one of alternative have moved scanner forward + if (tryConsumeDeclare() || + tryConsumeImport() || + tryConsumeExport() || + (detectJavaScriptImports && (tryConsumeRequireCall(/* skipCurrentToken */ false) || tryConsumeDefine()))) { + continue; } - else if (token === SyntaxKind.ExportKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.OpenBraceToken) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== SyntaxKind.CloseBraceToken) { - token = scanner.scan(); - } - - if (token === SyntaxKind.CloseBraceToken) { - token = scanner.scan(); - if (token === SyntaxKind.FromKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // export {a as A} from "mod"; - // export {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === SyntaxKind.AsteriskToken) { - token = scanner.scan(); - if (token === SyntaxKind.FromKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // export * from "mod" - recordModuleName(); - } - } - } - else if (token === SyntaxKind.ImportKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = scanner.scan(); - if (token === SyntaxKind.EqualsToken) { - token = scanner.scan(); - if (token === SyntaxKind.RequireKeyword) { - token = scanner.scan(); - if (token === SyntaxKind.OpenParenToken) { - token = scanner.scan(); - if (token === SyntaxKind.StringLiteral) { - // export import i = require("mod"); - recordModuleName(); - } - } - } - } - } - } + else { + scanner.scan(); } - token = scanner.scan(); } + scanner.setText(undefined); } if (readImportFiles) { - processImport(); + processImports(); } processTripleSlashDirectives(); return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules }; @@ -2574,7 +2670,7 @@ namespace ts { } } - export function createLanguageService(host: LanguageServiceHost, + export function createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory())): LanguageService { let syntaxTreeCache: SyntaxTreeCache = new SyntaxTreeCache(host); @@ -2650,7 +2746,8 @@ namespace ts { (oldSettings.target !== newSettings.target || oldSettings.module !== newSettings.module || oldSettings.noResolve !== newSettings.noResolve || - oldSettings.jsx !== newSettings.jsx); + oldSettings.jsx !== newSettings.jsx || + oldSettings.allowJs !== newSettings.allowJs); // Now create a new compiler let compilerHost: CompilerHost = { @@ -2662,10 +2759,10 @@ namespace ts { getDefaultLibFileName: (options) => host.getDefaultLibFileName(options), writeFile: (fileName, data, writeByteOrderMark) => { }, getCurrentDirectory: () => currentDirectory, - fileExists: (fileName): boolean => { + fileExists: (fileName): boolean => { // stub missing host functionality Debug.assert(!host.resolveModuleNames); - return hostCache.getOrCreateEntry(fileName) !== undefined; + return hostCache.getOrCreateEntry(fileName) !== undefined; }, readFile: (fileName): string => { // stub missing host functionality @@ -2751,8 +2848,11 @@ namespace ts { } function sourceFileUpToDate(sourceFile: SourceFile): boolean { + if (!sourceFile) { + return false; + } let path = sourceFile.path || toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName); - return sourceFile && sourceFile.version === hostCache.getVersion(path); + return sourceFile.version === hostCache.getVersion(path); } function programUpToDate(): boolean { @@ -2812,13 +2912,6 @@ namespace ts { let targetSourceFile = getValidSourceFile(fileName); - // For JavaScript files, we don't want to report the normal typescript semantic errors. - // Instead, we just report errors for using TypeScript-only constructs from within a - // JavaScript file. - if (isJavaScript(fileName)) { - return getJavaScriptSemanticDiagnostics(targetSourceFile); - } - // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. // Therefore only get diagnostics for given file. @@ -2832,163 +2925,6 @@ namespace ts { return concatenate(semanticDiagnostics, declarationDiagnostics); } - function getJavaScriptSemanticDiagnostics(sourceFile: SourceFile): Diagnostic[] { - let diagnostics: Diagnostic[] = []; - walk(sourceFile); - - return diagnostics; - - function walk(node: Node): boolean { - if (!node) { - return false; - } - - switch (node.kind) { - case SyntaxKind.ImportEqualsDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.import_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.ExportAssignment: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.export_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.ClassDeclaration: - let classDeclaration = node; - if (checkModifiers(classDeclaration.modifiers) || - checkTypeParameters(classDeclaration.typeParameters)) { - return true; - } - break; - case SyntaxKind.HeritageClause: - let heritageClause = node; - if (heritageClause.token === SyntaxKind.ImplementsKeyword) { - diagnostics.push(createDiagnosticForNode(node, Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case SyntaxKind.InterfaceDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.ModuleDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.TypeAliasDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.FunctionExpression: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ArrowFunction: - case SyntaxKind.FunctionDeclaration: - let functionDeclaration = node; - if (checkModifiers(functionDeclaration.modifiers) || - checkTypeParameters(functionDeclaration.typeParameters) || - checkTypeAnnotation(functionDeclaration.type)) { - return true; - } - break; - case SyntaxKind.VariableStatement: - let variableStatement = node; - if (checkModifiers(variableStatement.modifiers)) { - return true; - } - break; - case SyntaxKind.VariableDeclaration: - let variableDeclaration = node; - if (checkTypeAnnotation(variableDeclaration.type)) { - return true; - } - break; - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: - let expression = node; - if (expression.typeArguments && expression.typeArguments.length > 0) { - let start = expression.typeArguments.pos; - diagnostics.push(createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, - Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case SyntaxKind.Parameter: - let parameter = node; - if (parameter.modifiers) { - let start = parameter.modifiers.pos; - diagnostics.push(createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, - Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); - return true; - } - if (parameter.questionToken) { - diagnostics.push(createDiagnosticForNode(parameter.questionToken, Diagnostics._0_can_only_be_used_in_a_ts_file, '?')); - return true; - } - if (parameter.type) { - diagnostics.push(createDiagnosticForNode(parameter.type, Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case SyntaxKind.PropertyDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.EnumDeclaration: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.TypeAssertionExpression: - let typeAssertionExpression = node; - diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); - return true; - case SyntaxKind.Decorator: - diagnostics.push(createDiagnosticForNode(node, Diagnostics.decorators_can_only_be_used_in_a_ts_file)); - return true; - } - - return forEachChild(node, walk); - } - - function checkTypeParameters(typeParameters: NodeArray): boolean { - if (typeParameters) { - let start = typeParameters.pos; - diagnostics.push(createFileDiagnostic(sourceFile, start, typeParameters.end - start, Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - - function checkTypeAnnotation(type: TypeNode): boolean { - if (type) { - diagnostics.push(createDiagnosticForNode(type, Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - - return false; - } - - function checkModifiers(modifiers: ModifiersArray): boolean { - if (modifiers) { - for (let modifier of modifiers) { - switch (modifier.kind) { - case SyntaxKind.PublicKeyword: - case SyntaxKind.PrivateKeyword: - case SyntaxKind.ProtectedKeyword: - case SyntaxKind.DeclareKeyword: - diagnostics.push(createDiagnosticForNode(modifier, Diagnostics._0_can_only_be_used_in_a_ts_file, tokenToString(modifier.kind))); - return true; - - // These are all legal modifiers. - case SyntaxKind.StaticKeyword: - case SyntaxKind.ExportKeyword: - case SyntaxKind.ConstKeyword: - case SyntaxKind.DefaultKeyword: - case SyntaxKind.AbstractKeyword: - } - } - } - - return false; - } - } - function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat( @@ -3054,7 +2990,7 @@ namespace ts { let typeChecker = program.getTypeChecker(); let syntacticStart = new Date().getTime(); let sourceFile = getValidSourceFile(fileName); - let isJavaScriptFile = isJavaScript(fileName); + let isJavaScriptFile = isSourceFileJavaScript(sourceFile); let isJsDocTagName = false; @@ -3068,7 +3004,7 @@ namespace ts { log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. + // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names if (hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === CharacterCodes.at) { isJsDocTagName = true; @@ -3101,7 +3037,7 @@ namespace ts { } if (!insideJsDocTagExpression) { - // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal + // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); return undefined; @@ -3622,8 +3558,8 @@ namespace ts { case SyntaxKind.CloseBraceToken: if (parent && - parent.kind === SyntaxKind.JsxExpression && - parent.parent && + parent.kind === SyntaxKind.JsxExpression && + parent.parent && (parent.parent.kind === SyntaxKind.JsxAttribute)) { return parent.parent.parent; } @@ -3672,7 +3608,7 @@ namespace ts { containingNodeKind === SyntaxKind.InterfaceDeclaration || // interface Am).propertyName) { - existingName = (m).propertyName.text; + // include only identifiers in completion list + if ((m).propertyName.kind === SyntaxKind.Identifier) { + existingName = ((m).propertyName).text + } } else { // TODO(jfreeman): Account for computed property name @@ -3875,22 +3814,25 @@ namespace ts { let { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot, isJsDocTagName } = completionData; - let entries: CompletionEntry[]; if (isJsDocTagName) { // If the current position is a jsDoc tag name, only tag names should be provided for completion return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() }; } - if (isRightOfDot && isJavaScript(fileName)) { - entries = getCompletionEntriesFromSymbols(symbols); - addRange(entries, getJavaScriptCompletionEntries()); + let sourceFile = getValidSourceFile(fileName); + + let entries: CompletionEntry[] = []; + + if (isRightOfDot && isSourceFileJavaScript(sourceFile)) { + const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries); + addRange(entries, getJavaScriptCompletionEntries(sourceFile, uniqueNames)); } else { if (!symbols || symbols.length === 0) { return undefined; } - entries = getCompletionEntriesFromSymbols(symbols); + getCompletionEntriesFromSymbols(symbols, entries); } // Add keywords if this is not a member completion list @@ -3900,26 +3842,23 @@ namespace ts { return { isMemberCompletion, isNewIdentifierLocation, entries }; - function getJavaScriptCompletionEntries(): CompletionEntry[] { + function getJavaScriptCompletionEntries(sourceFile: SourceFile, uniqueNames: Map): CompletionEntry[] { let entries: CompletionEntry[] = []; - let allNames: Map = {}; let target = program.getCompilerOptions().target; - for (let sourceFile of program.getSourceFiles()) { - let nameTable = getNameTable(sourceFile); - for (let name in nameTable) { - if (!allNames[name]) { - allNames[name] = name; - let displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks:*/ true); - if (displayName) { - let entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } + let nameTable = getNameTable(sourceFile); + for (let name in nameTable) { + if (!uniqueNames[name]) { + uniqueNames[name] = name; + let displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks:*/ true); + if (displayName) { + let entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); } } } @@ -3963,26 +3902,24 @@ namespace ts { }; } - function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] { + function getCompletionEntriesFromSymbols(symbols: Symbol[], entries: CompletionEntry[]): Map { let start = new Date().getTime(); - let entries: CompletionEntry[] = []; - + let uniqueNames: Map = {}; if (symbols) { - let nameToSymbol: Map = {}; for (let symbol of symbols) { let entry = createCompletionEntry(symbol, location); if (entry) { let id = escapeIdentifier(entry.name); - if (!lookUp(nameToSymbol, id)) { + if (!lookUp(uniqueNames, id)) { entries.push(entry); - nameToSymbol[id] = symbol; + uniqueNames[id] = id; } } } } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); - return entries; + return uniqueNames; } } @@ -4504,6 +4441,7 @@ namespace ts { case SyntaxKind.PropertyAccessExpression: case SyntaxKind.QualifiedName: case SyntaxKind.ThisKeyword: + case SyntaxKind.ThisType: case SyntaxKind.SuperKeyword: // For the identifiers/this/super etc get the type at position let type = typeChecker.getTypeAtLocation(node); @@ -4775,6 +4713,7 @@ namespace ts { function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] { if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || + node.kind === SyntaxKind.ThisType || node.kind === SyntaxKind.SuperKeyword || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -4906,7 +4845,7 @@ namespace ts { } break; default: - if (isModifier(node.kind) && node.parent && + if (isModifierKind(node.kind) && node.parent && (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { return getModifierOccurrences(node.kind, node.parent); } @@ -5470,7 +5409,7 @@ namespace ts { } } - if (node.kind === SyntaxKind.ThisKeyword) { + if (node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.ThisType) { return getReferencesForThisKeyword(node, sourceFiles); } @@ -5952,7 +5891,7 @@ namespace ts { cancellationToken.throwIfCancellationRequested(); let node = getTouchingWord(sourceFile, position); - if (!node || node.kind !== SyntaxKind.ThisKeyword) { + if (!node || (node.kind !== SyntaxKind.ThisKeyword && node.kind !== SyntaxKind.ThisType)) { return; } @@ -6314,7 +6253,8 @@ namespace ts { return node.parent.kind === SyntaxKind.TypeReference || (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - node.kind === SyntaxKind.ThisKeyword && !isExpression(node); + (node.kind === SyntaxKind.ThisKeyword && !isExpression(node)) || + node.kind === SyntaxKind.ThisType; } function isNamespaceReference(node: Node): boolean { @@ -6434,6 +6374,7 @@ namespace ts { case SyntaxKind.NullKeyword: case SyntaxKind.SuperKeyword: case SyntaxKind.ThisKeyword: + case SyntaxKind.ThisType: case SyntaxKind.Identifier: break; @@ -6481,7 +6422,7 @@ namespace ts { function getNavigationBarItems(fileName: string): NavigationBarItem[] { let sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return NavigationBar.getNavigationBarItems(sourceFile); + return NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings()); } function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { @@ -6619,6 +6560,9 @@ namespace ts { case ClassificationType.typeAliasName: return ClassificationTypeNames.typeAliasName; case ClassificationType.parameterName: return ClassificationTypeNames.parameterName; case ClassificationType.docCommentTagName: return ClassificationTypeNames.docCommentTagName; + case ClassificationType.jsxOpenTagName: return ClassificationTypeNames.jsxOpenTagName; + case ClassificationType.jsxCloseTagName: return ClassificationTypeNames.jsxCloseTagName; + case ClassificationType.jsxSelfClosingTagName: return ClassificationTypeNames.jsxSelfClosingTagName; } } @@ -6931,6 +6875,23 @@ namespace ts { } return; + case SyntaxKind.JsxOpeningElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxOpenTagName; + } + return; + + case SyntaxKind.JsxClosingElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxCloseTagName; + } + return; + + case SyntaxKind.JsxSelfClosingElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxSelfClosingTagName; + } + return; } } diff --git a/src/services/shims.ts b/src/services/shims.ts index fca72e49d36..6b656ea2738 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -956,7 +956,8 @@ namespace ts { return this.forwardJSONCall( "getPreProcessedFileInfo('" + fileName + "')", () => { - var result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + // for now treat files as JavaScript + var result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); var convertResult = { referencedFiles: [], importedFiles: [], diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index df321647e5c..02e36e185a5 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -204,7 +204,7 @@ namespace ts.SignatureHelp { if (!candidates.length) { // We didn't have any sig help items produced by the TS compiler. If this is a JS // file, then see if we can figure out anything better. - if (isJavaScript(sourceFile.fileName)) { + if (isSourceFileJavaScript(sourceFile)) { return createJavaScriptSignatureHelpItems(argumentInfo); } diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.js b/tests/baselines/reference/ambientClassDeclarationWithExtends.js index 5fd4d5b4b28..940efb8899f 100644 --- a/tests/baselines/reference/ambientClassDeclarationWithExtends.js +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.js @@ -1,6 +1,40 @@ -//// [ambientClassDeclarationWithExtends.ts] +//// [tests/cases/compiler/ambientClassDeclarationWithExtends.ts] //// + +//// [ambientClassDeclarationExtends_singleFile.ts] declare class A { } declare class B extends A { } + +declare class C { + public foo; +} +namespace D { var x; } +declare class D extends C { } + +var d: C = new D(); + +//// [ambientClassDeclarationExtends_file1.ts] + +declare class E { + public bar; +} +namespace F { var y; } + +//// [ambientClassDeclarationExtends_file2.ts] + +declare class F extends E { } +var f: E = new F(); -//// [ambientClassDeclarationWithExtends.js] +//// [ambientClassDeclarationExtends_singleFile.js] +var D; +(function (D) { + var x; +})(D || (D = {})); +var d = new D(); +//// [ambientClassDeclarationExtends_file1.js] +var F; +(function (F) { + var y; +})(F || (F = {})); +//// [ambientClassDeclarationExtends_file2.js] +var f = new F(); diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols index 71d1e1a66d8..023ae6bf582 100644 --- a/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols @@ -1,8 +1,50 @@ -=== tests/cases/compiler/ambientClassDeclarationWithExtends.ts === +=== tests/cases/compiler/ambientClassDeclarationExtends_singleFile.ts === declare class A { } ->A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0)) +>A : Symbol(A, Decl(ambientClassDeclarationExtends_singleFile.ts, 0, 0)) declare class B extends A { } ->B : Symbol(B, Decl(ambientClassDeclarationWithExtends.ts, 0, 19)) ->A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0)) +>B : Symbol(B, Decl(ambientClassDeclarationExtends_singleFile.ts, 0, 19)) +>A : Symbol(A, Decl(ambientClassDeclarationExtends_singleFile.ts, 0, 0)) + +declare class C { +>C : Symbol(C, Decl(ambientClassDeclarationExtends_singleFile.ts, 1, 29)) + + public foo; +>foo : Symbol(foo, Decl(ambientClassDeclarationExtends_singleFile.ts, 3, 17)) +} +namespace D { var x; } +>D : Symbol(D, Decl(ambientClassDeclarationExtends_singleFile.ts, 5, 1), Decl(ambientClassDeclarationExtends_singleFile.ts, 6, 22)) +>x : Symbol(x, Decl(ambientClassDeclarationExtends_singleFile.ts, 6, 17)) + +declare class D extends C { } +>D : Symbol(D, Decl(ambientClassDeclarationExtends_singleFile.ts, 5, 1), Decl(ambientClassDeclarationExtends_singleFile.ts, 6, 22)) +>C : Symbol(C, Decl(ambientClassDeclarationExtends_singleFile.ts, 1, 29)) + +var d: C = new D(); +>d : Symbol(d, Decl(ambientClassDeclarationExtends_singleFile.ts, 9, 3)) +>C : Symbol(C, Decl(ambientClassDeclarationExtends_singleFile.ts, 1, 29)) +>D : Symbol(D, Decl(ambientClassDeclarationExtends_singleFile.ts, 5, 1), Decl(ambientClassDeclarationExtends_singleFile.ts, 6, 22)) + +=== tests/cases/compiler/ambientClassDeclarationExtends_file1.ts === + +declare class E { +>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0)) + + public bar; +>bar : Symbol(bar, Decl(ambientClassDeclarationExtends_file1.ts, 1, 17)) +} +namespace F { var y; } +>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0)) +>y : Symbol(y, Decl(ambientClassDeclarationExtends_file1.ts, 4, 17)) + +=== tests/cases/compiler/ambientClassDeclarationExtends_file2.ts === + +declare class F extends E { } +>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0)) +>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0)) + +var f: E = new F(); +>f : Symbol(f, Decl(ambientClassDeclarationExtends_file2.ts, 2, 3)) +>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0)) +>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0)) diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.types b/tests/baselines/reference/ambientClassDeclarationWithExtends.types index 7609856882b..c7f22eeb65f 100644 --- a/tests/baselines/reference/ambientClassDeclarationWithExtends.types +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/ambientClassDeclarationWithExtends.ts === +=== tests/cases/compiler/ambientClassDeclarationExtends_singleFile.ts === declare class A { } >A : A @@ -6,3 +6,47 @@ declare class B extends A { } >B : B >A : A +declare class C { +>C : C + + public foo; +>foo : any +} +namespace D { var x; } +>D : typeof D +>x : any + +declare class D extends C { } +>D : D +>C : C + +var d: C = new D(); +>d : C +>C : C +>new D() : D +>D : typeof D + +=== tests/cases/compiler/ambientClassDeclarationExtends_file1.ts === + +declare class E { +>E : E + + public bar; +>bar : any +} +namespace F { var y; } +>F : typeof F +>y : any + +=== tests/cases/compiler/ambientClassDeclarationExtends_file2.ts === + +declare class F extends E { } +>F : F +>E : E + +var f: E = new F(); +>f : E +>E : E +>new F() : F +>F : typeof F + diff --git a/tests/baselines/reference/callSignatureFunctionOverload.types b/tests/baselines/reference/callSignatureFunctionOverload.types index b9788e5b143..d5897c01494 100644 --- a/tests/baselines/reference/callSignatureFunctionOverload.types +++ b/tests/baselines/reference/callSignatureFunctionOverload.types @@ -1,33 +1,33 @@ === tests/cases/compiler/callSignatureFunctionOverload.ts === var foo: { ->foo : { (name: string): string; (name: 'order'): string; (name: 'content'): string; (name: 'done'): string; } +>foo : { (name: string): string; (name: "order"): string; (name: "content"): string; (name: "done"): string; } (name: string): string; >name : string (name: 'order'): string; ->name : 'order' +>name : "order" (name: 'content'): string; ->name : 'content' +>name : "content" (name: 'done'): string; ->name : 'done' +>name : "done" } var foo2: { ->foo2 : { (name: string): string; (name: 'order'): string; (name: 'order'): string; (name: 'done'): string; } +>foo2 : { (name: string): string; (name: "order"): string; (name: "order"): string; (name: "done"): string; } (name: string): string; >name : string (name: 'order'): string; ->name : 'order' +>name : "order" (name: 'order'): string; ->name : 'order' +>name : "order" (name: 'done'): string; ->name : 'done' +>name : "done" } diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js new file mode 100644 index 00000000000..64ea4e67fa8 --- /dev/null +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js @@ -0,0 +1,27 @@ +//// [checkSwitchStatementIfCaseTypeIsString.ts] +declare function use(a: any): void; + +class A { + doIt(x: Array): void { + x.forEach((v) => { + switch(v) { + case "test": use(this); + } + }); + } +} + +//// [checkSwitchStatementIfCaseTypeIsString.js] +var A = (function () { + function A() { + } + A.prototype.doIt = function (x) { + var _this = this; + x.forEach(function (v) { + switch (v) { + case "test": use(_this); + } + }); + }; + return A; +})(); diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.symbols b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.symbols new file mode 100644 index 00000000000..6bc994f2a44 --- /dev/null +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts === +declare function use(a: any): void; +>use : Symbol(use, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 0)) +>a : Symbol(a, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 21)) + +class A { +>A : Symbol(A, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 35)) + + doIt(x: Array): void { +>doIt : Symbol(doIt, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 2, 9)) +>x : Symbol(x, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 3, 9)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + x.forEach((v) => { +>x.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 3, 9)) +>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>v : Symbol(v, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 4, 19)) + + switch(v) { +>v : Symbol(v, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 4, 19)) + + case "test": use(this); +>use : Symbol(use, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 0)) +>this : Symbol(A, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 35)) + } + }); + } +} diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types new file mode 100644 index 00000000000..fa394b4e0bd --- /dev/null +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts === +declare function use(a: any): void; +>use : (a: any) => void +>a : any + +class A { +>A : A + + doIt(x: Array): void { +>doIt : (x: string[]) => void +>x : string[] +>Array : T[] + + x.forEach((v) => { +>x.forEach((v) => { switch(v) { case "test": use(this); } }) : void +>x.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void +>x : string[] +>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void +>(v) => { switch(v) { case "test": use(this); } } : (v: string) => void +>v : string + + switch(v) { +>v : string + + case "test": use(this); +>"test" : string +>use(this) : void +>use : (a: any) => void +>this : this + } + }); + } +} diff --git a/tests/baselines/reference/classdecl.errors.txt b/tests/baselines/reference/classdecl.errors.txt deleted file mode 100644 index e43be2f5ad0..00000000000 --- a/tests/baselines/reference/classdecl.errors.txt +++ /dev/null @@ -1,108 +0,0 @@ -tests/cases/compiler/classdecl.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/classdecl.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/classdecl.ts(18,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/classdecl.ts(24,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== 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() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - return 30; - } - public set d() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - } - - public static get p2() { - ~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - return { x: 30, y: 40 }; - } - - private static d2() { - } - private static get p3() { - ~~ -!!! error TS1056: 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/classdecl.js b/tests/baselines/reference/classdecl.js index 2af85da5b57..b424243c164 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -13,7 +13,7 @@ class a { public get d() { return 30; } - public set d() { + public set d(a: number) { } public static get p2() { @@ -107,7 +107,7 @@ var a = (function () { get: function () { return 30; }, - set: function () { + set: function (a) { }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/classdecl.symbols b/tests/baselines/reference/classdecl.symbols new file mode 100644 index 00000000000..ad355e23517 --- /dev/null +++ b/tests/baselines/reference/classdecl.symbols @@ -0,0 +1,198 @@ +=== tests/cases/compiler/classdecl.ts === +class a { +>a : Symbol(a, Decl(classdecl.ts, 0, 0)) + + //constructor (); + constructor (n: number); +>n : Symbol(n, Decl(classdecl.ts, 2, 17)) + + constructor (s: string); +>s : Symbol(s, Decl(classdecl.ts, 3, 17)) + + constructor (ns: any) { +>ns : Symbol(ns, Decl(classdecl.ts, 4, 17)) + + } + + public pgF() { } +>pgF : Symbol(pgF, Decl(classdecl.ts, 6, 5)) + + public pv; +>pv : Symbol(pv, Decl(classdecl.ts, 8, 20)) + + public get d() { +>d : Symbol(d, Decl(classdecl.ts, 10, 14), Decl(classdecl.ts, 13, 5)) + + return 30; + } + public set d(a: number) { +>d : Symbol(d, Decl(classdecl.ts, 10, 14), Decl(classdecl.ts, 13, 5)) +>a : Symbol(a, Decl(classdecl.ts, 14, 17)) + } + + public static get p2() { +>p2 : Symbol(a.p2, Decl(classdecl.ts, 15, 5)) + + return { x: 30, y: 40 }; +>x : Symbol(x, Decl(classdecl.ts, 18, 16)) +>y : Symbol(y, Decl(classdecl.ts, 18, 23)) + } + + private static d2() { +>d2 : Symbol(a.d2, Decl(classdecl.ts, 19, 5)) + } + private static get p3() { +>p3 : Symbol(a.p3, Decl(classdecl.ts, 22, 5)) + + return "string"; + } + private pv3; +>pv3 : Symbol(pv3, Decl(classdecl.ts, 25, 5)) + + private foo(n: number): string; +>foo : Symbol(foo, Decl(classdecl.ts, 26, 16), Decl(classdecl.ts, 28, 35), Decl(classdecl.ts, 29, 35)) +>n : Symbol(n, Decl(classdecl.ts, 28, 16)) + + private foo(s: string): string; +>foo : Symbol(foo, Decl(classdecl.ts, 26, 16), Decl(classdecl.ts, 28, 35), Decl(classdecl.ts, 29, 35)) +>s : Symbol(s, Decl(classdecl.ts, 29, 16)) + + private foo(ns: any) { +>foo : Symbol(foo, Decl(classdecl.ts, 26, 16), Decl(classdecl.ts, 28, 35), Decl(classdecl.ts, 29, 35)) +>ns : Symbol(ns, Decl(classdecl.ts, 30, 16)) + + return ns.toString(); +>ns : Symbol(ns, Decl(classdecl.ts, 30, 16)) + } +} + +class b extends a { +>b : Symbol(b, Decl(classdecl.ts, 33, 1)) +>a : Symbol(a, Decl(classdecl.ts, 0, 0)) +} + +module m1 { +>m1 : Symbol(m1, Decl(classdecl.ts, 36, 1)) + + export class b { +>b : Symbol(b, Decl(classdecl.ts, 38, 11)) + } + class d { +>d : Symbol(d, Decl(classdecl.ts, 40, 5)) + } + + + export interface ib { +>ib : Symbol(ib, Decl(classdecl.ts, 42, 5)) + } +} + +module m2 { +>m2 : Symbol(m2, Decl(classdecl.ts, 47, 1)) + + export module m3 { +>m3 : Symbol(m3, Decl(classdecl.ts, 49, 11)) + + export class c extends b { +>c : Symbol(c, Decl(classdecl.ts, 51, 22)) +>b : Symbol(b, Decl(classdecl.ts, 33, 1)) + } + export class ib2 implements m1.ib { +>ib2 : Symbol(ib2, Decl(classdecl.ts, 53, 9)) +>m1.ib : Symbol(m1.ib, Decl(classdecl.ts, 42, 5)) +>m1 : Symbol(m1, Decl(classdecl.ts, 36, 1)) +>ib : Symbol(m1.ib, Decl(classdecl.ts, 42, 5)) + } + } +} + +class c extends m1.b { +>c : Symbol(c, Decl(classdecl.ts, 57, 1)) +>m1.b : Symbol(m1.b, Decl(classdecl.ts, 38, 11)) +>m1 : Symbol(m1, Decl(classdecl.ts, 36, 1)) +>b : Symbol(m1.b, Decl(classdecl.ts, 38, 11)) +} + +class ib2 implements m1.ib { +>ib2 : Symbol(ib2, Decl(classdecl.ts, 60, 1)) +>m1.ib : Symbol(m1.ib, Decl(classdecl.ts, 42, 5)) +>m1 : Symbol(m1, Decl(classdecl.ts, 36, 1)) +>ib : Symbol(m1.ib, Decl(classdecl.ts, 42, 5)) +} + +declare class aAmbient { +>aAmbient : Symbol(aAmbient, Decl(classdecl.ts, 63, 1)) + + constructor (n: number); +>n : Symbol(n, Decl(classdecl.ts, 66, 17)) + + constructor (s: string); +>s : Symbol(s, Decl(classdecl.ts, 67, 17)) + + public pgF(): void; +>pgF : Symbol(pgF, Decl(classdecl.ts, 67, 28)) + + public pv; +>pv : Symbol(pv, Decl(classdecl.ts, 68, 23)) + + public d : number; +>d : Symbol(d, Decl(classdecl.ts, 69, 14)) + + static p2 : { x: number; y: number; }; +>p2 : Symbol(aAmbient.p2, Decl(classdecl.ts, 70, 22)) +>x : Symbol(x, Decl(classdecl.ts, 71, 17)) +>y : Symbol(y, Decl(classdecl.ts, 71, 28)) + + static d2(); +>d2 : Symbol(aAmbient.d2, Decl(classdecl.ts, 71, 42)) + + static p3; +>p3 : Symbol(aAmbient.p3, Decl(classdecl.ts, 72, 16)) + + private pv3; +>pv3 : Symbol(pv3, Decl(classdecl.ts, 73, 14)) + + private foo(s); +>foo : Symbol(foo, Decl(classdecl.ts, 74, 16)) +>s : Symbol(s, Decl(classdecl.ts, 75, 16)) +} + +class d { +>d : Symbol(d, Decl(classdecl.ts, 76, 1)) + + private foo(n: number): string; +>foo : Symbol(foo, Decl(classdecl.ts, 78, 9), Decl(classdecl.ts, 79, 35), Decl(classdecl.ts, 80, 35)) +>n : Symbol(n, Decl(classdecl.ts, 79, 16)) + + private foo(s: string): string; +>foo : Symbol(foo, Decl(classdecl.ts, 78, 9), Decl(classdecl.ts, 79, 35), Decl(classdecl.ts, 80, 35)) +>s : Symbol(s, Decl(classdecl.ts, 80, 16)) + + private foo(ns: any) { +>foo : Symbol(foo, Decl(classdecl.ts, 78, 9), Decl(classdecl.ts, 79, 35), Decl(classdecl.ts, 80, 35)) +>ns : Symbol(ns, Decl(classdecl.ts, 81, 16)) + + return ns.toString(); +>ns : Symbol(ns, Decl(classdecl.ts, 81, 16)) + } +} + +class e { +>e : Symbol(e, Decl(classdecl.ts, 84, 1)) + + private foo(s: string): string; +>foo : Symbol(foo, Decl(classdecl.ts, 86, 9), Decl(classdecl.ts, 87, 35), Decl(classdecl.ts, 88, 35)) +>s : Symbol(s, Decl(classdecl.ts, 87, 16)) + + private foo(n: number): string; +>foo : Symbol(foo, Decl(classdecl.ts, 86, 9), Decl(classdecl.ts, 87, 35), Decl(classdecl.ts, 88, 35)) +>n : Symbol(n, Decl(classdecl.ts, 88, 16)) + + private foo(ns: any) { +>foo : Symbol(foo, Decl(classdecl.ts, 86, 9), Decl(classdecl.ts, 87, 35), Decl(classdecl.ts, 88, 35)) +>ns : Symbol(ns, Decl(classdecl.ts, 89, 16)) + + return ns.toString(); +>ns : Symbol(ns, Decl(classdecl.ts, 89, 16)) + } +} diff --git a/tests/baselines/reference/classdecl.types b/tests/baselines/reference/classdecl.types new file mode 100644 index 00000000000..63398736563 --- /dev/null +++ b/tests/baselines/reference/classdecl.types @@ -0,0 +1,212 @@ +=== tests/cases/compiler/classdecl.ts === +class a { +>a : a + + //constructor (); + constructor (n: number); +>n : number + + constructor (s: string); +>s : string + + constructor (ns: any) { +>ns : any + + } + + public pgF() { } +>pgF : () => void + + public pv; +>pv : any + + public get d() { +>d : number + + return 30; +>30 : number + } + public set d(a: number) { +>d : number +>a : number + } + + public static get p2() { +>p2 : { x: number; y: number; } + + return { x: 30, y: 40 }; +>{ x: 30, y: 40 } : { x: number; y: number; } +>x : number +>30 : number +>y : number +>40 : number + } + + private static d2() { +>d2 : () => void + } + private static get p3() { +>p3 : string + + return "string"; +>"string" : string + } + private pv3; +>pv3 : any + + private foo(n: number): string; +>foo : { (n: number): string; (s: string): string; } +>n : number + + private foo(s: string): string; +>foo : { (n: number): string; (s: string): string; } +>s : string + + private foo(ns: any) { +>foo : { (n: number): string; (s: string): string; } +>ns : any + + return ns.toString(); +>ns.toString() : any +>ns.toString : any +>ns : any +>toString : any + } +} + +class b extends a { +>b : b +>a : a +} + +module m1 { +>m1 : typeof m1 + + export class b { +>b : b + } + class d { +>d : d + } + + + export interface ib { +>ib : ib + } +} + +module m2 { +>m2 : typeof m2 + + export module m3 { +>m3 : typeof m3 + + export class c extends b { +>c : c +>b : b + } + export class ib2 implements m1.ib { +>ib2 : ib2 +>m1.ib : any +>m1 : typeof m1 +>ib : m1.ib + } + } +} + +class c extends m1.b { +>c : c +>m1.b : m1.b +>m1 : typeof m1 +>b : typeof m1.b +} + +class ib2 implements m1.ib { +>ib2 : ib2 +>m1.ib : any +>m1 : typeof m1 +>ib : m1.ib +} + +declare class aAmbient { +>aAmbient : aAmbient + + constructor (n: number); +>n : number + + constructor (s: string); +>s : string + + public pgF(): void; +>pgF : () => void + + public pv; +>pv : any + + public d : number; +>d : number + + static p2 : { x: number; y: number; }; +>p2 : { x: number; y: number; } +>x : number +>y : number + + static d2(); +>d2 : () => any + + static p3; +>p3 : any + + private pv3; +>pv3 : any + + private foo(s); +>foo : (s: any) => any +>s : any +} + +class d { +>d : d + + private foo(n: number): string; +>foo : { (n: number): string; (s: string): string; } +>n : number + + private foo(s: string): string; +>foo : { (n: number): string; (s: string): string; } +>s : string + + private foo(ns: any) { +>foo : { (n: number): string; (s: string): string; } +>ns : any + + return ns.toString(); +>ns.toString() : any +>ns.toString : any +>ns : any +>toString : any + } +} + +class e { +>e : e + + private foo(s: string): string; +>foo : { (s: string): string; (n: number): string; } +>s : string + + private foo(n: number): string; +>foo : { (s: string): string; (n: number): string; } +>n : number + + private foo(ns: any) { +>foo : { (s: string): string; (n: number): string; } +>ns : any + + return ns.toString(); +>ns.toString() : any +>ns.toString : any +>ns : any +>toString : any + } +} diff --git a/tests/baselines/reference/commonSourceDir1.js b/tests/baselines/reference/commonSourceDir1.js new file mode 100644 index 00000000000..68833aed49d --- /dev/null +++ b/tests/baselines/reference/commonSourceDir1.js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/commonSourceDir1.ts] //// + +//// [bar.ts] +var x: number; + +//// [baz.ts] +var y: number; + + +//// [bar.js] +var x; +//// [baz.js] +var y; diff --git a/tests/baselines/reference/commonSourceDir1.symbols b/tests/baselines/reference/commonSourceDir1.symbols new file mode 100644 index 00000000000..9248e0c97af --- /dev/null +++ b/tests/baselines/reference/commonSourceDir1.symbols @@ -0,0 +1,8 @@ +=== A:/foo/bar.ts === +var x: number; +>x : Symbol(x, Decl(bar.ts, 0, 3)) + +=== A:/foo/baz.ts === +var y: number; +>y : Symbol(y, Decl(baz.ts, 0, 3)) + diff --git a/tests/baselines/reference/commonSourceDir1.types b/tests/baselines/reference/commonSourceDir1.types new file mode 100644 index 00000000000..6c9864c02cc --- /dev/null +++ b/tests/baselines/reference/commonSourceDir1.types @@ -0,0 +1,8 @@ +=== A:/foo/bar.ts === +var x: number; +>x : number + +=== A:/foo/baz.ts === +var y: number; +>y : number + diff --git a/tests/baselines/reference/commonSourceDir2.errors.txt b/tests/baselines/reference/commonSourceDir2.errors.txt new file mode 100644 index 00000000000..85bcf5d9c72 --- /dev/null +++ b/tests/baselines/reference/commonSourceDir2.errors.txt @@ -0,0 +1,9 @@ +error TS5009: Cannot find the common subdirectory path for the input files. + + +!!! error TS5009: Cannot find the common subdirectory path for the input files. +==== A:/foo/bar.ts (0 errors) ==== + var x: number; + +==== B:/foo/baz.ts (0 errors) ==== + var y: number; \ No newline at end of file diff --git a/tests/baselines/reference/commonSourceDir2.js b/tests/baselines/reference/commonSourceDir2.js new file mode 100644 index 00000000000..cf263b51fb6 --- /dev/null +++ b/tests/baselines/reference/commonSourceDir2.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/commonSourceDir2.ts] //// + +//// [bar.ts] +var x: number; + +//// [baz.ts] +var y: number; + +//// [bar.js] +var x; +//// [baz.js] +var y; diff --git a/tests/baselines/reference/commonSourceDir3.js b/tests/baselines/reference/commonSourceDir3.js new file mode 100644 index 00000000000..0535d51f4bf --- /dev/null +++ b/tests/baselines/reference/commonSourceDir3.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/commonSourceDir3.ts] //// + +//// [bar.ts] +var x: number; + +//// [baz.ts] +var y: number; + +//// [bar.js] +var x; +//// [baz.js] +var y; diff --git a/tests/baselines/reference/commonSourceDir3.symbols b/tests/baselines/reference/commonSourceDir3.symbols new file mode 100644 index 00000000000..b8783523dfd --- /dev/null +++ b/tests/baselines/reference/commonSourceDir3.symbols @@ -0,0 +1,8 @@ +=== A:/foo/bar.ts === +var x: number; +>x : Symbol(x, Decl(bar.ts, 0, 3)) + +=== a:/foo/baz.ts === +var y: number; +>y : Symbol(y, Decl(baz.ts, 0, 3)) + diff --git a/tests/baselines/reference/commonSourceDir3.types b/tests/baselines/reference/commonSourceDir3.types new file mode 100644 index 00000000000..a0b95275897 --- /dev/null +++ b/tests/baselines/reference/commonSourceDir3.types @@ -0,0 +1,8 @@ +=== A:/foo/bar.ts === +var x: number; +>x : number + +=== a:/foo/baz.ts === +var y: number; +>y : number + diff --git a/tests/baselines/reference/commonSourceDir4.errors.txt b/tests/baselines/reference/commonSourceDir4.errors.txt new file mode 100644 index 00000000000..f3493504e4d --- /dev/null +++ b/tests/baselines/reference/commonSourceDir4.errors.txt @@ -0,0 +1,9 @@ +error TS5009: Cannot find the common subdirectory path for the input files. + + +!!! error TS5009: Cannot find the common subdirectory path for the input files. +==== A:/foo/bar.ts (0 errors) ==== + var x: number; + +==== a:/foo/baz.ts (0 errors) ==== + var y: number; \ No newline at end of file diff --git a/tests/baselines/reference/commonSourceDir4.js b/tests/baselines/reference/commonSourceDir4.js new file mode 100644 index 00000000000..2f2af9f68b2 --- /dev/null +++ b/tests/baselines/reference/commonSourceDir4.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/commonSourceDir4.ts] //// + +//// [bar.ts] +var x: number; + +//// [baz.ts] +var y: number; + +//// [bar.js] +var x; +//// [baz.js] +var y; diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline new file mode 100644 index 00000000000..f9bcca268ec --- /dev/null +++ b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline @@ -0,0 +1,8 @@ +EmitSkipped: true +Diagnostics: + Cannot write file 'tests/cases/fourslash/b.js' because it would overwrite input file. + +EmitSkipped: false +FileName : tests/cases/fourslash/a.js +function foo2() { return 30; } // no error - should emit a.js + diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt new file mode 100644 index 00000000000..dc536e544b2 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt @@ -0,0 +1,52 @@ +tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. + + +==== tests/cases/compiler/computedPropertiesInDestructuring1.ts (4 errors) ==== + // destructuring in variable declarations + let foo = "bar"; + let {[foo]: bar} = {bar: "bar"}; + + let {["bar"]: bar2} = {bar: "bar"}; + + let foo2 = () => "bar"; + let {[foo2()]: bar3} = {bar: "bar"}; + + let [{[foo]: bar4}] = [{bar: "bar"}]; + let [{[foo2()]: bar5}] = [{bar: "bar"}]; + + function f1({["bar"]: x}: { bar: number }) {} + function f2({[foo]: x}: { bar: number }) {} + function f3({[foo2()]: x}: { bar: number }) {} + function f4([{[foo]: x}]: [{ bar: number }]) {} + function f5([{[foo2()]: x}]: [{ bar: number }]) {} + + // report errors on type errors in computed properties used in destructuring + let [{[foo()]: bar6}] = [{bar: "bar"}]; + ~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'toExponential' does not exist on type 'string'. + + // destructuring assignment + ({[foo]: bar} = {bar: "bar"}); + + ({["bar"]: bar2} = {bar: "bar"}); + + ({[foo2()]: bar3} = {bar: "bar"}); + + [{[foo]: bar4}] = [{bar: "bar"}]; + [{[foo2()]: bar5}] = [{bar: "bar"}]; + + [{[foo()]: bar4}] = [{bar: "bar"}]; + ~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + [{[(1 + {})]: bar4}] = [{bar: "bar"}]; + ~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.js b/tests/baselines/reference/computedPropertiesInDestructuring1.js new file mode 100644 index 00000000000..0bc4286ed7b --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.js @@ -0,0 +1,75 @@ +//// [computedPropertiesInDestructuring1.ts] +// destructuring in variable declarations +let foo = "bar"; +let {[foo]: bar} = {bar: "bar"}; + +let {["bar"]: bar2} = {bar: "bar"}; + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {bar: "bar"}; + +let [{[foo]: bar4}] = [{bar: "bar"}]; +let [{[foo2()]: bar5}] = [{bar: "bar"}]; + +function f1({["bar"]: x}: { bar: number }) {} +function f2({[foo]: x}: { bar: number }) {} +function f3({[foo2()]: x}: { bar: number }) {} +function f4([{[foo]: x}]: [{ bar: number }]) {} +function f5([{[foo2()]: x}]: [{ bar: number }]) {} + +// report errors on type errors in computed properties used in destructuring +let [{[foo()]: bar6}] = [{bar: "bar"}]; +let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + +// destructuring assignment +({[foo]: bar} = {bar: "bar"}); + +({["bar"]: bar2} = {bar: "bar"}); + +({[foo2()]: bar3} = {bar: "bar"}); + +[{[foo]: bar4}] = [{bar: "bar"}]; +[{[foo2()]: bar5}] = [{bar: "bar"}]; + +[{[foo()]: bar4}] = [{bar: "bar"}]; +[{[(1 + {})]: bar4}] = [{bar: "bar"}]; + + + + +//// [computedPropertiesInDestructuring1.js] +// destructuring in variable declarations +var foo = "bar"; +var _a = foo, bar = { bar: "bar" }[_a]; +var _b = "bar", bar2 = { bar: "bar" }[_b]; +var foo2 = function () { return "bar"; }; +var _c = foo2(), bar3 = { bar: "bar" }[_c]; +var _d = foo, bar4 = [{ bar: "bar" }][0][_d]; +var _e = foo2(), bar5 = [{ bar: "bar" }][0][_e]; +function f1(_a) { + var _b = "bar", x = _a[_b]; +} +function f2(_a) { + var _b = foo, x = _a[_b]; +} +function f3(_a) { + var _b = foo2(), x = _a[_b]; +} +function f4(_a) { + var _b = foo, x = _a[0][_b]; +} +function f5(_a) { + var _b = foo2(), x = _a[0][_b]; +} +// report errors on type errors in computed properties used in destructuring +var _f = foo(), bar6 = [{ bar: "bar" }][0][_f]; +var _g = foo.toExponential(), bar7 = [{ bar: "bar" }][0][_g]; +// destructuring assignment +(_h = { bar: "bar" }, _j = foo, bar = _h[_j], _h); +(_k = { bar: "bar" }, _l = "bar", bar2 = _k[_l], _k); +(_m = { bar: "bar" }, _o = foo2(), bar3 = _m[_o], _m); +_p = foo, bar4 = [{ bar: "bar" }][0][_p]; +_q = foo2(), bar5 = [{ bar: "bar" }][0][_q]; +_r = foo(), bar4 = [{ bar: "bar" }][0][_r]; +_s = (1 + {}), bar4 = [{ bar: "bar" }][0][_s]; +var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt new file mode 100644 index 00000000000..96ab892d1b9 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt @@ -0,0 +1,51 @@ +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,12): error TS2339: Property 'toExponential' does not exist on type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. + + +==== tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts (4 errors) ==== + // destructuring in variable declarations + let foo = "bar"; + let {[foo]: bar} = {bar: "bar"}; + + let {["bar"]: bar2} = {bar: "bar"}; + let {[11]: bar2_1} = {11: "bar"}; + + let foo2 = () => "bar"; + let {[foo2()]: bar3} = {bar: "bar"}; + + let [{[foo]: bar4}] = [{bar: "bar"}]; + let [{[foo2()]: bar5}] = [{bar: "bar"}]; + + function f1({["bar"]: x}: { bar: number }) {} + function f2({[foo]: x}: { bar: number }) {} + function f3({[foo2()]: x}: { bar: number }) {} + function f4([{[foo]: x}]: [{ bar: number }]) {} + function f5([{[foo2()]: x}]: [{ bar: number }]) {} + + // report errors on type errors in computed properties used in destructuring + let [{[foo()]: bar6}] = [{bar: "bar"}]; + ~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'toExponential' does not exist on type 'string'. + + // destructuring assignment + ({[foo]: bar} = {bar: "bar"}); + + ({["bar"]: bar2} = {bar: "bar"}); + + ({[foo2()]: bar3} = {bar: "bar"}); + + [{[foo]: bar4}] = [{bar: "bar"}]; + [{[foo2()]: bar5}] = [{bar: "bar"}]; + + [{[foo()]: bar4}] = [{bar: "bar"}]; + ~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + [{[(1 + {})]: bar4}] = [{bar: "bar"}]; + ~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js new file mode 100644 index 00000000000..e6e19f93b80 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js @@ -0,0 +1,64 @@ +//// [computedPropertiesInDestructuring1_ES6.ts] +// destructuring in variable declarations +let foo = "bar"; +let {[foo]: bar} = {bar: "bar"}; + +let {["bar"]: bar2} = {bar: "bar"}; +let {[11]: bar2_1} = {11: "bar"}; + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {bar: "bar"}; + +let [{[foo]: bar4}] = [{bar: "bar"}]; +let [{[foo2()]: bar5}] = [{bar: "bar"}]; + +function f1({["bar"]: x}: { bar: number }) {} +function f2({[foo]: x}: { bar: number }) {} +function f3({[foo2()]: x}: { bar: number }) {} +function f4([{[foo]: x}]: [{ bar: number }]) {} +function f5([{[foo2()]: x}]: [{ bar: number }]) {} + +// report errors on type errors in computed properties used in destructuring +let [{[foo()]: bar6}] = [{bar: "bar"}]; +let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + +// destructuring assignment +({[foo]: bar} = {bar: "bar"}); + +({["bar"]: bar2} = {bar: "bar"}); + +({[foo2()]: bar3} = {bar: "bar"}); + +[{[foo]: bar4}] = [{bar: "bar"}]; +[{[foo2()]: bar5}] = [{bar: "bar"}]; + +[{[foo()]: bar4}] = [{bar: "bar"}]; +[{[(1 + {})]: bar4}] = [{bar: "bar"}]; + + +//// [computedPropertiesInDestructuring1_ES6.js] +// destructuring in variable declarations +let foo = "bar"; +let { [foo]: bar } = { bar: "bar" }; +let { ["bar"]: bar2 } = { bar: "bar" }; +let { [11]: bar2_1 } = { 11: "bar" }; +let foo2 = () => "bar"; +let { [foo2()]: bar3 } = { bar: "bar" }; +let [{ [foo]: bar4 }] = [{ bar: "bar" }]; +let [{ [foo2()]: bar5 }] = [{ bar: "bar" }]; +function f1({ ["bar"]: x }) { } +function f2({ [foo]: x }) { } +function f3({ [foo2()]: x }) { } +function f4([{ [foo]: x }]) { } +function f5([{ [foo2()]: x }]) { } +// report errors on type errors in computed properties used in destructuring +let [{ [foo()]: bar6 }] = [{ bar: "bar" }]; +let [{ [foo.toExponential()]: bar7 }] = [{ bar: "bar" }]; +// destructuring assignment +({ [foo]: bar } = { bar: "bar" }); +({ ["bar"]: bar2 } = { bar: "bar" }); +({ [foo2()]: bar3 } = { bar: "bar" }); +[{ [foo]: bar4 }] = [{ bar: "bar" }]; +[{ [foo2()]: bar5 }] = [{ bar: "bar" }]; +[{ [foo()]: bar4 }] = [{ bar: "bar" }]; +[{ [(1 + {})]: bar4 }] = [{ bar: "bar" }]; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.js b/tests/baselines/reference/computedPropertiesInDestructuring2.js new file mode 100644 index 00000000000..8579881b775 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.js @@ -0,0 +1,7 @@ +//// [computedPropertiesInDestructuring2.ts] +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {}; + +//// [computedPropertiesInDestructuring2.js] +var foo2 = function () { return "bar"; }; +var _a = foo2(), bar3 = {}[_a]; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.symbols b/tests/baselines/reference/computedPropertiesInDestructuring2.symbols new file mode 100644 index 00000000000..4ae6d5323e1 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/computedPropertiesInDestructuring2.ts === +let foo2 = () => "bar"; +>foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring2.ts, 0, 3)) + +let {[foo2()]: bar3} = {}; +>foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring2.ts, 0, 3)) +>bar3 : Symbol(bar3, Decl(computedPropertiesInDestructuring2.ts, 1, 5)) + diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.types b/tests/baselines/reference/computedPropertiesInDestructuring2.types new file mode 100644 index 00000000000..0fa20662270 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.types @@ -0,0 +1,12 @@ +=== tests/cases/compiler/computedPropertiesInDestructuring2.ts === +let foo2 = () => "bar"; +>foo2 : () => string +>() => "bar" : () => string +>"bar" : string + +let {[foo2()]: bar3} = {}; +>foo2() : string +>foo2 : () => string +>bar3 : any +>{} : {} + diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js new file mode 100644 index 00000000000..e0bd16287ee --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js @@ -0,0 +1,8 @@ +//// [computedPropertiesInDestructuring2_ES6.ts] + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {}; + +//// [computedPropertiesInDestructuring2_ES6.js] +let foo2 = () => "bar"; +let { [foo2()]: bar3 } = {}; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.symbols b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.symbols new file mode 100644 index 00000000000..cd7cfda9844 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/computedPropertiesInDestructuring2_ES6.ts === + +let foo2 = () => "bar"; +>foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring2_ES6.ts, 1, 3)) + +let {[foo2()]: bar3} = {}; +>foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring2_ES6.ts, 1, 3)) +>bar3 : Symbol(bar3, Decl(computedPropertiesInDestructuring2_ES6.ts, 2, 5)) + diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types new file mode 100644 index 00000000000..f0d8b1033c8 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/computedPropertiesInDestructuring2_ES6.ts === + +let foo2 = () => "bar"; +>foo2 : () => string +>() => "bar" : () => string +>"bar" : string + +let {[foo2()]: bar3} = {}; +>foo2() : string +>foo2 : () => string +>bar3 : any +>{} : {} + diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index 87648c1ed80..9dea9cfca93 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : {} +>v : { [0](): void; [""](): void; } +>{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : { [0](): void; [""](): void; } [s]() { }, >s : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 996dfc99fe9..d2faa138980 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : {} +>v : { [0](): void; [""](): void; } +>{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : { [0](): void; [""](): void; } [s]() { }, >s : string diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index 64c0b0bd67e..0917f824770 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -46,16 +46,8 @@ var v = (_a = {}, enumerable: true, configurable: true }), - Object.defineProperty(_a, "", { - set: function (v) { }, - enumerable: true, - configurable: true - }), - Object.defineProperty(_a, 0, { - get: function () { return 0; }, - enumerable: true, - configurable: true - }), + , + , Object.defineProperty(_a, a, { set: function (v) { }, enumerable: true, diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index c3c59c2eb9c..e0787fc3ee7 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : {} +>v : { [0]: number; [""]: any; } +>{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : { [0]: number; [""]: any; } get [s]() { return 0; }, >s : string diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index ef11511baae..8ad31a7c2a1 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : {} +>v : { [0]: number; [""]: any; } +>{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : { [0]: number; [""]: any; } get [s]() { return 0; }, >s : string diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt index 9d07f34f3c4..71f81c27245 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES5.errors.txt @@ -3,15 +3,13 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(6, tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(10,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(11,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(12,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(14,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts (11 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts (9 errors) ==== var s: string; var n: number; var a: any; @@ -32,11 +30,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15 ~~~~ !!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. static [""]: number; - ~~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. [0]: number; - ~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. [a]: number; ~~~ !!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt index f0a2267f8b3..8d8cce7e140 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt @@ -3,15 +3,13 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(6, tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(7,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(9,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(10,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(11,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(12,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(13,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(14,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(15,12): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts (11 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts (9 errors) ==== var s: string; var n: number; var a: any; @@ -32,11 +30,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES6.ts(15 ~~~~ !!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. static [""]: number; - ~~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. [0]: number; - ~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. [a]: number; ~~~ !!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.js b/tests/baselines/reference/computedPropertyNames16_ES5.js index 2c7316e1398..f4d90579d63 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.js +++ b/tests/baselines/reference/computedPropertyNames16_ES5.js @@ -48,16 +48,6 @@ var C = (function () { enumerable: true, configurable: true }); - Object.defineProperty(C, "", { - set: function (v) { }, - enumerable: true, - configurable: true - }); - Object.defineProperty(C.prototype, 0, { - get: function () { return 0; }, - enumerable: true, - configurable: true - }); Object.defineProperty(C.prototype, a, { set: function (v) { }, enumerable: true, diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.js b/tests/baselines/reference/computedPropertyNames36_ES5.js index 5519a6d284c..4bb10ea7543 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.js +++ b/tests/baselines/reference/computedPropertyNames36_ES5.js @@ -27,10 +27,6 @@ var C = (function () { Object.defineProperty(C.prototype, "get1", { // Computed properties get: function () { return new Foo; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(C.prototype, "set1", { set: function (p) { }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.js b/tests/baselines/reference/computedPropertyNames37_ES5.js index 54a7243f3fa..c2a346608fe 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.js +++ b/tests/baselines/reference/computedPropertyNames37_ES5.js @@ -27,10 +27,6 @@ var C = (function () { Object.defineProperty(C.prototype, "get1", { // Computed properties get: function () { return new Foo; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(C.prototype, "set1", { set: function (p) { }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/computedPropertyNames40_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames40_ES5.errors.txt index e8ceef0d581..482978064d1 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames40_ES5.errors.txt @@ -1,7 +1,9 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(8,5): error TS2393: Duplicate function implementation. tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(8,5): error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(9,5): error TS2393: Duplicate function implementation. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -10,7 +12,11 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(8, // Computed properties [""]() { return new Foo } + ~~~~ +!!! error TS2393: Duplicate function implementation. ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'. [""]() { return new Foo2 } + ~~~~ +!!! error TS2393: Duplicate function implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames40_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames40_ES6.errors.txt index 1a032a87b2b..669d0d04e66 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames40_ES6.errors.txt @@ -1,7 +1,9 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts(8,5): error TS2393: Duplicate function implementation. tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts(8,5): error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts(9,5): error TS2393: Duplicate function implementation. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts (3 errors) ==== class Foo { x } class Foo2 { x; y } @@ -10,7 +12,11 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES6.ts(8, // Computed properties [""]() { return new Foo } + ~~~~ +!!! error TS2393: Duplicate function implementation. ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'. [""]() { return new Foo2 } + ~~~~ +!!! error TS2393: Duplicate function implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames42_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames42_ES5.errors.txt index 94153c47aa5..bdb978220a0 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames42_ES5.errors.txt @@ -1,8 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES5.ts(8,5): error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES5.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES5.ts (1 errors) ==== class Foo { x } class Foo2 { x; y } @@ -11,8 +10,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES5.ts(8, // Computed properties [""]: Foo; - ~~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. ~~~~~~~~~~ !!! error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames42_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames42_ES6.errors.txt index 1f4e27d6e81..9feb6ba3d32 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames42_ES6.errors.txt @@ -1,8 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES6.ts(8,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES6.ts(8,5): error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES6.ts (1 errors) ==== class Foo { x } class Foo2 { x; y } @@ -11,8 +10,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames42_ES6.ts(8, // Computed properties [""]: Foo; - ~~~~ -!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. ~~~~~~~~~~ !!! error TS2411: Property '[""]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index c3b7f6a71d0..57026c3c706 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -41,10 +41,6 @@ var D = (function (_super) { Object.defineProperty(D.prototype, "get1", { // Computed properties get: function () { return new Foo; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(D.prototype, "set1", { set: function (p) { }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt index 83855c5f0b7..8baae68f337 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt @@ -1,12 +1,15 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } class C { get ["get1"]() { return new Foo } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } class D extends C { diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt index 963e01ed86b..e329785f4cf 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt @@ -1,12 +1,15 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (2 errors) ==== class Foo { x } class Foo2 { x; y } class C { get ["get1"]() { return new Foo } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } class D extends C { diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index 51baca26586..6984d2e69b8 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : {} +>v : { [0]: number; [""]: number; } +>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [0]: number; [""]: number; } [s]: 0, >s : string diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 05267049517..1fece561f5a 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -9,8 +9,8 @@ var a: any; >a : any var v = { ->v : {} ->{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : {} +>v : { [0]: number; [""]: number; } +>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [0]: number; [""]: number; } [s]: 0, >s : string diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 9470aee8eb6..147b2966509 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts === var v = { ->v : {} ->{ ["hello"]() { debugger; }} : {} +>v : { ["hello"](): void; } +>{ ["hello"]() { debugger; }} : { ["hello"](): void; } ["hello"]() { >"hello" : string diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index c4f02155a95..00334680362 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts === var v = { ->v : {} ->{ ["hello"]() { debugger; }} : {} +>v : { ["hello"](): void; } +>{ ["hello"]() { debugger; }} : { ["hello"](): void; } ["hello"]() { >"hello" : string diff --git a/tests/baselines/reference/constEnumMergingWithValues1.js b/tests/baselines/reference/constEnumMergingWithValues1.js index f47fc227bae..b35c41da4ac 100644 --- a/tests/baselines/reference/constEnumMergingWithValues1.js +++ b/tests/baselines/reference/constEnumMergingWithValues1.js @@ -1,4 +1,4 @@ -//// [constEnumMergingWithValues1.ts] +//// [m1.ts] function foo() {} module foo { @@ -7,7 +7,7 @@ module foo { export = foo -//// [constEnumMergingWithValues1.js] +//// [m1.js] define(["require", "exports"], function (require, exports) { function foo() { } return foo; diff --git a/tests/baselines/reference/constEnumMergingWithValues1.symbols b/tests/baselines/reference/constEnumMergingWithValues1.symbols index 3dd1c80705c..ba655091ded 100644 --- a/tests/baselines/reference/constEnumMergingWithValues1.symbols +++ b/tests/baselines/reference/constEnumMergingWithValues1.symbols @@ -1,16 +1,16 @@ -=== tests/cases/compiler/constEnumMergingWithValues1.ts === +=== tests/cases/compiler/m1.ts === function foo() {} ->foo : Symbol(foo, Decl(constEnumMergingWithValues1.ts, 0, 0), Decl(constEnumMergingWithValues1.ts, 1, 17)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 17)) module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues1.ts, 0, 0), Decl(constEnumMergingWithValues1.ts, 1, 17)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 17)) const enum E { X } ->E : Symbol(E, Decl(constEnumMergingWithValues1.ts, 2, 12)) ->X : Symbol(E.X, Decl(constEnumMergingWithValues1.ts, 3, 18)) +>E : Symbol(E, Decl(m1.ts, 2, 12)) +>X : Symbol(E.X, Decl(m1.ts, 3, 18)) } export = foo ->foo : Symbol(foo, Decl(constEnumMergingWithValues1.ts, 0, 0), Decl(constEnumMergingWithValues1.ts, 1, 17)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 17)) diff --git a/tests/baselines/reference/constEnumMergingWithValues1.types b/tests/baselines/reference/constEnumMergingWithValues1.types index 8d5b15795f7..c5b1a82a5a8 100644 --- a/tests/baselines/reference/constEnumMergingWithValues1.types +++ b/tests/baselines/reference/constEnumMergingWithValues1.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/constEnumMergingWithValues1.ts === +=== tests/cases/compiler/m1.ts === function foo() {} >foo : typeof foo diff --git a/tests/baselines/reference/constEnumMergingWithValues2.js b/tests/baselines/reference/constEnumMergingWithValues2.js index 393ab41fa1f..9641bdf363a 100644 --- a/tests/baselines/reference/constEnumMergingWithValues2.js +++ b/tests/baselines/reference/constEnumMergingWithValues2.js @@ -1,4 +1,4 @@ -//// [constEnumMergingWithValues2.ts] +//// [m1.ts] class foo {} module foo { @@ -7,7 +7,7 @@ module foo { export = foo -//// [constEnumMergingWithValues2.js] +//// [m1.js] define(["require", "exports"], function (require, exports) { var foo = (function () { function foo() { diff --git a/tests/baselines/reference/constEnumMergingWithValues2.symbols b/tests/baselines/reference/constEnumMergingWithValues2.symbols index bfb438a387d..a7744499f49 100644 --- a/tests/baselines/reference/constEnumMergingWithValues2.symbols +++ b/tests/baselines/reference/constEnumMergingWithValues2.symbols @@ -1,16 +1,16 @@ -=== tests/cases/compiler/constEnumMergingWithValues2.ts === +=== tests/cases/compiler/m1.ts === class foo {} ->foo : Symbol(foo, Decl(constEnumMergingWithValues2.ts, 0, 0), Decl(constEnumMergingWithValues2.ts, 1, 12)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 12)) module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues2.ts, 0, 0), Decl(constEnumMergingWithValues2.ts, 1, 12)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 12)) const enum E { X } ->E : Symbol(E, Decl(constEnumMergingWithValues2.ts, 2, 12)) ->X : Symbol(E.X, Decl(constEnumMergingWithValues2.ts, 3, 18)) +>E : Symbol(E, Decl(m1.ts, 2, 12)) +>X : Symbol(E.X, Decl(m1.ts, 3, 18)) } export = foo ->foo : Symbol(foo, Decl(constEnumMergingWithValues2.ts, 0, 0), Decl(constEnumMergingWithValues2.ts, 1, 12)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 12)) diff --git a/tests/baselines/reference/constEnumMergingWithValues2.types b/tests/baselines/reference/constEnumMergingWithValues2.types index dd706ef33a1..ab2372cbae9 100644 --- a/tests/baselines/reference/constEnumMergingWithValues2.types +++ b/tests/baselines/reference/constEnumMergingWithValues2.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/constEnumMergingWithValues2.ts === +=== tests/cases/compiler/m1.ts === class foo {} >foo : foo diff --git a/tests/baselines/reference/constEnumMergingWithValues3.js b/tests/baselines/reference/constEnumMergingWithValues3.js index d28f29f0962..e191dc2d110 100644 --- a/tests/baselines/reference/constEnumMergingWithValues3.js +++ b/tests/baselines/reference/constEnumMergingWithValues3.js @@ -1,4 +1,4 @@ -//// [constEnumMergingWithValues3.ts] +//// [m1.ts] enum foo { A } module foo { @@ -7,7 +7,7 @@ module foo { export = foo -//// [constEnumMergingWithValues3.js] +//// [m1.js] define(["require", "exports"], function (require, exports) { var foo; (function (foo) { diff --git a/tests/baselines/reference/constEnumMergingWithValues3.symbols b/tests/baselines/reference/constEnumMergingWithValues3.symbols index 33e020b5679..816919c6805 100644 --- a/tests/baselines/reference/constEnumMergingWithValues3.symbols +++ b/tests/baselines/reference/constEnumMergingWithValues3.symbols @@ -1,17 +1,17 @@ -=== tests/cases/compiler/constEnumMergingWithValues3.ts === +=== tests/cases/compiler/m1.ts === enum foo { A } ->foo : Symbol(foo, Decl(constEnumMergingWithValues3.ts, 0, 0), Decl(constEnumMergingWithValues3.ts, 1, 14)) ->A : Symbol(foo.A, Decl(constEnumMergingWithValues3.ts, 1, 10)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 14)) +>A : Symbol(foo.A, Decl(m1.ts, 1, 10)) module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues3.ts, 0, 0), Decl(constEnumMergingWithValues3.ts, 1, 14)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 14)) const enum E { X } ->E : Symbol(E, Decl(constEnumMergingWithValues3.ts, 2, 12)) ->X : Symbol(E.X, Decl(constEnumMergingWithValues3.ts, 3, 18)) +>E : Symbol(E, Decl(m1.ts, 2, 12)) +>X : Symbol(E.X, Decl(m1.ts, 3, 18)) } export = foo ->foo : Symbol(foo, Decl(constEnumMergingWithValues3.ts, 0, 0), Decl(constEnumMergingWithValues3.ts, 1, 14)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 1, 14)) diff --git a/tests/baselines/reference/constEnumMergingWithValues3.types b/tests/baselines/reference/constEnumMergingWithValues3.types index df2e8820466..392772860e4 100644 --- a/tests/baselines/reference/constEnumMergingWithValues3.types +++ b/tests/baselines/reference/constEnumMergingWithValues3.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/constEnumMergingWithValues3.ts === +=== tests/cases/compiler/m1.ts === enum foo { A } >foo : foo diff --git a/tests/baselines/reference/constEnumMergingWithValues4.js b/tests/baselines/reference/constEnumMergingWithValues4.js index 7ed8b44dc76..3f4ee67cb48 100644 --- a/tests/baselines/reference/constEnumMergingWithValues4.js +++ b/tests/baselines/reference/constEnumMergingWithValues4.js @@ -1,4 +1,4 @@ -//// [constEnumMergingWithValues4.ts] +//// [m1.ts] module foo { const enum E { X } @@ -11,7 +11,7 @@ module foo { export = foo -//// [constEnumMergingWithValues4.js] +//// [m1.js] define(["require", "exports"], function (require, exports) { var foo; (function (foo) { diff --git a/tests/baselines/reference/constEnumMergingWithValues4.symbols b/tests/baselines/reference/constEnumMergingWithValues4.symbols index 817c9aeeff3..a7135b53d57 100644 --- a/tests/baselines/reference/constEnumMergingWithValues4.symbols +++ b/tests/baselines/reference/constEnumMergingWithValues4.symbols @@ -1,21 +1,21 @@ -=== tests/cases/compiler/constEnumMergingWithValues4.ts === +=== tests/cases/compiler/m1.ts === module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues4.ts, 0, 0), Decl(constEnumMergingWithValues4.ts, 3, 1)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 3, 1)) const enum E { X } ->E : Symbol(E, Decl(constEnumMergingWithValues4.ts, 1, 12)) ->X : Symbol(E.X, Decl(constEnumMergingWithValues4.ts, 2, 18)) +>E : Symbol(E, Decl(m1.ts, 1, 12)) +>X : Symbol(E.X, Decl(m1.ts, 2, 18)) } module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues4.ts, 0, 0), Decl(constEnumMergingWithValues4.ts, 3, 1)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 3, 1)) var x = 1; ->x : Symbol(x, Decl(constEnumMergingWithValues4.ts, 6, 7)) +>x : Symbol(x, Decl(m1.ts, 6, 7)) } export = foo ->foo : Symbol(foo, Decl(constEnumMergingWithValues4.ts, 0, 0), Decl(constEnumMergingWithValues4.ts, 3, 1)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0), Decl(m1.ts, 3, 1)) diff --git a/tests/baselines/reference/constEnumMergingWithValues4.types b/tests/baselines/reference/constEnumMergingWithValues4.types index 3da306fedbf..92d04fc10cc 100644 --- a/tests/baselines/reference/constEnumMergingWithValues4.types +++ b/tests/baselines/reference/constEnumMergingWithValues4.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/constEnumMergingWithValues4.ts === +=== tests/cases/compiler/m1.ts === module foo { >foo : typeof foo diff --git a/tests/baselines/reference/constEnumMergingWithValues5.js b/tests/baselines/reference/constEnumMergingWithValues5.js index 378b11cfd22..610826b52ce 100644 --- a/tests/baselines/reference/constEnumMergingWithValues5.js +++ b/tests/baselines/reference/constEnumMergingWithValues5.js @@ -1,4 +1,4 @@ -//// [constEnumMergingWithValues5.ts] +//// [m1.ts] module foo { const enum E { X } @@ -6,7 +6,7 @@ module foo { export = foo -//// [constEnumMergingWithValues5.js] +//// [m1.js] define(["require", "exports"], function (require, exports) { var foo; (function (foo) { diff --git a/tests/baselines/reference/constEnumMergingWithValues5.symbols b/tests/baselines/reference/constEnumMergingWithValues5.symbols index 6354f64d834..257e1897e5c 100644 --- a/tests/baselines/reference/constEnumMergingWithValues5.symbols +++ b/tests/baselines/reference/constEnumMergingWithValues5.symbols @@ -1,13 +1,13 @@ -=== tests/cases/compiler/constEnumMergingWithValues5.ts === +=== tests/cases/compiler/m1.ts === module foo { ->foo : Symbol(foo, Decl(constEnumMergingWithValues5.ts, 0, 0)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0)) const enum E { X } ->E : Symbol(E, Decl(constEnumMergingWithValues5.ts, 1, 12)) ->X : Symbol(E.X, Decl(constEnumMergingWithValues5.ts, 2, 18)) +>E : Symbol(E, Decl(m1.ts, 1, 12)) +>X : Symbol(E.X, Decl(m1.ts, 2, 18)) } export = foo ->foo : Symbol(foo, Decl(constEnumMergingWithValues5.ts, 0, 0)) +>foo : Symbol(foo, Decl(m1.ts, 0, 0)) diff --git a/tests/baselines/reference/constEnumMergingWithValues5.types b/tests/baselines/reference/constEnumMergingWithValues5.types index 617676ba0c0..585363f4d97 100644 --- a/tests/baselines/reference/constEnumMergingWithValues5.types +++ b/tests/baselines/reference/constEnumMergingWithValues5.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/constEnumMergingWithValues5.ts === +=== tests/cases/compiler/m1.ts === module foo { >foo : typeof foo diff --git a/tests/baselines/reference/constantOverloadFunction.types b/tests/baselines/reference/constantOverloadFunction.types index d643d3a726d..d7deaaae46d 100644 --- a/tests/baselines/reference/constantOverloadFunction.types +++ b/tests/baselines/reference/constantOverloadFunction.types @@ -19,27 +19,27 @@ class Derived3 extends Base { biz() { } } >biz : () => void function foo(tagName: 'canvas'): Derived1; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } ->tagName : 'canvas' +>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } +>tagName : "canvas" >Derived1 : Derived1 function foo(tagName: 'div'): Derived2; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } ->tagName : 'div' +>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } +>tagName : "div" >Derived2 : Derived2 function foo(tagName: 'span'): Derived3; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } ->tagName : 'span' +>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } +>tagName : "span" >Derived3 : Derived3 function foo(tagName: string): Base; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } >tagName : string >Base : Base function foo(tagName: any): Base { ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } >tagName : any >Base : Base diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt deleted file mode 100644 index 4c0093a5438..00000000000 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -tests/cases/compiler/declFileObjectLiteralWithAccessors.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/declFileObjectLiteralWithAccessors.ts(6,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== tests/cases/compiler/declFileObjectLiteralWithAccessors.ts (2 errors) ==== - - function /*1*/makePoint(x: number) { - return { - b: 10, - get x() { return x; }, - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - set x(a: number) { this.b = a; } - ~ -!!! error TS1056: 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/declFileObjectLiteralWithAccessors.symbols b/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols new file mode 100644 index 00000000000..862b0b3781e --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/declFileObjectLiteralWithAccessors.ts === + +function /*1*/makePoint(x: number) { +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithAccessors.ts, 0, 0)) +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 1, 24)) + + return { + b: 10, +>b : Symbol(b, Decl(declFileObjectLiteralWithAccessors.ts, 2, 12)) + + get x() { return x; }, +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 1, 24)) + + set x(a: number) { this.b = a; } +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) +>a : Symbol(a, Decl(declFileObjectLiteralWithAccessors.ts, 5, 14)) +>a : Symbol(a, Decl(declFileObjectLiteralWithAccessors.ts, 5, 14)) + + }; +}; +var /*4*/point = makePoint(2); +>point : Symbol(point, Decl(declFileObjectLiteralWithAccessors.ts, 8, 3)) +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithAccessors.ts, 0, 0)) + +var /*2*/x = point.x; +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 9, 3)) +>point.x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) +>point : Symbol(point, Decl(declFileObjectLiteralWithAccessors.ts, 8, 3)) +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) + +point./*3*/x = 30; +>point./*3*/x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) +>point : Symbol(point, Decl(declFileObjectLiteralWithAccessors.ts, 8, 3)) +>x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) + diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types new file mode 100644 index 00000000000..f7bb57b0e1e --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types @@ -0,0 +1,47 @@ +=== tests/cases/compiler/declFileObjectLiteralWithAccessors.ts === + +function /*1*/makePoint(x: number) { +>makePoint : (x: number) => { b: number; x: number; } +>x : number + + return { +>{ b: 10, get x() { return x; }, set x(a: number) { this.b = a; } } : { b: number; x: number; } + + b: 10, +>b : number +>10 : number + + get x() { return x; }, +>x : number +>x : number + + set x(a: number) { this.b = a; } +>x : number +>a : number +>this.b = a : number +>this.b : any +>this : any +>b : any +>a : number + + }; +}; +var /*4*/point = makePoint(2); +>point : { b: number; x: number; } +>makePoint(2) : { b: number; x: number; } +>makePoint : (x: number) => { b: number; x: number; } +>2 : number + +var /*2*/x = point.x; +>x : number +>point.x : number +>point : { b: number; x: number; } +>x : number + +point./*3*/x = 30; +>point./*3*/x = 30 : number +>point./*3*/x : number +>point : { b: number; x: number; } +>x : number +>30 : number + diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt deleted file mode 100644 index 961442c23d0..00000000000 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts (1 errors) ==== - - function /*1*/makePoint(x: number) { - return { - get x() { return x; }, - ~ -!!! error TS1056: 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/declFileObjectLiteralWithOnlyGetter.js b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js index 8d79a576b06..396ee75422e 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js @@ -12,7 +12,7 @@ var /*2*/x = point./*3*/x; //// [declFileObjectLiteralWithOnlyGetter.js] function makePoint(x) { return { - get x() { return x; } + get x() { return x; }, }; } ; diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.symbols b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.symbols new file mode 100644 index 00000000000..ef9cd96e555 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts === + +function /*1*/makePoint(x: number) { +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithOnlyGetter.ts, 0, 0)) +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 1, 24)) + + return { + get x() { return x; }, +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 2, 12)) +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 1, 24)) + + }; +}; +var /*4*/point = makePoint(2); +>point : Symbol(point, Decl(declFileObjectLiteralWithOnlyGetter.ts, 6, 3)) +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithOnlyGetter.ts, 0, 0)) + +var /*2*/x = point./*3*/x; +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 7, 3)) +>point./*3*/x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 2, 12)) +>point : Symbol(point, Decl(declFileObjectLiteralWithOnlyGetter.ts, 6, 3)) +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlyGetter.ts, 2, 12)) + diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types new file mode 100644 index 00000000000..c0fb7b763fc --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts === + +function /*1*/makePoint(x: number) { +>makePoint : (x: number) => { x: number; } +>x : number + + return { +>{ get x() { return x; }, } : { x: number; } + + get x() { return x; }, +>x : number +>x : number + + }; +}; +var /*4*/point = makePoint(2); +>point : { x: number; } +>makePoint(2) : { x: number; } +>makePoint : (x: number) => { x: number; } +>2 : number + +var /*2*/x = point./*3*/x; +>x : number +>point./*3*/x : number +>point : { x: number; } +>x : number + diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt deleted file mode 100644 index 7680a8d14dc..00000000000 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts (1 errors) ==== - - function /*1*/makePoint(x: number) { - return { - b: 10, - set x(a: number) { this.b = a; } - ~ -!!! error TS1056: 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/declFileObjectLiteralWithOnlySetter.symbols b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols new file mode 100644 index 00000000000..f7474466140 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts === + +function /*1*/makePoint(x: number) { +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithOnlySetter.ts, 0, 0)) +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlySetter.ts, 1, 24)) + + return { + b: 10, +>b : Symbol(b, Decl(declFileObjectLiteralWithOnlySetter.ts, 2, 12)) + + set x(a: number) { this.b = a; } +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlySetter.ts, 3, 14)) +>a : Symbol(a, Decl(declFileObjectLiteralWithOnlySetter.ts, 4, 14)) +>a : Symbol(a, Decl(declFileObjectLiteralWithOnlySetter.ts, 4, 14)) + + }; +}; +var /*3*/point = makePoint(2); +>point : Symbol(point, Decl(declFileObjectLiteralWithOnlySetter.ts, 7, 3)) +>makePoint : Symbol(makePoint, Decl(declFileObjectLiteralWithOnlySetter.ts, 0, 0)) + +point./*2*/x = 30; +>point./*2*/x : Symbol(x, Decl(declFileObjectLiteralWithOnlySetter.ts, 3, 14)) +>point : Symbol(point, Decl(declFileObjectLiteralWithOnlySetter.ts, 7, 3)) +>x : Symbol(x, Decl(declFileObjectLiteralWithOnlySetter.ts, 3, 14)) + diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types new file mode 100644 index 00000000000..2b9b98a8963 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts === + +function /*1*/makePoint(x: number) { +>makePoint : (x: number) => { b: number; x: number; } +>x : number + + return { +>{ b: 10, set x(a: number) { this.b = a; } } : { b: number; x: number; } + + b: 10, +>b : number +>10 : number + + set x(a: number) { this.b = a; } +>x : number +>a : number +>this.b = a : number +>this.b : any +>this : any +>b : any +>a : number + + }; +}; +var /*3*/point = makePoint(2); +>point : { b: number; x: number; } +>makePoint(2) : { b: number; x: number; } +>makePoint : (x: number) => { b: number; x: number; } +>2 : number + +point./*2*/x = 30; +>point./*2*/x = 30 : number +>point./*2*/x : number +>point : { b: number; x: number; } +>x : number +>30 : number + diff --git a/tests/baselines/reference/declFilePrivateStatic.errors.txt b/tests/baselines/reference/declFilePrivateStatic.errors.txt deleted file mode 100644 index 4e1da34b979..00000000000 --- a/tests/baselines/reference/declFilePrivateStatic.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/compiler/declFilePrivateStatic.ts(9,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/declFilePrivateStatic.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/declFilePrivateStatic.ts(12,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/declFilePrivateStatic.ts(13,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== 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; } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - static get d() { return 1; } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - private static set e(v) { } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - static set f(v) { } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - } \ No newline at end of file diff --git a/tests/baselines/reference/declFilePrivateStatic.symbols b/tests/baselines/reference/declFilePrivateStatic.symbols new file mode 100644 index 00000000000..d3d0753123c --- /dev/null +++ b/tests/baselines/reference/declFilePrivateStatic.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFilePrivateStatic.ts === + +class C { +>C : Symbol(C, Decl(declFilePrivateStatic.ts, 0, 0)) + + private static x = 1; +>x : Symbol(C.x, Decl(declFilePrivateStatic.ts, 1, 9)) + + static y = 1; +>y : Symbol(C.y, Decl(declFilePrivateStatic.ts, 2, 25)) + + private static a() { } +>a : Symbol(C.a, Decl(declFilePrivateStatic.ts, 3, 17)) + + static b() { } +>b : Symbol(C.b, Decl(declFilePrivateStatic.ts, 5, 26)) + + private static get c() { return 1; } +>c : Symbol(C.c, Decl(declFilePrivateStatic.ts, 6, 18)) + + static get d() { return 1; } +>d : Symbol(C.d, Decl(declFilePrivateStatic.ts, 8, 40)) + + private static set e(v) { } +>e : Symbol(C.e, Decl(declFilePrivateStatic.ts, 9, 32)) +>v : Symbol(v, Decl(declFilePrivateStatic.ts, 11, 25)) + + static set f(v) { } +>f : Symbol(C.f, Decl(declFilePrivateStatic.ts, 11, 31)) +>v : Symbol(v, Decl(declFilePrivateStatic.ts, 12, 17)) +} diff --git a/tests/baselines/reference/declFilePrivateStatic.types b/tests/baselines/reference/declFilePrivateStatic.types new file mode 100644 index 00000000000..35aaa3acdeb --- /dev/null +++ b/tests/baselines/reference/declFilePrivateStatic.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/declFilePrivateStatic.ts === + +class C { +>C : C + + private static x = 1; +>x : number +>1 : number + + static y = 1; +>y : number +>1 : number + + private static a() { } +>a : () => void + + static b() { } +>b : () => void + + private static get c() { return 1; } +>c : number +>1 : number + + static get d() { return 1; } +>d : number +>1 : number + + private static set e(v) { } +>e : any +>v : any + + static set f(v) { } +>f : any +>v : any +} diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt new file mode 100644 index 00000000000..97013301618 --- /dev/null +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(4,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(6,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(8,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + +==== tests/cases/compiler/client.ts (0 errors) ==== + /// + var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + +==== tests/cases/compiler/declFile.d.ts (4 errors) ==== + + declare module M { + declare var x; + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + declare function f(); + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + declare module N { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + declare class C { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.js b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.js new file mode 100644 index 00000000000..30e80ef4e6f --- /dev/null +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/declFileWithErrorsInInputDeclarationFile.ts] //// + +//// [declFile.d.ts] + +declare module M { + declare var x; + declare function f(); + + declare module N { } + + declare class C { } +} + +//// [client.ts] +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + + +//// [client.js] +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + + +//// [client.d.ts] +/// +declare var x: M.C; diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt new file mode 100644 index 00000000000..97013301618 --- /dev/null +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(4,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(6,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/declFile.d.ts(8,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + +==== tests/cases/compiler/client.ts (0 errors) ==== + /// + var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + +==== tests/cases/compiler/declFile.d.ts (4 errors) ==== + + declare module M { + declare var x; + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + declare function f(); + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + declare module N { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + declare class C { } + ~~~~~~~ +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.js b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.js new file mode 100644 index 00000000000..99dd625760f --- /dev/null +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts] //// + +//// [declFile.d.ts] + +declare module M { + declare var x; + declare function f(); + + declare module N { } + + declare class C { } +} + +//// [client.ts] +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + + +//// [out.js] +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file + + +//// [out.d.ts] +/// +declare var x: M.C; diff --git a/tests/baselines/reference/declarationFileOverwriteError.errors.txt b/tests/baselines/reference/declarationFileOverwriteError.errors.txt new file mode 100644 index 00000000000..a12c60482e9 --- /dev/null +++ b/tests/baselines/reference/declarationFileOverwriteError.errors.txt @@ -0,0 +1,12 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file. +==== tests/cases/compiler/a.d.ts (0 errors) ==== + + declare class c { + } + +==== tests/cases/compiler/a.ts (0 errors) ==== + class d { + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationFileOverwriteError.js b/tests/baselines/reference/declarationFileOverwriteError.js new file mode 100644 index 00000000000..a9ae79f8ed6 --- /dev/null +++ b/tests/baselines/reference/declarationFileOverwriteError.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/declarationFileOverwriteError.ts] //// + +//// [a.d.ts] + +declare class c { +} + +//// [a.ts] +class d { +} + +//// [a.js] +var d = (function () { + function d() { + } + return d; +})(); diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt new file mode 100644 index 00000000000..02251900345 --- /dev/null +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -0,0 +1,12 @@ +error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'out.d.ts' because it would overwrite input file. +==== tests/cases/compiler/out.d.ts (0 errors) ==== + + declare class c { + } + +==== tests/cases/compiler/a.ts (0 errors) ==== + class d { + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js new file mode 100644 index 00000000000..34d9c95a005 --- /dev/null +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts] //// + +//// [out.d.ts] + +declare class c { +} + +//// [a.ts] +class d { +} + +//// [out.js] +var d = (function () { + function d() { + } + return d; +})(); diff --git a/tests/baselines/reference/declarationFiles.js b/tests/baselines/reference/declarationFiles.js index d7ed9bde8c7..7ef41a630cb 100644 --- a/tests/baselines/reference/declarationFiles.js +++ b/tests/baselines/reference/declarationFiles.js @@ -88,48 +88,3 @@ var C4 = (function () { }; return C4; })(); - - -//// [declarationFiles.d.ts] -declare class C1 { - x: this; - f(x: this): this; - constructor(x: this); -} -declare class C2 { - [x: string]: this; -} -interface Foo { - x: T; - y: this; -} -declare class C3 { - a: this[]; - b: [this, this]; - c: this | Date; - d: this & Date; - e: (((this))); - f: (x: this) => this; - g: new (x: this) => this; - h: Foo; - i: Foo this)>; - j: (x: any) => x is this; -} -declare class C4 { - x1: { - a: this; - }; - x2: this[]; - x3: { - a: this; - }[]; - x4: () => this; - f1(): { - a: this; - }; - f2(): this[]; - f3(): { - a: this; - }[]; - f4(): () => this; -} diff --git a/tests/baselines/reference/decoratorMetadata.js b/tests/baselines/reference/decoratorMetadata.js index 3c4637d9dab..35d19ae6fe9 100644 --- a/tests/baselines/reference/decoratorMetadata.js +++ b/tests/baselines/reference/decoratorMetadata.js @@ -12,6 +12,10 @@ declare var decorator: any; class MyComponent { constructor(public Service: Service) { } + + @decorator + method(x: this) { + } } //// [service.js] @@ -37,6 +41,14 @@ var MyComponent = (function () { function MyComponent(Service) { this.Service = Service; } + MyComponent.prototype.method = function (x) { + }; + __decorate([ + decorator, + __metadata('design:type', Function), + __metadata('design:paramtypes', [Object]), + __metadata('design:returntype', void 0) + ], MyComponent.prototype, "method", null); MyComponent = __decorate([ decorator, __metadata('design:paramtypes', [service_1.default]) diff --git a/tests/baselines/reference/decoratorMetadata.symbols b/tests/baselines/reference/decoratorMetadata.symbols index 706f5ace8a9..842982286d4 100644 --- a/tests/baselines/reference/decoratorMetadata.symbols +++ b/tests/baselines/reference/decoratorMetadata.symbols @@ -19,4 +19,12 @@ class MyComponent { >Service : Symbol(Service, Decl(component.ts, 6, 16)) >Service : Symbol(Service, Decl(component.ts, 0, 6)) } + + @decorator +>decorator : Symbol(decorator, Decl(component.ts, 2, 11)) + + method(x: this) { +>method : Symbol(method, Decl(component.ts, 7, 5)) +>x : Symbol(x, Decl(component.ts, 10, 11)) + } } diff --git a/tests/baselines/reference/decoratorMetadata.types b/tests/baselines/reference/decoratorMetadata.types index b0ce80fb1e4..a25f55f01b1 100644 --- a/tests/baselines/reference/decoratorMetadata.types +++ b/tests/baselines/reference/decoratorMetadata.types @@ -19,4 +19,12 @@ class MyComponent { >Service : Service >Service : Service } + + @decorator +>decorator : any + + method(x: this) { +>method : (x: this) => void +>x : this + } } diff --git a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.js b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.js index 99e50801d50..de55d21cb1d 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.js +++ b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.js @@ -1,4 +1,4 @@ -//// [doNotEmitPinnedCommentOnNotEmittedNode.ts] +//// [file1.ts] class C { /*! remove pinned comment anywhere else */ @@ -11,7 +11,7 @@ var x = 10; /*! remove pinned comment anywhere else */ declare var OData: any; -//// [doNotEmitPinnedCommentOnNotEmittedNode.js] +//// [file1.js] var C = (function () { function C() { } diff --git a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.symbols b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.symbols index 64609266044..c733d886ff3 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.symbols +++ b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.symbols @@ -1,24 +1,24 @@ -=== tests/cases/compiler/doNotEmitPinnedCommentOnNotEmittedNode.ts === +=== tests/cases/compiler/file1.ts === class C { ->C : Symbol(C, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 0, 0)) +>C : Symbol(C, Decl(file1.ts, 0, 0)) /*! remove pinned comment anywhere else */ public foo(x: string, y: any) ->foo : Symbol(foo, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 1, 9), Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 33)) ->x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 15)) ->y : Symbol(y, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 25)) +>foo : Symbol(foo, Decl(file1.ts, 1, 9), Decl(file1.ts, 3, 33)) +>x : Symbol(x, Decl(file1.ts, 3, 15)) +>y : Symbol(y, Decl(file1.ts, 3, 25)) public foo(x: string, y: number) { } ->foo : Symbol(foo, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 1, 9), Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 33)) ->x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 4, 15)) ->y : Symbol(y, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 4, 25)) +>foo : Symbol(foo, Decl(file1.ts, 1, 9), Decl(file1.ts, 3, 33)) +>x : Symbol(x, Decl(file1.ts, 4, 15)) +>y : Symbol(y, Decl(file1.ts, 4, 25)) } var x = 10; ->x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 7, 3)) +>x : Symbol(x, Decl(file1.ts, 7, 3)) /*! remove pinned comment anywhere else */ declare var OData: any; ->OData : Symbol(OData, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 10, 11)) +>OData : Symbol(OData, Decl(file1.ts, 10, 11)) diff --git a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types index b0f71137c2d..49fb8e378ba 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types +++ b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/doNotEmitPinnedCommentOnNotEmittedNode.ts === +=== tests/cases/compiler/file1.ts === class C { >C : C diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js index d86925f1fd3..97a51d7032d 100644 --- a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js @@ -1,4 +1,4 @@ -//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts] +//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding_0.ts] -//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js] +//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding_0.js] diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols index 61cc569b965..81436a6e510 100644 --- a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols @@ -1,3 +1,3 @@ -=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts === +=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding_0.ts === No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.types b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.types index 61cc569b965..81436a6e510 100644 --- a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.types +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.types @@ -1,3 +1,3 @@ -=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts === +=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding_0.ts === No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js index ece24d691da..e7f88b92775 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.js @@ -10,16 +10,16 @@ class C { static get ["computedname"]() { return ""; } - get ["computedname"]() { + get ["computedname1"]() { return ""; } - get ["computedname"]() { + get ["computedname2"]() { return ""; } - set ["computedname"](x: any) { + set ["computedname3"](x: any) { } - set ["computedname"](y: string) { + set ["computedname4"](y: string) { } set foo(a: string) { } @@ -38,15 +38,15 @@ class C { static get ["computedname"]() { return ""; } - get ["computedname"]() { + get ["computedname1"]() { return ""; } - get ["computedname"]() { + get ["computedname2"]() { return ""; } - set ["computedname"](x) { + set ["computedname3"](x) { } - set ["computedname"](y) { + set ["computedname4"](y) { } set foo(a) { } static set bar(b) { } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols index 2d249348f9b..b2b1a000dc9 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols @@ -21,18 +21,18 @@ class C { static get ["computedname"]() { return ""; } - get ["computedname"]() { + get ["computedname1"]() { return ""; } - get ["computedname"]() { + get ["computedname2"]() { return ""; } - set ["computedname"](x: any) { ->x : Symbol(x, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 18, 25)) + set ["computedname3"](x: any) { +>x : Symbol(x, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 18, 26)) } - set ["computedname"](y: string) { ->y : Symbol(y, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 20, 25)) + set ["computedname4"](y: string) { +>y : Symbol(y, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 20, 26)) } set foo(a: string) { } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index 292fb961b10..e4f7d6c00b4 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -25,25 +25,25 @@ class C { return ""; >"" : string } - get ["computedname"]() { ->"computedname" : string + get ["computedname1"]() { +>"computedname1" : string return ""; >"" : string } - get ["computedname"]() { ->"computedname" : string + get ["computedname2"]() { +>"computedname2" : string return ""; >"" : string } - set ["computedname"](x: any) { ->"computedname" : string + set ["computedname3"](x: any) { +>"computedname3" : string >x : any } - set ["computedname"](y: string) { ->"computedname" : string + set ["computedname4"](y: string) { +>"computedname4" : string >y : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js index fc0a510461b..8a79d45b678 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.js @@ -2,18 +2,18 @@ class D { _bar: string; foo() { } - ["computedName"]() { } - ["computedName"](a: string) { } - ["computedName"](a: string): number { return 1; } + ["computedName1"]() { } + ["computedName2"](a: string) { } + ["computedName3"](a: string): number { return 1; } bar(): string { return this._bar; } baz(a: any, x: string): string { return "HELLO"; } - static ["computedname"]() { } - static ["computedname"](a: string) { } - static ["computedname"](a: string): boolean { return true; } + static ["computedname4"]() { } + static ["computedname5"](a: string) { } + static ["computedname6"](a: string): boolean { return true; } static staticMethod() { var x = 1 + 2; return x @@ -25,18 +25,18 @@ class D { //// [emitClassDeclarationWithMethodInES6.js] class D { foo() { } - ["computedName"]() { } - ["computedName"](a) { } - ["computedName"](a) { return 1; } + ["computedName1"]() { } + ["computedName2"](a) { } + ["computedName3"](a) { return 1; } bar() { return this._bar; } baz(a, x) { return "HELLO"; } - static ["computedname"]() { } - static ["computedname"](a) { } - static ["computedname"](a) { return true; } + static ["computedname4"]() { } + static ["computedname5"](a) { } + static ["computedname6"](a) { return true; } static staticMethod() { var x = 1 + 2; return x; diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols index b7a4dbbf341..970076f6b78 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols @@ -8,15 +8,15 @@ class D { foo() { } >foo : Symbol(foo, Decl(emitClassDeclarationWithMethodInES6.ts, 1, 17)) - ["computedName"]() { } - ["computedName"](a: string) { } ->a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 4, 21)) + ["computedName1"]() { } + ["computedName2"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 4, 22)) - ["computedName"](a: string): number { return 1; } ->a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 21)) + ["computedName3"](a: string): number { return 1; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 22)) bar(): string { ->bar : Symbol(bar, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 53)) +>bar : Symbol(bar, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 54)) return this._bar; >this._bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) @@ -30,15 +30,15 @@ class D { return "HELLO"; } - static ["computedname"]() { } - static ["computedname"](a: string) { } ->a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 13, 28)) + static ["computedname4"]() { } + static ["computedname5"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 13, 29)) - static ["computedname"](a: string): boolean { return true; } ->a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 28)) + static ["computedname6"](a: string): boolean { return true; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 29)) static staticMethod() { ->staticMethod : Symbol(D.staticMethod, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 64)) +>staticMethod : Symbol(D.staticMethod, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 65)) var x = 1 + 2; >x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 16, 11)) diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index 10ae930c244..02a90729486 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -8,15 +8,15 @@ class D { foo() { } >foo : () => void - ["computedName"]() { } ->"computedName" : string + ["computedName1"]() { } +>"computedName1" : string - ["computedName"](a: string) { } ->"computedName" : string + ["computedName2"](a: string) { } +>"computedName2" : string >a : string - ["computedName"](a: string): number { return 1; } ->"computedName" : string + ["computedName3"](a: string): number { return 1; } +>"computedName3" : string >a : string >1 : number @@ -36,15 +36,15 @@ class D { return "HELLO"; >"HELLO" : string } - static ["computedname"]() { } ->"computedname" : string + static ["computedname4"]() { } +>"computedname4" : string - static ["computedname"](a: string) { } ->"computedname" : string + static ["computedname5"](a: string) { } +>"computedname5" : string >a : string - static ["computedname"](a: string): boolean { return true; } ->"computedname" : string + static ["computedname6"](a: string): boolean { return true; } +>"computedname6" : string >a : string >true : boolean diff --git a/tests/baselines/reference/es6ExportClause.js b/tests/baselines/reference/es6ExportClause.js index f0d9bbe8cff..742a39e1324 100644 --- a/tests/baselines/reference/es6ExportClause.js +++ b/tests/baselines/reference/es6ExportClause.js @@ -1,4 +1,4 @@ -//// [es6ExportClause.ts] +//// [server.ts] class c { } @@ -16,7 +16,7 @@ export { i, m as instantiatedModule }; export { uninstantiated }; export { x }; -//// [es6ExportClause.js] +//// [server.js] class c { } var m; @@ -30,7 +30,7 @@ export { m as instantiatedModule }; export { x }; -//// [es6ExportClause.d.ts] +//// [server.d.ts] declare class c { } interface i { diff --git a/tests/baselines/reference/es6ExportClause.symbols b/tests/baselines/reference/es6ExportClause.symbols index fe4de21a00f..1bacedec76c 100644 --- a/tests/baselines/reference/es6ExportClause.symbols +++ b/tests/baselines/reference/es6ExportClause.symbols @@ -1,38 +1,38 @@ -=== tests/cases/compiler/es6ExportClause.ts === +=== tests/cases/compiler/server.ts === class c { ->c : Symbol(c, Decl(es6ExportClause.ts, 0, 0)) +>c : Symbol(c, Decl(server.ts, 0, 0)) } interface i { ->i : Symbol(i, Decl(es6ExportClause.ts, 2, 1)) +>i : Symbol(i, Decl(server.ts, 2, 1)) } module m { ->m : Symbol(m, Decl(es6ExportClause.ts, 4, 1)) +>m : Symbol(m, Decl(server.ts, 4, 1)) export var x = 10; ->x : Symbol(x, Decl(es6ExportClause.ts, 6, 14)) +>x : Symbol(x, Decl(server.ts, 6, 14)) } var x = 10; ->x : Symbol(x, Decl(es6ExportClause.ts, 8, 3)) +>x : Symbol(x, Decl(server.ts, 8, 3)) module uninstantiated { ->uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 8, 11)) +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 11)) } export { c }; ->c : Symbol(c, Decl(es6ExportClause.ts, 11, 8)) +>c : Symbol(c, Decl(server.ts, 11, 8)) export { c as c2 }; ->c : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) ->c2 : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) +>c : Symbol(c2, Decl(server.ts, 12, 8)) +>c2 : Symbol(c2, Decl(server.ts, 12, 8)) export { i, m as instantiatedModule }; ->i : Symbol(i, Decl(es6ExportClause.ts, 13, 8)) ->m : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) ->instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) +>i : Symbol(i, Decl(server.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(server.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(server.ts, 13, 11)) export { uninstantiated }; ->uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 14, 8)) +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 14, 8)) export { x }; ->x : Symbol(x, Decl(es6ExportClause.ts, 15, 8)) +>x : Symbol(x, Decl(server.ts, 15, 8)) diff --git a/tests/baselines/reference/es6ExportClause.types b/tests/baselines/reference/es6ExportClause.types index b0d544201a4..5cab90d6a7f 100644 --- a/tests/baselines/reference/es6ExportClause.types +++ b/tests/baselines/reference/es6ExportClause.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/es6ExportClause.ts === +=== tests/cases/compiler/server.ts === class c { >c : c diff --git a/tests/baselines/reference/es6ExportClauseInEs5.js b/tests/baselines/reference/es6ExportClauseInEs5.js index f987b48aeca..8bd908880f6 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.js +++ b/tests/baselines/reference/es6ExportClauseInEs5.js @@ -1,4 +1,4 @@ -//// [es6ExportClauseInEs5.ts] +//// [server.ts] class c { } @@ -16,7 +16,7 @@ export { i, m as instantiatedModule }; export { uninstantiated }; export { x }; -//// [es6ExportClauseInEs5.js] +//// [server.js] var c = (function () { function c() { } @@ -33,7 +33,7 @@ var x = 10; exports.x = x; -//// [es6ExportClauseInEs5.d.ts] +//// [server.d.ts] declare class c { } interface i { diff --git a/tests/baselines/reference/es6ExportClauseInEs5.symbols b/tests/baselines/reference/es6ExportClauseInEs5.symbols index 5590b907eec..1bacedec76c 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.symbols +++ b/tests/baselines/reference/es6ExportClauseInEs5.symbols @@ -1,38 +1,38 @@ -=== tests/cases/compiler/es6ExportClauseInEs5.ts === +=== tests/cases/compiler/server.ts === class c { ->c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 0, 0)) +>c : Symbol(c, Decl(server.ts, 0, 0)) } interface i { ->i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 2, 1)) +>i : Symbol(i, Decl(server.ts, 2, 1)) } module m { ->m : Symbol(m, Decl(es6ExportClauseInEs5.ts, 4, 1)) +>m : Symbol(m, Decl(server.ts, 4, 1)) export var x = 10; ->x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 6, 14)) +>x : Symbol(x, Decl(server.ts, 6, 14)) } var x = 10; ->x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 8, 3)) +>x : Symbol(x, Decl(server.ts, 8, 3)) module uninstantiated { ->uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 8, 11)) +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 11)) } export { c }; ->c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 11, 8)) +>c : Symbol(c, Decl(server.ts, 11, 8)) export { c as c2 }; ->c : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) ->c2 : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) +>c : Symbol(c2, Decl(server.ts, 12, 8)) +>c2 : Symbol(c2, Decl(server.ts, 12, 8)) export { i, m as instantiatedModule }; ->i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 13, 8)) ->m : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) ->instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) +>i : Symbol(i, Decl(server.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(server.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(server.ts, 13, 11)) export { uninstantiated }; ->uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 14, 8)) +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 14, 8)) export { x }; ->x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 15, 8)) +>x : Symbol(x, Decl(server.ts, 15, 8)) diff --git a/tests/baselines/reference/es6ExportClauseInEs5.types b/tests/baselines/reference/es6ExportClauseInEs5.types index c6ef9033bf1..5cab90d6a7f 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.types +++ b/tests/baselines/reference/es6ExportClauseInEs5.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/es6ExportClauseInEs5.ts === +=== tests/cases/compiler/server.ts === class c { >c : c diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt index bb228caa0c9..5a84a279122 100644 --- a/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +tests/cases/conformance/externalModules/foo_0.ts(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts (1 errors) ==== +==== tests/cases/conformance/externalModules/foo_0.ts (1 errors) ==== export enum E1 { A,B,C } diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.js b/tests/baselines/reference/exportAssignmentAndDeclaration.js index ed9f92d88ef..c1d6510b1f7 100644 --- a/tests/baselines/reference/exportAssignmentAndDeclaration.js +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.js @@ -1,4 +1,4 @@ -//// [exportAssignmentAndDeclaration.ts] +//// [foo_0.ts] export enum E1 { A,B,C } @@ -10,7 +10,7 @@ class C1 { // Invalid, as there is already an exported member. export = C1; -//// [exportAssignmentAndDeclaration.js] +//// [foo_0.js] define(["require", "exports"], function (require, exports) { (function (E1) { E1[E1["A"] = 0] = "A"; diff --git a/tests/baselines/reference/exportAssignmentError.js b/tests/baselines/reference/exportAssignmentError.js index 777a9fab048..adf9d741dbe 100644 --- a/tests/baselines/reference/exportAssignmentError.js +++ b/tests/baselines/reference/exportAssignmentError.js @@ -1,4 +1,4 @@ -//// [exportAssignmentError.ts] +//// [exportEqualsModule_A.ts] module M { export var x; } @@ -8,7 +8,7 @@ import M2 = M; export = M2; // should not error -//// [exportAssignmentError.js] +//// [exportEqualsModule_A.js] define(["require", "exports"], function (require, exports) { var M; (function (M) { diff --git a/tests/baselines/reference/exportAssignmentError.symbols b/tests/baselines/reference/exportAssignmentError.symbols index 482ad586dc2..e10556360a4 100644 --- a/tests/baselines/reference/exportAssignmentError.symbols +++ b/tests/baselines/reference/exportAssignmentError.symbols @@ -1,15 +1,15 @@ -=== tests/cases/compiler/exportAssignmentError.ts === +=== tests/cases/compiler/exportEqualsModule_A.ts === module M { ->M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) +>M : Symbol(M, Decl(exportEqualsModule_A.ts, 0, 0)) export var x; ->x : Symbol(x, Decl(exportAssignmentError.ts, 1, 11)) +>x : Symbol(x, Decl(exportEqualsModule_A.ts, 1, 11)) } import M2 = M; ->M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) ->M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) +>M2 : Symbol(M2, Decl(exportEqualsModule_A.ts, 2, 1)) +>M : Symbol(M, Decl(exportEqualsModule_A.ts, 0, 0)) export = M2; // should not error ->M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) +>M2 : Symbol(M2, Decl(exportEqualsModule_A.ts, 2, 1)) diff --git a/tests/baselines/reference/exportAssignmentError.types b/tests/baselines/reference/exportAssignmentError.types index 89e7d461fb2..96f92c8571b 100644 --- a/tests/baselines/reference/exportAssignmentError.types +++ b/tests/baselines/reference/exportAssignmentError.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/exportAssignmentError.ts === +=== tests/cases/compiler/exportEqualsModule_A.ts === module M { >M : typeof M diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.js b/tests/baselines/reference/fileReferencesWithNoExtensions.js new file mode 100644 index 00000000000..48421954c3a --- /dev/null +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/fileReferencesWithNoExtensions.ts] //// + +//// [t.ts] +/// +/// +/// +var a = aa; // Check that a.ts is referenced +var b = bb; // Check that b.d.ts is referenced +var c = cc; // Check that c.ts has precedence over c.d.ts + +//// [a.ts] +var aa = 1; + +//// [b.d.ts] +declare var bb: number; + +//// [c.ts] +var cc = 1; + +//// [c.d.ts] +declare var xx: number; + + +//// [a.js] +var aa = 1; +//// [c.js] +var cc = 1; +//// [t.js] +/// +/// +/// +var a = aa; // Check that a.ts is referenced +var b = bb; // Check that b.d.ts is referenced +var c = cc; // Check that c.ts has precedence over c.d.ts diff --git a/tests/baselines/reference/filesEmittingIntoSameOutput.errors.txt b/tests/baselines/reference/filesEmittingIntoSameOutput.errors.txt new file mode 100644 index 00000000000..013a1445b0d --- /dev/null +++ b/tests/baselines/reference/filesEmittingIntoSameOutput.errors.txt @@ -0,0 +1,12 @@ +error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. + + +!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/a.tsx (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js new file mode 100644 index 00000000000..9d3a73515b4 --- /dev/null +++ b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/filesEmittingIntoSameOutputWithOutOption.ts] //// + +//// [a.ts] +export class c { +} + +//// [b.ts] +function foo() { +} + + +//// [a.js] +define("tests/cases/compiler/a", ["require", "exports"], function (require, exports) { + var c = (function () { + function c() { + } + return c; + })(); + exports.c = c; +}); +function foo() { +} diff --git a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.symbols b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.symbols new file mode 100644 index 00000000000..5c60c022e03 --- /dev/null +++ b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/a.ts === +export class c { +>c : Symbol(c, Decl(a.ts, 0, 0)) +} + +=== tests/cases/compiler/b.ts === +function foo() { +>foo : Symbol(foo, Decl(b.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.types b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.types new file mode 100644 index 00000000000..3cc407bfd0b --- /dev/null +++ b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/a.ts === +export class c { +>c : c +} + +=== tests/cases/compiler/b.ts === +function foo() { +>foo : () => void +} + diff --git a/tests/baselines/reference/functionVariableInReturnTypeAnnotation.errors.txt b/tests/baselines/reference/functionVariableInReturnTypeAnnotation.errors.txt new file mode 100644 index 00000000000..93a35292b70 --- /dev/null +++ b/tests/baselines/reference/functionVariableInReturnTypeAnnotation.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/functionVariableInReturnTypeAnnotation.ts(1,24): error TS2304: Cannot find name 'b'. + + +==== tests/cases/compiler/functionVariableInReturnTypeAnnotation.ts (1 errors) ==== + function bar(): typeof b { + ~ +!!! error TS2304: Cannot find name 'b'. + var b = 1; + return undefined; + } \ No newline at end of file diff --git a/tests/baselines/reference/functionVariableInReturnTypeAnnotation.js b/tests/baselines/reference/functionVariableInReturnTypeAnnotation.js new file mode 100644 index 00000000000..191255e52c2 --- /dev/null +++ b/tests/baselines/reference/functionVariableInReturnTypeAnnotation.js @@ -0,0 +1,11 @@ +//// [functionVariableInReturnTypeAnnotation.ts] +function bar(): typeof b { + var b = 1; + return undefined; +} + +//// [functionVariableInReturnTypeAnnotation.js] +function bar() { + var b = 1; + return undefined; +} diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js new file mode 100644 index 00000000000..bb45587eea1 --- /dev/null +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -0,0 +1,104 @@ +//// [genericClassExpressionInFunction.ts] +class A { + genericVar: T +} +function B1() { + // class expression can use T + return class extends A { } +} +class B2 { + anon = class extends A { } +} +function B3() { + return class Inner extends A { } +} +// extends can call B +class K extends B1() { + namae: string; +} +class C extends (new B2().anon) { + name: string; +} +let b3Number = B3(); +class S extends b3Number { + nom: string; +} +var c = new C(); +var k = new K(); +var s = new S(); +c.genericVar = 12; +k.genericVar = 12; +s.genericVar = 12; + + +//// [genericClassExpressionInFunction.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var A = (function () { + function A() { + } + return A; +})(); +function B1() { + // class expression can use T + return (function (_super) { + __extends(class_1, _super); + function class_1() { + _super.apply(this, arguments); + } + return class_1; + })(A); +} +var B2 = (function () { + function B2() { + this.anon = (function (_super) { + __extends(class_2, _super); + function class_2() { + _super.apply(this, arguments); + } + return class_2; + })(A); + } + return B2; +})(); +function B3() { + return (function (_super) { + __extends(Inner, _super); + function Inner() { + _super.apply(this, arguments); + } + return Inner; + })(A); +} +// extends can call B +var K = (function (_super) { + __extends(K, _super); + function K() { + _super.apply(this, arguments); + } + return K; +})(B1()); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})((new B2().anon)); +var b3Number = B3(); +var S = (function (_super) { + __extends(S, _super); + function S() { + _super.apply(this, arguments); + } + return S; +})(b3Number); +var c = new C(); +var k = new K(); +var s = new S(); +c.genericVar = 12; +k.genericVar = 12; +s.genericVar = 12; diff --git a/tests/baselines/reference/genericClassExpressionInFunction.symbols b/tests/baselines/reference/genericClassExpressionInFunction.symbols new file mode 100644 index 00000000000..b5a6b8c6c70 --- /dev/null +++ b/tests/baselines/reference/genericClassExpressionInFunction.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/classes/classExpressions/genericClassExpressionInFunction.ts === +class A { +>A : Symbol(A, Decl(genericClassExpressionInFunction.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassExpressionInFunction.ts, 0, 8)) + + genericVar: T +>genericVar : Symbol(genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) +>T : Symbol(T, Decl(genericClassExpressionInFunction.ts, 0, 8)) +} +function B1() { +>B1 : Symbol(B1, Decl(genericClassExpressionInFunction.ts, 2, 1)) +>U : Symbol(U, Decl(genericClassExpressionInFunction.ts, 3, 12)) + + // class expression can use T + return class extends A { } +>A : Symbol(A, Decl(genericClassExpressionInFunction.ts, 0, 0)) +>U : Symbol(U, Decl(genericClassExpressionInFunction.ts, 3, 12)) +} +class B2 { +>B2 : Symbol(B2, Decl(genericClassExpressionInFunction.ts, 6, 1)) +>V : Symbol(V, Decl(genericClassExpressionInFunction.ts, 7, 9)) + + anon = class extends A { } +>anon : Symbol(anon, Decl(genericClassExpressionInFunction.ts, 7, 13)) +>A : Symbol(A, Decl(genericClassExpressionInFunction.ts, 0, 0)) +>V : Symbol(V, Decl(genericClassExpressionInFunction.ts, 7, 9)) +} +function B3() { +>B3 : Symbol(B3, Decl(genericClassExpressionInFunction.ts, 9, 1)) +>W : Symbol(W, Decl(genericClassExpressionInFunction.ts, 10, 12)) + + return class Inner extends A { } +>Inner : Symbol(Inner, Decl(genericClassExpressionInFunction.ts, 11, 10)) +>TInner : Symbol(TInner, Decl(genericClassExpressionInFunction.ts, 11, 23)) +>A : Symbol(A, Decl(genericClassExpressionInFunction.ts, 0, 0)) +>W : Symbol(W, Decl(genericClassExpressionInFunction.ts, 10, 12)) +} +// extends can call B +class K extends B1() { +>K : Symbol(K, Decl(genericClassExpressionInFunction.ts, 12, 1)) +>B1 : Symbol(B1, Decl(genericClassExpressionInFunction.ts, 2, 1)) + + namae: string; +>namae : Symbol(namae, Decl(genericClassExpressionInFunction.ts, 14, 30)) +} +class C extends (new B2().anon) { +>C : Symbol(C, Decl(genericClassExpressionInFunction.ts, 16, 1)) +>new B2().anon : Symbol(B2.anon, Decl(genericClassExpressionInFunction.ts, 7, 13)) +>B2 : Symbol(B2, Decl(genericClassExpressionInFunction.ts, 6, 1)) +>anon : Symbol(B2.anon, Decl(genericClassExpressionInFunction.ts, 7, 13)) + + name: string; +>name : Symbol(name, Decl(genericClassExpressionInFunction.ts, 17, 41)) +} +let b3Number = B3(); +>b3Number : Symbol(b3Number, Decl(genericClassExpressionInFunction.ts, 20, 3)) +>B3 : Symbol(B3, Decl(genericClassExpressionInFunction.ts, 9, 1)) + +class S extends b3Number { +>S : Symbol(S, Decl(genericClassExpressionInFunction.ts, 20, 28)) +>b3Number : Symbol(b3Number, Decl(genericClassExpressionInFunction.ts, 20, 3)) + + nom: string; +>nom : Symbol(nom, Decl(genericClassExpressionInFunction.ts, 21, 34)) +} +var c = new C(); +>c : Symbol(c, Decl(genericClassExpressionInFunction.ts, 24, 3)) +>C : Symbol(C, Decl(genericClassExpressionInFunction.ts, 16, 1)) + +var k = new K(); +>k : Symbol(k, Decl(genericClassExpressionInFunction.ts, 25, 3)) +>K : Symbol(K, Decl(genericClassExpressionInFunction.ts, 12, 1)) + +var s = new S(); +>s : Symbol(s, Decl(genericClassExpressionInFunction.ts, 26, 3)) +>S : Symbol(S, Decl(genericClassExpressionInFunction.ts, 20, 28)) + +c.genericVar = 12; +>c.genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) +>c : Symbol(c, Decl(genericClassExpressionInFunction.ts, 24, 3)) +>genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) + +k.genericVar = 12; +>k.genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) +>k : Symbol(k, Decl(genericClassExpressionInFunction.ts, 25, 3)) +>genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) + +s.genericVar = 12; +>s.genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) +>s : Symbol(s, Decl(genericClassExpressionInFunction.ts, 26, 3)) +>genericVar : Symbol(A.genericVar, Decl(genericClassExpressionInFunction.ts, 0, 12)) + diff --git a/tests/baselines/reference/genericClassExpressionInFunction.types b/tests/baselines/reference/genericClassExpressionInFunction.types new file mode 100644 index 00000000000..943391fdd59 --- /dev/null +++ b/tests/baselines/reference/genericClassExpressionInFunction.types @@ -0,0 +1,108 @@ +=== tests/cases/conformance/classes/classExpressions/genericClassExpressionInFunction.ts === +class A { +>A : A +>T : T + + genericVar: T +>genericVar : T +>T : T +} +function B1() { +>B1 : () => typeof (Anonymous class) +>U : U + + // class expression can use T + return class extends A { } +>class extends A { } : typeof (Anonymous class) +>A : A +>U : U +} +class B2 { +>B2 : B2 +>V : V + + anon = class extends A { } +>anon : typeof (Anonymous class) +>class extends A { } : typeof (Anonymous class) +>A : A +>V : V +} +function B3() { +>B3 : () => typeof Inner +>W : W + + return class Inner extends A { } +>class Inner extends A { } : typeof Inner +>Inner : typeof Inner +>TInner : TInner +>A : A +>W : W +} +// extends can call B +class K extends B1() { +>K : K +>B1() : B1.(Anonymous class) +>B1 : () => typeof (Anonymous class) + + namae: string; +>namae : string +} +class C extends (new B2().anon) { +>C : C +>(new B2().anon) : B2.(Anonymous class) +>new B2().anon : typeof (Anonymous class) +>new B2() : B2 +>B2 : typeof B2 +>anon : typeof (Anonymous class) + + name: string; +>name : string +} +let b3Number = B3(); +>b3Number : typeof Inner +>B3() : typeof Inner +>B3 : () => typeof Inner + +class S extends b3Number { +>S : S +>b3Number : B3.Inner + + nom: string; +>nom : string +} +var c = new C(); +>c : C +>new C() : C +>C : typeof C + +var k = new K(); +>k : K +>new K() : K +>K : typeof K + +var s = new S(); +>s : S +>new S() : S +>S : typeof S + +c.genericVar = 12; +>c.genericVar = 12 : number +>c.genericVar : number +>c : C +>genericVar : number +>12 : number + +k.genericVar = 12; +>k.genericVar = 12 : number +>k.genericVar : number +>k : K +>genericVar : number +>12 : number + +s.genericVar = 12; +>s.genericVar = 12 : number +>s.genericVar : number +>s : S +>genericVar : number +>12 : number + diff --git a/tests/baselines/reference/getEmitOutputMapRoots.baseline b/tests/baselines/reference/getEmitOutputMapRoots.baseline index b4a4ace4d42..66130347d2d 100644 --- a/tests/baselines/reference/getEmitOutputMapRoots.baseline +++ b/tests/baselines/reference/getEmitOutputMapRoots.baseline @@ -1,6 +1,6 @@ EmitSkipped: false FileName : declSingleFile.js.map -{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../tests/cases/fourslash/inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : declSingleFile.js +{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : declSingleFile.js var x = 109; var foo = "hello world"; var M = (function () { @@ -8,4 +8,4 @@ var M = (function () { } return M; })(); -//# sourceMappingURL=mapRootDir/declSingleFile.js.map +//# sourceMappingURL=tests/cases/fourslash/mapRootDir/declSingleFile.js.map diff --git a/tests/baselines/reference/getEmitOutputSingleFile2.baseline b/tests/baselines/reference/getEmitOutputSingleFile2.baseline index c9409c5ca8c..3022dcf68d8 100644 --- a/tests/baselines/reference/getEmitOutputSingleFile2.baseline +++ b/tests/baselines/reference/getEmitOutputSingleFile2.baseline @@ -1,8 +1,30 @@ EmitSkipped: false -FileName : tests/cases/fourslash/inputFile3.js -exports.foo = 10; -exports.bar = "hello world"; -FileName : tests/cases/fourslash/inputFile3.d.ts -export declare var foo: number; -export declare var bar: string; +FileName : declSingleFile.js +var x = 5; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var x1 = "hello world"; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +FileName : declSingleFile.d.ts +declare var x: number; +declare class Bar { + x: string; + y: number; +} +declare var x1: string; +declare class Foo { + x: string; + y: number; +} +declare module "tests/cases/fourslash/inputFile3" { + export var foo: number; + export var bar: string; +} diff --git a/tests/baselines/reference/getEmitOutputTsxFile_React.baseline b/tests/baselines/reference/getEmitOutputTsxFile_React.baseline index c796f8e78bc..98a30c97318 100644 --- a/tests/baselines/reference/getEmitOutputTsxFile_React.baseline +++ b/tests/baselines/reference/getEmitOutputTsxFile_React.baseline @@ -17,10 +17,11 @@ declare class Bar { EmitSkipped: false FileName : tests/cases/fourslash/inputFile2.js.map -{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["inputFile2.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,QAAQ,CAAC;AACjB,IAAI,CAAC,GAAG,qBAAC,GAAG,KAAC,IAAI,GAAG,CAAE,EAAG,CAAA"}FileName : tests/cases/fourslash/inputFile2.js +{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["inputFile2.tsx"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,QAAQ,CAAC;AACjB,IAAI,CAAC,GAAG,qBAAC,GAAG,IAAC,IAAI,EAAG,CAAE,EAAG,CAAA"}FileName : tests/cases/fourslash/inputFile2.js var y = "my div"; -var x = React.createElement("div", {"name": y}); +var x = React.createElement("div", {name: y}); //# sourceMappingURL=inputFile2.js.mapFileName : tests/cases/fourslash/inputFile2.d.ts +declare var React: any; declare var y: string; declare var x: any; diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline index f854a619a47..2f27152892b 100644 --- a/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline @@ -1,4 +1,6 @@ -EmitSkipped: false +EmitSkipped: true +Diagnostics: + Exported variable 'foo' has or is using private name 'C'. FileName : tests/cases/fourslash/inputFile.js var M; (function (M) { diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline index 463dfe6899a..a3a9023f75b 100644 --- a/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline @@ -1,4 +1,6 @@ -EmitSkipped: false +EmitSkipped: true +Diagnostics: + Exported variable 'foo' has or is using private name 'C'. FileName : tests/cases/fourslash/inputFile.js define(["require", "exports"], function (require, exports) { var C = (function () { diff --git a/tests/baselines/reference/importNonStringLiteral.errors.txt b/tests/baselines/reference/importNonStringLiteral.errors.txt index 7138680d709..97470e6408d 100644 --- a/tests/baselines/reference/importNonStringLiteral.errors.txt +++ b/tests/baselines/reference/importNonStringLiteral.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/externalModules/importNonStringLiteral.ts(2,22): error TS1141: String literal expected. +tests/cases/conformance/externalModules/vs/foo_0.ts(2,22): error TS1141: String literal expected. -==== tests/cases/conformance/externalModules/importNonStringLiteral.ts (1 errors) ==== +==== tests/cases/conformance/externalModules/vs/foo_0.ts (1 errors) ==== var x = "filename"; import foo = require(x); // invalid ~ diff --git a/tests/baselines/reference/importNonStringLiteral.js b/tests/baselines/reference/importNonStringLiteral.js index 52ef5a10a67..46185a2dfe4 100644 --- a/tests/baselines/reference/importNonStringLiteral.js +++ b/tests/baselines/reference/importNonStringLiteral.js @@ -1,7 +1,7 @@ -//// [importNonStringLiteral.ts] +//// [foo_0.ts] var x = "filename"; import foo = require(x); // invalid -//// [importNonStringLiteral.js] +//// [foo_0.js] var x = "filename"; diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types index dc8b9b465d8..563cb58a755 100644 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types @@ -11,7 +11,7 @@ interface B extends A { >A : A (key:'foo'):string; ->key : 'foo' +>key : "foo" } var b:B; @@ -24,7 +24,7 @@ b('foo').charAt(0); >b('foo').charAt : (pos: number) => string >b('foo') : string >b : B ->'foo' : string +>'foo' : "foo" >charAt : (pos: number) => string >0 : number @@ -32,7 +32,7 @@ interface A { >A : A (x: 'A1'): string; ->x : 'A1' +>x : "A1" (x: string): void; >x : string @@ -43,21 +43,21 @@ interface B extends A { >A : A (x: 'B1'): number; ->x : 'B1' +>x : "B1" } interface A { >A : A (x: 'A2'): boolean; ->x : 'A2' +>x : "A2" } interface B { >B : B (x: 'B2'): string[]; ->x : 'B2' +>x : "B2" } interface C1 extends B { @@ -65,7 +65,7 @@ interface C1 extends B { >B : B (x: 'C1'): number[]; ->x : 'C1' +>x : "C1" } interface C2 extends B { @@ -73,7 +73,7 @@ interface C2 extends B { >B : B (x: 'C2'): boolean[]; ->x : 'C2' +>x : "C2" } interface C extends C1, C2 { @@ -82,7 +82,7 @@ interface C extends C1, C2 { >C2 : C2 (x: 'C'): string; ->x : 'C' +>x : "C" } var c: C; @@ -94,25 +94,25 @@ var x1: string[] = c('B2'); >x1 : string[] >c('B2') : string[] >c : C ->'B2' : string +>'B2' : "B2" var x2: number = c('B1'); >x2 : number >c('B1') : number >c : C ->'B1' : string +>'B1' : "B1" var x3: boolean = c('A2'); >x3 : boolean >c('A2') : boolean >c : C ->'A2' : string +>'A2' : "A2" var x4: string = c('A1'); >x4 : string >c('A1') : string >c : C ->'A1' : string +>'A1' : "A1" var x5: void = c('A0'); >x5 : void @@ -124,19 +124,19 @@ var x6: number[] = c('C1'); >x6 : number[] >c('C1') : number[] >c : C ->'C1' : string +>'C1' : "C1" var x7: boolean[] = c('C2'); >x7 : boolean[] >c('C2') : boolean[] >c : C ->'C2' : string +>'C2' : "C2" var x8: string = c('C'); >x8 : string >c('C') : string >c : C ->'C' : string +>'C' : "C" var x9: void = c('generic'); >x9 : void diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index a3eeecfe253..c8b307cb21c 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1183: An implementation cannot be declared in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1183: An implementation cannot be declared in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(16,2): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/externalModules/file1.d.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts. -==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (7 errors) ==== +==== tests/cases/conformance/externalModules/file1.d.ts (7 errors) ==== // Errors: Initializers & statements in declaration file diff --git a/tests/baselines/reference/initializersInDeclarations.js b/tests/baselines/reference/initializersInDeclarations.js deleted file mode 100644 index 0506c72fc56..00000000000 --- a/tests/baselines/reference/initializersInDeclarations.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [initializersInDeclarations.ts] - -// Errors: Initializers & statements in declaration file - -declare class Foo { - name = "test"; - "some prop" = 42; - fn(): boolean { - return false; - } -} - -declare var x = []; -declare var y = {}; - -declare module M1 { - while(true); - - export var v1 = () => false; -} - -//// [initializersInDeclarations.js] -// Errors: Initializers & statements in declaration file diff --git a/tests/baselines/reference/inlineSourceMap.sourcemap.txt b/tests/baselines/reference/inlineSourceMap.sourcemap.txt index 6625cc46b21..35bee4f1d4a 100644 --- a/tests/baselines/reference/inlineSourceMap.sourcemap.txt +++ b/tests/baselines/reference/inlineSourceMap.sourcemap.txt @@ -1,6 +1,6 @@ =================================================================== JsFile: inlineSourceMap.js -mapUrl: inlineSourceMap.js.map +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lU291cmNlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW5saW5lU291cmNlTWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== sourceRoot: sources: inlineSourceMap.ts =================================================================== diff --git a/tests/baselines/reference/inlineSourceMap2.errors.txt b/tests/baselines/reference/inlineSourceMap2.errors.txt index 24b0fddf942..26db1415593 100644 --- a/tests/baselines/reference/inlineSourceMap2.errors.txt +++ b/tests/baselines/reference/inlineSourceMap2.errors.txt @@ -1,12 +1,10 @@ error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'. tests/cases/compiler/inlineSourceMap2.ts(5,1): error TS2304: Cannot find name 'console'. !!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. !!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -!!! error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'. ==== tests/cases/compiler/inlineSourceMap2.ts (1 errors) ==== // configuration errors diff --git a/tests/baselines/reference/inlineSourceMap2.sourcemap.txt b/tests/baselines/reference/inlineSourceMap2.sourcemap.txt index 4d7f499b55a..e292a9b96b2 100644 --- a/tests/baselines/reference/inlineSourceMap2.sourcemap.txt +++ b/tests/baselines/reference/inlineSourceMap2.sourcemap.txt @@ -1,6 +1,6 @@ =================================================================== JsFile: outfile.js -mapUrl: file:///folder/outfile.js.map +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0ZmlsZS5qcyIsInNvdXJjZVJvb3QiOiJmaWxlOi8vL2ZvbGRlci8iLCJzb3VyY2VzIjpbImlubGluZVNvdXJjZU1hcDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdUJBQXVCO0FBRXZCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== sourceRoot: file:///folder/ sources: inlineSourceMap2.ts =================================================================== diff --git a/tests/baselines/reference/inlineSources2.sourcemap.txt b/tests/baselines/reference/inlineSources2.sourcemap.txt index e3e14d01e9e..e09af2f4221 100644 --- a/tests/baselines/reference/inlineSources2.sourcemap.txt +++ b/tests/baselines/reference/inlineSources2.sourcemap.txt @@ -1,6 +1,6 @@ =================================================================== JsFile: out.js -mapUrl: out.js.map +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdHMvY2FzZXMvY29tcGlsZXIvYS50cyIsInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQ0ZmLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbnZhciBhID0gMDtcbmNvbnNvbGUubG9nKGEpO1xuIiwidmFyIGIgPSAwO1xuY29uc29sZS5sb2coYik7Il19 sourceRoot: sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts sourcesContent: ["\nvar a = 0;\nconsole.log(a);\n","var b = 0;\nconsole.log(b);"] diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types index 971b5e56907..5288d9f15a4 100644 --- a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types @@ -3,13 +3,13 @@ interface Foo { >Foo : Foo (x: 'a'): number; ->x : 'a' +>x : "a" (x: string): any; >x : string new (x: 'a'): any; ->x : 'a' +>x : "a" new (x: string): Object; >x : string @@ -24,7 +24,7 @@ var r = f('a'); >r : number >f('a') : number >f : Foo ->'a' : string +>'a' : "a" var r2 = f('A'); >r2 : any @@ -36,7 +36,7 @@ var r3 = new f('a'); >r3 : any >new f('a') : any >f : Foo ->'a' : string +>'a' : "a" var r4 = new f('A'); >r4 : Object diff --git a/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt b/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt index bb8a5202bc5..e0eef7d892d 100644 --- a/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt +++ b/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/isolatedModulesAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided. +tests/cases/compiler/file1.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided. -==== tests/cases/compiler/isolatedModulesAmbientConstEnum.ts (1 errors) ==== +==== tests/cases/compiler/file1.ts (1 errors) ==== declare const enum E { X = 1} diff --git a/tests/baselines/reference/isolatedModulesAmbientConstEnum.js b/tests/baselines/reference/isolatedModulesAmbientConstEnum.js index 7742122b687..6d9fc540d9a 100644 --- a/tests/baselines/reference/isolatedModulesAmbientConstEnum.js +++ b/tests/baselines/reference/isolatedModulesAmbientConstEnum.js @@ -1,8 +1,8 @@ -//// [isolatedModulesAmbientConstEnum.ts] +//// [file1.ts] declare const enum E { X = 1} export var y; -//// [isolatedModulesAmbientConstEnum.js] +//// [file1.js] export var y; diff --git a/tests/baselines/reference/isolatedModulesDeclaration.errors.txt b/tests/baselines/reference/isolatedModulesDeclaration.errors.txt index 749e86116e8..2997acd58ac 100644 --- a/tests/baselines/reference/isolatedModulesDeclaration.errors.txt +++ b/tests/baselines/reference/isolatedModulesDeclaration.errors.txt @@ -2,6 +2,6 @@ error TS5053: Option 'declaration' cannot be specified with option 'isolatedModu !!! error TS5053: Option 'declaration' cannot be specified with option 'isolatedModules'. -==== tests/cases/compiler/isolatedModulesDeclaration.ts (0 errors) ==== +==== tests/cases/compiler/file1.ts (0 errors) ==== export var x; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesDeclaration.js b/tests/baselines/reference/isolatedModulesDeclaration.js index 12e6f23f92e..bb3e560a2f8 100644 --- a/tests/baselines/reference/isolatedModulesDeclaration.js +++ b/tests/baselines/reference/isolatedModulesDeclaration.js @@ -1,10 +1,10 @@ -//// [isolatedModulesDeclaration.ts] +//// [file1.ts] export var x; -//// [isolatedModulesDeclaration.js] +//// [file1.js] export var x; -//// [isolatedModulesDeclaration.d.ts] +//// [file1.d.ts] export declare var x: any; diff --git a/tests/baselines/reference/isolatedModulesES6.js b/tests/baselines/reference/isolatedModulesES6.js index eb2ee3ee33a..2963a9d694f 100644 --- a/tests/baselines/reference/isolatedModulesES6.js +++ b/tests/baselines/reference/isolatedModulesES6.js @@ -1,5 +1,5 @@ -//// [isolatedModulesES6.ts] +//// [file1.ts] export var x; -//// [isolatedModulesES6.js] +//// [file1.js] export var x; diff --git a/tests/baselines/reference/isolatedModulesES6.symbols b/tests/baselines/reference/isolatedModulesES6.symbols index c705cbc5af8..625dbfbe699 100644 --- a/tests/baselines/reference/isolatedModulesES6.symbols +++ b/tests/baselines/reference/isolatedModulesES6.symbols @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesES6.ts === +=== tests/cases/compiler/file1.ts === export var x; ->x : Symbol(x, Decl(isolatedModulesES6.ts, 0, 10)) +>x : Symbol(x, Decl(file1.ts, 0, 10)) diff --git a/tests/baselines/reference/isolatedModulesES6.types b/tests/baselines/reference/isolatedModulesES6.types index 898b9715ca4..27dca700bb9 100644 --- a/tests/baselines/reference/isolatedModulesES6.types +++ b/tests/baselines/reference/isolatedModulesES6.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesES6.ts === +=== tests/cases/compiler/file1.ts === export var x; >x : any diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt b/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt index 8c6881a9bc1..60d2ca987e4 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt +++ b/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/isolatedModulesImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'. -tests/cases/compiler/isolatedModulesImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'. -tests/cases/compiler/isolatedModulesImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'. -tests/cases/compiler/isolatedModulesImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'. +tests/cases/compiler/file1.ts(2,17): error TS2307: Cannot find module 'module'. +tests/cases/compiler/file1.ts(3,18): error TS2307: Cannot find module 'module'. +tests/cases/compiler/file1.ts(4,21): error TS2307: Cannot find module 'module'. +tests/cases/compiler/file1.ts(12,18): error TS2307: Cannot find module 'module'. -==== tests/cases/compiler/isolatedModulesImportExportElision.ts (4 errors) ==== +==== tests/cases/compiler/file1.ts (4 errors) ==== import {c} from "module" ~~~~~~~~ diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index 8cb65747e6f..4498b462e18 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -1,4 +1,4 @@ -//// [isolatedModulesImportExportElision.ts] +//// [file1.ts] import {c} from "module" import {c2} from "module" @@ -13,7 +13,7 @@ let y = ns.value; export {c1} from "module"; export var z = x; -//// [isolatedModulesImportExportElision.js] +//// [file1.js] var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } diff --git a/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt b/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt index 337fcb16ba3..2579ffc4a90 100644 --- a/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt +++ b/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt @@ -2,6 +2,6 @@ error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedMo !!! error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'. -==== tests/cases/compiler/isolatedModulesNoEmitOnError.ts (0 errors) ==== +==== tests/cases/compiler/file1.ts (0 errors) ==== export var x; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt b/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt index d00520a0618..29353b3284a 100644 --- a/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt +++ b/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/isolatedModulesNoExternalModule.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided. +tests/cases/compiler/file1.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided. -==== tests/cases/compiler/isolatedModulesNoExternalModule.ts (1 errors) ==== +==== tests/cases/compiler/file1.ts (1 errors) ==== var x; ~~~ diff --git a/tests/baselines/reference/isolatedModulesNoExternalModule.js b/tests/baselines/reference/isolatedModulesNoExternalModule.js index dd5d23a538c..52cdbaa1402 100644 --- a/tests/baselines/reference/isolatedModulesNoExternalModule.js +++ b/tests/baselines/reference/isolatedModulesNoExternalModule.js @@ -1,6 +1,6 @@ -//// [isolatedModulesNoExternalModule.ts] +//// [file1.ts] var x; -//// [isolatedModulesNoExternalModule.js] +//// [file1.js] var x; diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js index efdba17dc93..396fc597911 100644 --- a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js @@ -1,10 +1,10 @@ -//// [isolatedModulesNonAmbientConstEnum.ts] +//// [file1.ts] const enum E { X = 100 }; var e = E.X; export var x; -//// [isolatedModulesNonAmbientConstEnum.js] +//// [file1.js] var E; (function (E) { E[E["X"] = 100] = "X"; diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols index 5e30fd0b2ff..4755208b21a 100644 --- a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols @@ -1,15 +1,15 @@ -=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts === +=== tests/cases/compiler/file1.ts === const enum E { X = 100 }; ->E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0)) ->X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14)) +>E : Symbol(E, Decl(file1.ts, 0, 0)) +>X : Symbol(E.X, Decl(file1.ts, 1, 14)) var e = E.X; ->e : Symbol(e, Decl(isolatedModulesNonAmbientConstEnum.ts, 2, 3)) ->E.X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14)) ->E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0)) ->X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14)) +>e : Symbol(e, Decl(file1.ts, 2, 3)) +>E.X : Symbol(E.X, Decl(file1.ts, 1, 14)) +>E : Symbol(E, Decl(file1.ts, 0, 0)) +>X : Symbol(E.X, Decl(file1.ts, 1, 14)) export var x; ->x : Symbol(x, Decl(isolatedModulesNonAmbientConstEnum.ts, 3, 10)) +>x : Symbol(x, Decl(file1.ts, 3, 10)) diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types index d7e83b81070..4583a1c0730 100644 --- a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts === +=== tests/cases/compiler/file1.ts === const enum E { X = 100 }; >E : E diff --git a/tests/baselines/reference/isolatedModulesOut.js b/tests/baselines/reference/isolatedModulesOut.js index ca5eb2b7579..44f319e1031 100644 --- a/tests/baselines/reference/isolatedModulesOut.js +++ b/tests/baselines/reference/isolatedModulesOut.js @@ -6,7 +6,5 @@ export var x; //// [file2.ts] var y; -//// [file1.js] -export var x; //// [all.js] var y; diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js b/tests/baselines/reference/isolatedModulesSourceMap.js index 2722a3ce7ab..02d394752d1 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.js +++ b/tests/baselines/reference/isolatedModulesSourceMap.js @@ -1,7 +1,7 @@ -//// [isolatedModulesSourceMap.ts] +//// [file1.ts] export var x = 1; -//// [isolatedModulesSourceMap.js] +//// [file1.js] export var x = 1; -//# sourceMappingURL=isolatedModulesSourceMap.js.map \ No newline at end of file +//# sourceMappingURL=file1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js.map b/tests/baselines/reference/isolatedModulesSourceMap.js.map index 9fa3e0da0d6..3d86a0a7144 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.js.map +++ b/tests/baselines/reference/isolatedModulesSourceMap.js.map @@ -1,2 +1,2 @@ -//// [isolatedModulesSourceMap.js.map] -{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file +//// [file1.js.map] +{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt index d31445505f7..7edf071f5d1 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt +++ b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt @@ -1,12 +1,12 @@ =================================================================== -JsFile: isolatedModulesSourceMap.js -mapUrl: isolatedModulesSourceMap.js.map +JsFile: file1.js +mapUrl: file1.js.map sourceRoot: -sources: isolatedModulesSourceMap.ts +sources: file1.ts =================================================================== ------------------------------------------------------------------- -emittedFile:tests/cases/compiler/isolatedModulesSourceMap.js -sourceFile:isolatedModulesSourceMap.ts +emittedFile:tests/cases/compiler/file1.js +sourceFile:file1.ts ------------------------------------------------------------------- >>>export var x = 1; 1 > @@ -15,7 +15,7 @@ sourceFile:isolatedModulesSourceMap.ts 4 > ^^^ 5 > ^ 6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^-> 1 > > 2 >export var @@ -30,4 +30,4 @@ sourceFile:isolatedModulesSourceMap.ts 5 >Emitted(1, 17) Source(2, 17) + SourceIndex(0) 6 >Emitted(1, 18) Source(2, 18) + SourceIndex(0) --- ->>>//# sourceMappingURL=isolatedModulesSourceMap.js.map \ No newline at end of file +>>>//# sourceMappingURL=file1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.symbols b/tests/baselines/reference/isolatedModulesSourceMap.symbols index d4ae3c34cf1..2f2d16d8ad0 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.symbols +++ b/tests/baselines/reference/isolatedModulesSourceMap.symbols @@ -1,5 +1,5 @@ -=== tests/cases/compiler/isolatedModulesSourceMap.ts === +=== tests/cases/compiler/file1.ts === export var x = 1; ->x : Symbol(x, Decl(isolatedModulesSourceMap.ts, 1, 10)) +>x : Symbol(x, Decl(file1.ts, 1, 10)) diff --git a/tests/baselines/reference/isolatedModulesSourceMap.types b/tests/baselines/reference/isolatedModulesSourceMap.types index 1955fe5da6e..d2a474c023d 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.types +++ b/tests/baselines/reference/isolatedModulesSourceMap.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesSourceMap.ts === +=== tests/cases/compiler/file1.ts === export var x = 1; >x : number diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.js b/tests/baselines/reference/isolatedModulesSpecifiedModule.js index 95e4ec88d92..6d002e5a66e 100644 --- a/tests/baselines/reference/isolatedModulesSpecifiedModule.js +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.js @@ -1,4 +1,4 @@ -//// [isolatedModulesSpecifiedModule.ts] +//// [file1.ts] export var x; -//// [isolatedModulesSpecifiedModule.js] +//// [file1.js] diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols b/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols index 91ede682d7c..625dbfbe699 100644 --- a/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts === +=== tests/cases/compiler/file1.ts === export var x; ->x : Symbol(x, Decl(isolatedModulesSpecifiedModule.ts, 0, 10)) +>x : Symbol(x, Decl(file1.ts, 0, 10)) diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.types b/tests/baselines/reference/isolatedModulesSpecifiedModule.types index 8dee90a199f..27dca700bb9 100644 --- a/tests/baselines/reference/isolatedModulesSpecifiedModule.types +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts === +=== tests/cases/compiler/file1.ts === export var x; >x : any diff --git a/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt b/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt index 1abc6ca47d4..fbb2f0041d6 100644 --- a/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt +++ b/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt @@ -2,5 +2,5 @@ error TS5047: Option 'isolatedModules' can only be used when either option '--mo !!! error TS5047: Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher. -==== tests/cases/compiler/isolatedModulesUnspecifiedModule.ts (0 errors) ==== +==== tests/cases/compiler/file1.ts (0 errors) ==== export var x; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesUnspecifiedModule.js b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js index 68b9bfb62db..6d002e5a66e 100644 --- a/tests/baselines/reference/isolatedModulesUnspecifiedModule.js +++ b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js @@ -1,4 +1,4 @@ -//// [isolatedModulesUnspecifiedModule.ts] +//// [file1.ts] export var x; -//// [isolatedModulesUnspecifiedModule.js] +//// [file1.js] diff --git a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt new file mode 100644 index 00000000000..19bfd5d1c02 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + declare var v; + ~~~~~~~ +!!! error TS8009: 'declare' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.js b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.js new file mode 100644 index 00000000000..836b39380ea --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.js @@ -0,0 +1,18 @@ +//// [a.js] + +class c { + method(a) { + let x = a => this.method(a); + } +} + +//// [out.js] +var c = (function () { + function c() { + } + c.prototype.method = function (a) { + var _this = this; + var x = function (a) { return _this.method(a); }; + }; + return c; +})(); diff --git a/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.symbols b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.symbols new file mode 100644 index 00000000000..8db5aa87a5b --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/a.js === + +class c { +>c : Symbol(c, Decl(a.js, 0, 0)) + + method(a) { +>method : Symbol(method, Decl(a.js, 1, 9)) +>a : Symbol(a, Decl(a.js, 2, 11)) + + let x = a => this.method(a); +>x : Symbol(x, Decl(a.js, 3, 11)) +>a : Symbol(a, Decl(a.js, 3, 15)) +>this.method : Symbol(method, Decl(a.js, 1, 9)) +>this : Symbol(c, Decl(a.js, 0, 0)) +>method : Symbol(method, Decl(a.js, 1, 9)) +>a : Symbol(a, Decl(a.js, 3, 15)) + } +} diff --git a/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.types b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.types new file mode 100644 index 00000000000..f429cc88516 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationClassMethodContainingArrowFunction.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/a.js === + +class c { +>c : c + + method(a) { +>method : (a: any) => void +>a : any + + let x = a => this.method(a); +>x : (a: any) => void +>a => this.method(a) : (a: any) => void +>a : any +>this.method(a) : void +>this.method : (a: any) => void +>this : this +>method : (a: any) => void +>a : any + } +} diff --git a/tests/baselines/reference/jsFileCompilationDecoratorSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationDecoratorSyntax.errors.txt new file mode 100644 index 00000000000..a39d2e1665c --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDecoratorSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,1): error TS8017: 'decorators' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + @internal class C { } + ~~~~~~~~~ +!!! error TS8017: 'decorators' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt new file mode 100644 index 00000000000..b05fc6fa6d9 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt @@ -0,0 +1,17 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/b.js (0 errors) ==== + function foo() { + return 10; + } +==== tests/cases/compiler/a.ts (1 errors) ==== + function foo() { + ~~~ +!!! error TS2393: Duplicate function implementation. + return 30; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.js b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.js new file mode 100644 index 00000000000..9b644509361 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts] //// + +//// [b.js] +function foo() { + return 10; +} +//// [a.ts] +function foo() { + return 30; +} + + + +//// [out.js] +function foo() { + return 10; +} +function foo() { + return 30; +} + + +//// [out.d.ts] diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt new file mode 100644 index 00000000000..82dbc27db0f --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt @@ -0,0 +1,18 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (1 errors) ==== + function foo() { + ~~~ +!!! error TS2393: Duplicate function implementation. + return 30; + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function foo() { + return 10; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.js b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.js new file mode 100644 index 00000000000..d7965e91be1 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts] //// + +//// [a.ts] +function foo() { + return 30; +} + +//// [b.js] +function foo() { + return 10; +} + + + +//// [out.js] +function foo() { + return 30; +} +function foo() { + return 10; +} + + +//// [out.d.ts] diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt new file mode 100644 index 00000000000..f8ae4a1ba74 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt @@ -0,0 +1,9 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (0 errors) ==== + var x = 10; + +==== tests/cases/compiler/b.js (0 errors) ==== + var x = "hello"; // No error is recorded here and declaration file will show this as number \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.js b/tests/baselines/reference/jsFileCompilationDuplicateVariable.js new file mode 100644 index 00000000000..a70637bc7c0 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariable.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsFileCompilationDuplicateVariable.ts] //// + +//// [a.ts] +var x = 10; + +//// [b.js] +var x = "hello"; // No error is recorded here and declaration file will show this as number + +//// [out.js] +var x = 10; +var x = "hello"; // No error is recorded here and declaration file will show this as number + + +//// [out.d.ts] +declare var x: number; diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt new file mode 100644 index 00000000000..f1374d95767 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt @@ -0,0 +1,12 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/b.js (0 errors) ==== + var x = "hello"; + +==== tests/cases/compiler/a.ts (1 errors) ==== + var x = 10; // Error reported so no declaration file generated? + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js new file mode 100644 index 00000000000..fd9da7c7106 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts] //// + +//// [b.js] +var x = "hello"; + +//// [a.ts] +var x = 10; // Error reported so no declaration file generated? + +//// [out.js] +var x = "hello"; +var x = 10; // Error reported so no declaration file generated? + + +//// [out.d.ts] +declare var x: string; diff --git a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt new file mode 100644 index 00000000000..0aa9d5733d5 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt @@ -0,0 +1,19 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.ts (0 errors) ==== + // this should be emitted + class d { + } + +==== tests/cases/compiler/a.js (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.js b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.js new file mode 100644 index 00000000000..ea9c9f62b8d --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/jsFileCompilationEmitBlockedCorrectly.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +// this should be emitted +class d { +} + +//// [a.js] +function foo() { +} + + +//// [b.js] +// this should be emitted +var d = (function () { + function d() { + } + return d; +})(); diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt new file mode 100644 index 00000000000..3e89f9c9436 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt @@ -0,0 +1,12 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.js b/tests/baselines/reference/jsFileCompilationEmitDeclarations.js new file mode 100644 index 00000000000..d45ae325b0a --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitDeclarations.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/jsFileCompilationEmitDeclarations.ts] //// + +//// [a.ts] +class c { +} + +//// [b.js] +function foo() { +} + + +//// [out.js] +var c = (function () { + function c() { + } + return c; +})(); +function foo() { +} + + +//// [out.d.ts] +declare class c { +} diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt new file mode 100644 index 00000000000..0cefa2eedac --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt @@ -0,0 +1,16 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + /// + function foo() { + } + +==== tests/cases/compiler/c.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js new file mode 100644 index 00000000000..2d7d2743805 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts] //// + +//// [a.ts] +class c { +} + +//// [b.js] +/// +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [out.js] +var c = (function () { + function c() { + } + return c; +})(); +function bar() { +} +/// +function foo() { +} + + +//// [out.d.ts] +declare class c { +} diff --git a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt new file mode 100644 index 00000000000..538dfb38972 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + enum E { } + ~ +!!! error TS8015: 'enum declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt new file mode 100644 index 00000000000..641731936f8 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -0,0 +1,19 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.ts (0 errors) ==== + /// + // b.d.ts should have c.js as the reference path since we dont emit declarations for js files + function foo() { + } + +==== tests/cases/compiler/c.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.js b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.js new file mode 100644 index 00000000000..cf2caab3600 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.js @@ -0,0 +1,35 @@ +//// [tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//// [b.js] +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + + +//// [a.d.ts] +declare class c { +} +//// [b.d.ts] +/// +declare function foo(): void; diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt new file mode 100644 index 00000000000..44151401479 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt @@ -0,0 +1,17 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.ts (0 errors) ==== + /// + // error on above reference when emitting declarations + function foo() { + } + +==== tests/cases/compiler/c.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js new file mode 100644 index 00000000000..67989f3e3e7 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +/// +// error on above reference when emitting declarations +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [out.js] +var c = (function () { + function c() { + } + return c; +})(); +function bar() { +} +/// +// error on above reference when emitting declarations +function foo() { +} + + +//// [out.d.ts] +declare class c { +} +declare function foo(): void; diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt new file mode 100644 index 00000000000..fb6c801b42e --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt @@ -0,0 +1,17 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.ts (0 errors) ==== + /// + // b.d.ts should have c.js as the reference path since we dont emit declarations for js files + function foo() { + } + +==== tests/cases/compiler/c.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js new file mode 100644 index 00000000000..afed8cd42e3 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js @@ -0,0 +1,38 @@ +//// [tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//// [c.js] +function bar() { +} +//// [b.js] +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + + +//// [a.d.ts] +declare class c { +} +//// [b.d.ts] +/// +declare function foo(): void; diff --git a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt new file mode 100644 index 00000000000..f537941c55c --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + export = b; + ~~~~~~~~~~~ +!!! error TS8003: 'export=' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt new file mode 100644 index 00000000000..33b8a45f1aa --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + class C implements D { } + ~~~~~~~~~~~~ +!!! error TS8005: 'implements clauses' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt new file mode 100644 index 00000000000..b4161367037 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + import a = b; + ~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt new file mode 100644 index 00000000000..17fb8fcb187 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + interface I { } + ~ +!!! error TS8006: 'interface declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.js b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.js new file mode 100644 index 00000000000..c9e16f35981 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.js @@ -0,0 +1,13 @@ +//// [a.js] + +function foo(a) { + for (let a = 0; a < 10; a++) { + // do something + } +} + +//// [out.js] +function foo(a) { + for (var a_1 = 0; a_1 < 10; a_1++) { + } +} diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.symbols b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.symbols new file mode 100644 index 00000000000..6b0934c6591 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/a.js === + +function foo(a) { +>foo : Symbol(foo, Decl(a.js, 0, 0)) +>a : Symbol(a, Decl(a.js, 1, 13)) + + for (let a = 0; a < 10; a++) { +>a : Symbol(a, Decl(a.js, 2, 12)) +>a : Symbol(a, Decl(a.js, 2, 12)) +>a : Symbol(a, Decl(a.js, 2, 12)) + + // do something + } +} diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types new file mode 100644 index 00000000000..094f59d2022 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/a.js === + +function foo(a) { +>foo : (a: any) => void +>a : any + + for (let a = 0; a < 10; a++) { +>a : number +>0 : number +>a < 10 : boolean +>a : number +>10 : number +>a++ : number +>a : number + + // do something + } +} diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt new file mode 100644 index 00000000000..20a9c81ea9c --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt @@ -0,0 +1,12 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/b.js (0 errors) ==== + let a = 10; + b = 30; + +==== tests/cases/compiler/a.ts (0 errors) ==== + let b = 30; + a = 10; + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.js b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.js new file mode 100644 index 00000000000..16e4b7a3011 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts] //// + +//// [b.js] +let a = 10; +b = 30; + +//// [a.ts] +let b = 30; +a = 10; + + +//// [out.js] +var a = 10; +b = 30; +var b = 30; +a = 10; + + +//// [out.d.ts] +declare let b: number; diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt new file mode 100644 index 00000000000..b88c73e0439 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt @@ -0,0 +1,14 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used before its declaration. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== tests/cases/compiler/a.ts (1 errors) ==== + let b = 30; + a = 10; + ~ +!!! error TS2448: Block-scoped variable 'a' used before its declaration. +==== tests/cases/compiler/b.js (0 errors) ==== + let a = 10; + b = 30; + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.js b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.js new file mode 100644 index 00000000000..890b1c22f71 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts] //// + +//// [a.ts] +let b = 30; +a = 10; +//// [b.js] +let a = 10; +b = 30; + + +//// [out.js] +var b = 30; +a = 10; +var a = 10; +b = 30; + + +//// [out.d.ts] +declare let b: number; diff --git a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt new file mode 100644 index 00000000000..662028c53ed --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + module M { } + ~ +!!! error TS8007: 'module declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt new file mode 100644 index 00000000000..f2f4142b993 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -0,0 +1,17 @@ +error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.ts (0 errors) ==== + /// + // no error on above reference path since not emitting declarations + function foo() { + } + +==== tests/cases/compiler/c.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.js b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.js new file mode 100644 index 00000000000..2d844207986 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +/// +// no error on above reference path since not emitting declarations +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//// [b.js] +/// +// no error on above reference path since not emitting declarations +function foo() { +} diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.js b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.js new file mode 100644 index 00000000000..fae4936b6c9 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.ts] +/// +//no error on above reference since not emitting declarations +function foo() { +} + +//// [c.js] +function bar() { +} + +//// [out.js] +var c = (function () { + function c() { + } + return c; +})(); +function bar() { +} +/// +//no error on above reference since not emitting declarations +function foo() { +} diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.symbols b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.symbols new file mode 100644 index 00000000000..2f3cf3e0785 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class c { +>c : Symbol(c, Decl(a.ts, 0, 0)) +} + +=== tests/cases/compiler/b.ts === +/// +//no error on above reference since not emitting declarations +function foo() { +>foo : Symbol(foo, Decl(b.ts, 0, 0)) +} + +=== tests/cases/compiler/c.js === +function bar() { +>bar : Symbol(bar, Decl(c.js, 0, 0)) +} diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.types b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.types new file mode 100644 index 00000000000..cd9a6dfafba --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class c { +>c : c +} + +=== tests/cases/compiler/b.ts === +/// +//no error on above reference since not emitting declarations +function foo() { +>foo : () => void +} + +=== tests/cases/compiler/c.js === +function bar() { +>bar : () => void +} diff --git a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt new file mode 100644 index 00000000000..295f827dd2d --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + function F(p?) { } + ~ +!!! error TS8009: '?' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationPropertySyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationPropertySyntaxOfClass.errors.txt new file mode 100644 index 00000000000..fd5ea666459 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationPropertySyntaxOfClass.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,11): error TS8014: 'property declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + class C { v } + ~ +!!! error TS8014: 'property declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt new file mode 100644 index 00000000000..d67c9baea70 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt @@ -0,0 +1,12 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + class C { + public foo() { + ~~~~~~ +!!! error TS8009: 'public' can only be used in a .ts file. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt new file mode 100644 index 00000000000..bc4913f6217 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + class C { constructor(public x) { }} + ~~~~~~ +!!! error TS8012: 'parameter modifiers' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationRestParameter.js b/tests/baselines/reference/jsFileCompilationRestParameter.js new file mode 100644 index 00000000000..bcba97af024 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationRestParameter.js @@ -0,0 +1,5 @@ +//// [a.js] +function foo(...a) { } + +//// [b.js] +function foo(...a) { } diff --git a/tests/baselines/reference/jsFileCompilationRestParameter.symbols b/tests/baselines/reference/jsFileCompilationRestParameter.symbols new file mode 100644 index 00000000000..4ce7529b83d --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationRestParameter.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/a.js === +function foo(...a) { } +>foo : Symbol(foo, Decl(a.js, 0, 0)) +>a : Symbol(a, Decl(a.js, 0, 13)) + diff --git a/tests/baselines/reference/jsFileCompilationRestParameter.types b/tests/baselines/reference/jsFileCompilationRestParameter.types new file mode 100644 index 00000000000..54d0ec8631f --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationRestParameter.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/a.js === +function foo(...a) { } +>foo : (...a: any[]) => void +>a : any[] + diff --git a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt new file mode 100644 index 00000000000..6dad5a29485 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + function F(): number { } + ~~~~~~ +!!! error TS8010: 'types' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.js b/tests/baselines/reference/jsFileCompilationShortHandProperty.js new file mode 100644 index 00000000000..1dc269146a6 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.js @@ -0,0 +1,20 @@ +//// [a.js] + +function foo() { + var a = 10; + var b = "Hello"; + return { + a, + b + }; +} + +//// [out.js] +function foo() { + var a = 10; + var b = "Hello"; + return { + a: a, + b: b + }; +} diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.symbols b/tests/baselines/reference/jsFileCompilationShortHandProperty.symbols new file mode 100644 index 00000000000..fb42d121c80 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/a.js === + +function foo() { +>foo : Symbol(foo, Decl(a.js, 0, 0)) + + var a = 10; +>a : Symbol(a, Decl(a.js, 2, 7)) + + var b = "Hello"; +>b : Symbol(b, Decl(a.js, 3, 7)) + + return { + a, +>a : Symbol(a, Decl(a.js, 4, 12)) + + b +>b : Symbol(b, Decl(a.js, 5, 10)) + + }; +} diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.types b/tests/baselines/reference/jsFileCompilationShortHandProperty.types new file mode 100644 index 00000000000..e4dd1755ceb --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.types @@ -0,0 +1,24 @@ +=== tests/cases/compiler/a.js === + +function foo() { +>foo : () => { a: number; b: string; } + + var a = 10; +>a : number +>10 : number + + var b = "Hello"; +>b : string +>"Hello" : string + + return { +>{ a, b } : { a: number; b: string; } + + a, +>a : number + + b +>b : string + + }; +} diff --git a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt new file mode 100644 index 00000000000..6e55ff30f04 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt @@ -0,0 +1,14 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(3,6): error TS1223: 'type' tag already specified. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + /** + * @type {number} + * @type {string} + ~~~~ +!!! error TS1223: 'type' tag already specified. + */ + var v; + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt new file mode 100644 index 00000000000..bc4d8e903ad --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,1): error TS8008: 'type aliases' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + type a = b; + ~~~~~~~~~~~ +!!! error TS8008: 'type aliases' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt new file mode 100644 index 00000000000..8ac59196ed9 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + Foo(); + ~~~~~~ +!!! error TS8011: 'type arguments' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt new file mode 100644 index 00000000000..e73ee46fb89 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,10): error TS8016: 'type assertion expressions' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + var v = undefined; + ~~~~~~ +!!! error TS8016: 'type assertion expressions' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt new file mode 100644 index 00000000000..680b32a64f1 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + function F(a: number) { } + ~~~~~~ +!!! error TS8010: 'types' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt new file mode 100644 index 00000000000..161c832ffd5 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + class C { } + ~ +!!! error TS8004: 'type parameter declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt new file mode 100644 index 00000000000..d7626f68564 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + function F() { } + ~ +!!! error TS8004: 'type parameter declarations' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt new file mode 100644 index 00000000000..2c6ac3771be --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt @@ -0,0 +1,9 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +==== tests/cases/compiler/a.js (1 errors) ==== + var v: () => number; + ~~~~~~~~~~~~ +!!! error TS8010: 'types' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt new file mode 100644 index 00000000000..84900bccc88 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt @@ -0,0 +1,10 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/a.d.ts (0 errors) ==== + declare function isC(): boolean; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.js b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.js new file mode 100644 index 00000000000..a7ba8b49985 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsFileCompilationWithDeclarationEmitPathSameAsInput.ts] //// + +//// [a.ts] +class c { +} + +//// [a.d.ts] +declare function isC(): boolean; + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); diff --git a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt new file mode 100644 index 00000000000..4cc2cc2ab45 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt @@ -0,0 +1,14 @@ +error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/a.js (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt new file mode 100644 index 00000000000..06186b9f0b2 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt @@ -0,0 +1,18 @@ +error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. +==== tests/cases/compiler/a.ts (0 errors) ==== + + class c { + } + +==== tests/cases/compiler/b.js.map (0 errors) ==== + function foo() { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js new file mode 100644 index 00000000000..a5351de087c --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts] //// + +//// [a.ts] + +class c { +} + +//// [b.js.map] +function foo() { +} + +//// [b.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//# sourceMappingURL=a.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js.map b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js.map new file mode 100644 index 00000000000..8692bc0bab3 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.js.map @@ -0,0 +1,2 @@ +//// [a.js.map] +{"version":3,"file":"a.js","sourceRoot":"","sources":["a.ts"],"names":["c","c.constructor"],"mappings":"AACA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.sourcemap.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.sourcemap.txt new file mode 100644 index 00000000000..bba59e2b178 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.sourcemap.txt @@ -0,0 +1,58 @@ +=================================================================== +JsFile: a.js +mapUrl: a.js.map +sourceRoot: +sources: a.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/a.js +sourceFile:a.ts +------------------------------------------------------------------- +>>>var c = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function c() { +1->^^^^ +2 > ^^-> +1-> +1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) name (c) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class c { + > +2 > } +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c.constructor) +2 >Emitted(3, 6) Source(3, 2) + SourceIndex(0) name (c.constructor) +--- +>>> return c; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(4, 13) Source(3, 2) + SourceIndex(0) name (c) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c { + > } +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) name (c) +3 >Emitted(5, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(5, 6) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=a.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt new file mode 100644 index 00000000000..06186b9f0b2 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt @@ -0,0 +1,18 @@ +error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. +==== tests/cases/compiler/a.ts (0 errors) ==== + + class c { + } + +==== tests/cases/compiler/b.js.map (0 errors) ==== + function foo() { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js new file mode 100644 index 00000000000..e89e5d61e42 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.ts] //// + +//// [a.ts] + +class c { +} + +//// [b.js.map] +function foo() { +} + +//// [b.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImEudHMiXSwibmFtZXMiOlsiYyIsImMuY29uc3RydWN0b3IiXSwibWFwcGluZ3MiOiJBQUNBO0lBQUFBO0lBQ0FDLENBQUNBO0lBQURELFFBQUNBO0FBQURBLENBQUNBLEFBREQsSUFDQyJ9 \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt new file mode 100644 index 00000000000..ed64295bcb8 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt @@ -0,0 +1,58 @@ +=================================================================== +JsFile: a.js +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImEudHMiXSwibmFtZXMiOlsiYyIsImMuY29uc3RydWN0b3IiXSwibWFwcGluZ3MiOiJBQUNBO0lBQUFBO0lBQ0FDLENBQUNBO0lBQURELFFBQUNBO0FBQURBLENBQUNBLEFBREQsSUFDQyJ9 +sourceRoot: +sources: a.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/a.js +sourceFile:a.ts +------------------------------------------------------------------- +>>>var c = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function c() { +1->^^^^ +2 > ^^-> +1-> +1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) name (c) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class c { + > +2 > } +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c.constructor) +2 >Emitted(3, 6) Source(3, 2) + SourceIndex(0) name (c.constructor) +--- +>>> return c; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(4, 13) Source(3, 2) + SourceIndex(0) name (c) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c { + > } +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) name (c) +3 >Emitted(5, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(5, 6) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImEudHMiXSwibmFtZXMiOlsiYyIsImMuY29uc3RydWN0b3IiXSwibWFwcGluZ3MiOiJBQUNBO0lBQUFBO0lBQ0FDLENBQUNBO0lBQURELFFBQUNBO0FBQURBLENBQUNBLEFBREQsSUFDQyJ9 \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.errors.txt new file mode 100644 index 00000000000..c9a4408f423 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.errors.txt @@ -0,0 +1,18 @@ +error TS6054: File 'tests/cases/compiler/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. + + +!!! error TS6054: File 'tests/cases/compiler/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +==== tests/cases/compiler/a.ts (0 errors) ==== + + class c { + } + +==== tests/cases/compiler/b.js.map (0 errors) ==== + function foo() { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function bar() { + } \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js new file mode 100644 index 00000000000..742e7af2799 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithOutDir.ts] //// + +//// [a.ts] + +class c { +} + +//// [b.js.map] +function foo() { +} + +//// [b.js] +function bar() { +} + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); +//# sourceMappingURL=a.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js.map b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js.map new file mode 100644 index 00000000000..9a3b0f30f85 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js.map @@ -0,0 +1,2 @@ +//// [a.js.map] +{"version":3,"file":"a.js","sourceRoot":"","sources":["../tests/cases/compiler/a.ts"],"names":["c","c.constructor"],"mappings":"AACA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt new file mode 100644 index 00000000000..32a123d434d --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt @@ -0,0 +1,58 @@ +=================================================================== +JsFile: a.js +mapUrl: a.js.map +sourceRoot: +sources: ../tests/cases/compiler/a.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:out/a.js +sourceFile:../tests/cases/compiler/a.ts +------------------------------------------------------------------- +>>>var c = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function c() { +1->^^^^ +2 > ^^-> +1-> +1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) name (c) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class c { + > +2 > } +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c.constructor) +2 >Emitted(3, 6) Source(3, 2) + SourceIndex(0) name (c.constructor) +--- +>>> return c; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(4, 13) Source(3, 2) + SourceIndex(0) name (c) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c { + > } +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) name (c) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) name (c) +3 >Emitted(5, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(5, 6) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=a.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithOut.js b/tests/baselines/reference/jsFileCompilationWithOut.js new file mode 100644 index 00000000000..32d0261061f --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOut.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/jsFileCompilationWithOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.js] +function foo() { +} + + +//// [out.js] +var c = (function () { + function c() { + } + return c; +})(); +function foo() { +} diff --git a/tests/baselines/reference/jsFileCompilationWithOut.symbols b/tests/baselines/reference/jsFileCompilationWithOut.symbols new file mode 100644 index 00000000000..5260b8d6cf3 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOut.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/a.ts === +class c { +>c : Symbol(c, Decl(a.ts, 0, 0)) +} + +=== tests/cases/compiler/b.js === +function foo() { +>foo : Symbol(foo, Decl(b.js, 0, 0)) +} + diff --git a/tests/baselines/reference/jsFileCompilationWithOut.types b/tests/baselines/reference/jsFileCompilationWithOut.types new file mode 100644 index 00000000000..dce83eeb8eb --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOut.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/a.ts === +class c { +>c : c +} + +=== tests/cases/compiler/b.js === +function foo() { +>foo : () => void +} + diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt new file mode 100644 index 00000000000..826f906538f --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt @@ -0,0 +1,10 @@ +error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'b.d.ts' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.d.ts (0 errors) ==== + declare function foo(): boolean; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js new file mode 100644 index 00000000000..d3b2f788d66 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts] //// + +//// [a.ts] +class c { +} + +//// [b.d.ts] +declare function foo(): boolean; + +//// [b.js] +var c = (function () { + function c() { + } + return c; +})(); diff --git a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt new file mode 100644 index 00000000000..0f6852b21a0 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt @@ -0,0 +1,12 @@ +error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithoutJsExtensions.errors.txt b/tests/baselines/reference/jsFileCompilationWithoutJsExtensions.errors.txt new file mode 100644 index 00000000000..0b1a757d4fd --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithoutJsExtensions.errors.txt @@ -0,0 +1,6 @@ +error TS6054: File 'tests/cases/compiler/a.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. + + +!!! error TS6054: File 'tests/cases/compiler/a.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +==== tests/cases/compiler/a.js (0 errors) ==== + declare var v; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt new file mode 100644 index 00000000000..0f6852b21a0 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt @@ -0,0 +1,12 @@ +error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + + +!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +==== tests/cases/compiler/a.ts (0 errors) ==== + class c { + } + +==== tests/cases/compiler/b.js (0 errors) ==== + function foo() { + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.js b/tests/baselines/reference/jsFileCompilationWithoutOut.js new file mode 100644 index 00000000000..4a60c54c3ab --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationWithoutOut.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/jsFileCompilationWithoutOut.ts] //// + +//// [a.ts] +class c { +} + +//// [b.js] +function foo() { +} + + +//// [a.js] +var c = (function () { + function c() { + } + return c; +})(); diff --git a/tests/baselines/reference/keywordInJsxIdentifier.js b/tests/baselines/reference/keywordInJsxIdentifier.js index 677a79138e6..39f33449dad 100644 --- a/tests/baselines/reference/keywordInJsxIdentifier.js +++ b/tests/baselines/reference/keywordInJsxIdentifier.js @@ -9,6 +9,6 @@ declare var React: any; //// [keywordInJsxIdentifier.js] React.createElement("foo", {"class-id": true}); -React.createElement("foo", {"class": true}); +React.createElement("foo", {class: true}); React.createElement("foo", {"class-id": "1"}); -React.createElement("foo", {"class": "1"}); +React.createElement("foo", {class: "1"}); diff --git a/tests/baselines/reference/literalsInComputedProperties1.errors.txt b/tests/baselines/reference/literalsInComputedProperties1.errors.txt new file mode 100644 index 00000000000..e9972229f79 --- /dev/null +++ b/tests/baselines/reference/literalsInComputedProperties1.errors.txt @@ -0,0 +1,66 @@ +tests/cases/compiler/literalsInComputedProperties1.ts(40,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/literalsInComputedProperties1.ts(41,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/literalsInComputedProperties1.ts(42,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/literalsInComputedProperties1.ts(43,5): error TS2452: An enum member cannot have a numeric name. + + +==== tests/cases/compiler/literalsInComputedProperties1.ts (4 errors) ==== + + let x = { + 1:1, + [2]:1, + "3":1, + ["4"]:1 + } + x[1].toExponential(); + x[2].toExponential(); + x[3].toExponential(); + x[4].toExponential(); + + interface A { + 1:number; + [2]:number; + "3":number; + ["4"]:number; + } + + let y:A; + y[1].toExponential(); + y[2].toExponential(); + y[3].toExponential(); + y[4].toExponential(); + + class C { + 1:number; + [2]:number; + "3":number; + ["4"]:number; + } + + let z:C; + z[1].toExponential(); + z[2].toExponential(); + z[3].toExponential(); + z[4].toExponential(); + + enum X { + 1 = 1, + ~ +!!! error TS2452: An enum member cannot have a numeric name. + [2] = 2, + ~~~ +!!! error TS2452: An enum member cannot have a numeric name. + "3" = 3, + ~~~ +!!! error TS2452: An enum member cannot have a numeric name. + ["4"] = 4, + ~~~~~ +!!! error TS2452: An enum member cannot have a numeric name. + "foo" = 5, + ["bar"] = 6 + } + + let a = X["foo"]; + let a0 = X["bar"]; + + // TODO: make sure that enum still disallow template literals as member names \ No newline at end of file diff --git a/tests/baselines/reference/literalsInComputedProperties1.js b/tests/baselines/reference/literalsInComputedProperties1.js new file mode 100644 index 00000000000..ef11dbff6ea --- /dev/null +++ b/tests/baselines/reference/literalsInComputedProperties1.js @@ -0,0 +1,94 @@ +//// [literalsInComputedProperties1.ts] + +let x = { + 1:1, + [2]:1, + "3":1, + ["4"]:1 +} +x[1].toExponential(); +x[2].toExponential(); +x[3].toExponential(); +x[4].toExponential(); + +interface A { + 1:number; + [2]:number; + "3":number; + ["4"]:number; +} + +let y:A; +y[1].toExponential(); +y[2].toExponential(); +y[3].toExponential(); +y[4].toExponential(); + +class C { + 1:number; + [2]:number; + "3":number; + ["4"]:number; +} + +let z:C; +z[1].toExponential(); +z[2].toExponential(); +z[3].toExponential(); +z[4].toExponential(); + +enum X { + 1 = 1, + [2] = 2, + "3" = 3, + ["4"] = 4, + "foo" = 5, + ["bar"] = 6 +} + +let a = X["foo"]; +let a0 = X["bar"]; + +// TODO: make sure that enum still disallow template literals as member names + +//// [literalsInComputedProperties1.js] +var x = (_a = { + 1: 1 + }, + _a[2] = 1, + _a["3"] = 1, + _a["4"] = 1, + _a +); +x[1].toExponential(); +x[2].toExponential(); +x[3].toExponential(); +x[4].toExponential(); +var y; +y[1].toExponential(); +y[2].toExponential(); +y[3].toExponential(); +y[4].toExponential(); +var C = (function () { + function C() { + } + return C; +})(); +var z; +z[1].toExponential(); +z[2].toExponential(); +z[3].toExponential(); +z[4].toExponential(); +var X; +(function (X) { + X[X["1"] = 1] = "1"; + X[X[2] = 2] = 2; + X[X["3"] = 3] = "3"; + X[X["4"] = 4] = "4"; + X[X["foo"] = 5] = "foo"; + X[X["bar"] = 6] = "bar"; +})(X || (X = {})); +var a = X["foo"]; +var a0 = X["bar"]; +var _a; +// TODO: make sure that enum still disallow template literals as member names diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.types b/tests/baselines/reference/memberFunctionsWithPublicOverloads.types index 7cbc2aca1ff..bcd937e9cfc 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicOverloads.types +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.types @@ -17,20 +17,20 @@ class C { >y : any public bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } ->x : 'hi' +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } +>x : "hi" public bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : string public bar(x: number, y: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : number >y : string public bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : any >y : any @@ -49,20 +49,20 @@ class C { >y : any public static bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } ->x : 'hi' +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } +>x : "hi" public static bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : string public static bar(x: number, y: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : number >y : string public static bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : any >y : any } @@ -88,22 +88,22 @@ class D { >y : any public bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; } ->x : 'hi' +>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; } +>x : "hi" public bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; } >x : string public bar(x: T, y: T); ->bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; } >x : T >T : T >y : T >T : T public bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: T, y: T): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: T, y: T): any; } >x : any >y : any @@ -122,20 +122,20 @@ class D { >y : any public static bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } ->x : 'hi' +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } +>x : "hi" public static bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : string public static bar(x: number, y: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : number >y : string public static bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : { (x: "hi"): any; (x: string): any; (x: number, y: string): any; } >x : any >y : any diff --git a/tests/baselines/reference/mixedStaticAndInstanceClassMembers.errors.txt b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.errors.txt new file mode 100644 index 00000000000..d52b17a58a0 --- /dev/null +++ b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.errors.txt @@ -0,0 +1,27 @@ +tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts(4,5): error TS2387: Function overload must be static. +tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts(12,12): error TS2388: Function overload must not be static. +tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts(13,5): error TS2387: Function overload must be static. + + +==== tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts (3 errors) ==== + class A { + f() {} + static m1 (a: string): void; + m1 (a: number): void; + ~~ +!!! error TS2387: Function overload must be static. + m1 (a: any): void { + } + } + + class B { + f() {} + m1 (a: string): void; + static m1 (a: number): void; + ~~ +!!! error TS2388: Function overload must not be static. + m1 (a: any): void { + ~~ +!!! error TS2387: Function overload must be static. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js new file mode 100644 index 00000000000..427bbf65aa1 --- /dev/null +++ b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js @@ -0,0 +1,34 @@ +//// [mixedStaticAndInstanceClassMembers.ts] +class A { + f() {} + static m1 (a: string): void; + m1 (a: number): void; + m1 (a: any): void { + } +} + +class B { + f() {} + m1 (a: string): void; + static m1 (a: number): void; + m1 (a: any): void { + } +} + +//// [mixedStaticAndInstanceClassMembers.js] +var A = (function () { + function A() { + } + A.prototype.f = function () { }; + A.prototype.m1 = function (a) { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.f = function () { }; + B.prototype.m1 = function (a) { + }; + return B; +})(); diff --git a/tests/baselines/reference/moduledecl.errors.txt b/tests/baselines/reference/moduledecl.errors.txt deleted file mode 100644 index 2ef60f058c2..00000000000 --- a/tests/baselines/reference/moduledecl.errors.txt +++ /dev/null @@ -1,241 +0,0 @@ -tests/cases/compiler/moduledecl.ts(164,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/moduledecl.ts(172,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - - -==== 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() { - ~~ -!!! error TS1056: 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() { - ~~ -!!! error TS1056: 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/moduledecl.js b/tests/baselines/reference/moduledecl.js index ef3b9a2965c..f835729dc4d 100644 --- a/tests/baselines/reference/moduledecl.js +++ b/tests/baselines/reference/moduledecl.js @@ -1,4 +1,5 @@ //// [moduledecl.ts] + module a { } diff --git a/tests/baselines/reference/moduledecl.symbols b/tests/baselines/reference/moduledecl.symbols new file mode 100644 index 00000000000..178c406f8cd --- /dev/null +++ b/tests/baselines/reference/moduledecl.symbols @@ -0,0 +1,536 @@ +=== tests/cases/compiler/moduledecl.ts === + +module a { +>a : Symbol(a, Decl(moduledecl.ts, 0, 0)) +} + +module b.a { +>b : Symbol(b, Decl(moduledecl.ts, 2, 1)) +>a : Symbol(a, Decl(moduledecl.ts, 4, 9)) +} + +module c.a.b { +>c : Symbol(c, Decl(moduledecl.ts, 5, 1)) +>a : Symbol(a, Decl(moduledecl.ts, 7, 9)) +>b : Symbol(ma.b, Decl(moduledecl.ts, 7, 11)) + + import ma = a; +>ma : Symbol(ma, Decl(moduledecl.ts, 7, 14)) +>a : Symbol(ma, Decl(moduledecl.ts, 7, 9)) +} + +module mImport { +>mImport : Symbol(mImport, Decl(moduledecl.ts, 9, 1)) + + import d = a; +>d : Symbol(d, Decl(moduledecl.ts, 11, 16)) +>a : Symbol(d, Decl(moduledecl.ts, 0, 0)) + + import e = b.a; +>e : Symbol(e, Decl(moduledecl.ts, 12, 17)) +>b : Symbol(b, Decl(moduledecl.ts, 2, 1)) +>a : Symbol(e, Decl(moduledecl.ts, 4, 9)) + + import d1 = a; +>d1 : Symbol(d1, Decl(moduledecl.ts, 13, 19)) +>a : Symbol(d, Decl(moduledecl.ts, 0, 0)) + + import e1 = b.a; +>e1 : Symbol(e1, Decl(moduledecl.ts, 14, 18)) +>b : Symbol(b, Decl(moduledecl.ts, 2, 1)) +>a : Symbol(e, Decl(moduledecl.ts, 4, 9)) +} + +module m0 { +>m0 : Symbol(m0, Decl(moduledecl.ts, 16, 1)) + + function f1() { +>f1 : Symbol(f1, Decl(moduledecl.ts, 18, 11)) + } + + function f2(s: string); +>f2 : Symbol(f2, Decl(moduledecl.ts, 20, 5), Decl(moduledecl.ts, 22, 27), Decl(moduledecl.ts, 23, 27)) +>s : Symbol(s, Decl(moduledecl.ts, 22, 16)) + + function f2(n: number); +>f2 : Symbol(f2, Decl(moduledecl.ts, 20, 5), Decl(moduledecl.ts, 22, 27), Decl(moduledecl.ts, 23, 27)) +>n : Symbol(n, Decl(moduledecl.ts, 23, 16)) + + function f2(ns: any) { +>f2 : Symbol(f2, Decl(moduledecl.ts, 20, 5), Decl(moduledecl.ts, 22, 27), Decl(moduledecl.ts, 23, 27)) +>ns : Symbol(ns, Decl(moduledecl.ts, 24, 16)) + } + + class c1 { +>c1 : Symbol(c1, Decl(moduledecl.ts, 25, 5)) + + public a : ()=>string; +>a : Symbol(a, Decl(moduledecl.ts, 27, 14)) + + private b: ()=>number; +>b : Symbol(b, Decl(moduledecl.ts, 28, 30)) + + private static s1; +>s1 : Symbol(c1.s1, Decl(moduledecl.ts, 29, 30)) + + public static s2; +>s2 : Symbol(c1.s2, Decl(moduledecl.ts, 30, 26)) + } + + interface i1 { +>i1 : Symbol(i1, Decl(moduledecl.ts, 32, 5)) + + () : Object; +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + [n: number]: c1; +>n : Symbol(n, Decl(moduledecl.ts, 36, 9)) +>c1 : Symbol(c1, Decl(moduledecl.ts, 25, 5)) + } + + import m2 = a; +>m2 : Symbol(m2, Decl(moduledecl.ts, 37, 5)) +>a : Symbol(m2, Decl(moduledecl.ts, 0, 0)) + + import m3 = b; +>m3 : Symbol(m3, Decl(moduledecl.ts, 39, 18)) +>b : Symbol(m3, Decl(moduledecl.ts, 2, 1)) + + import m4 = b.a; +>m4 : Symbol(m4, Decl(moduledecl.ts, 40, 18)) +>b : Symbol(m3, Decl(moduledecl.ts, 2, 1)) +>a : Symbol(m3.a, Decl(moduledecl.ts, 4, 9)) + + import m5 = c; +>m5 : Symbol(m5, Decl(moduledecl.ts, 41, 20)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) + + import m6 = c.a; +>m6 : Symbol(m6, Decl(moduledecl.ts, 42, 18)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) +>a : Symbol(m5.a, Decl(moduledecl.ts, 7, 9)) + + import m7 = c.a.b; +>m7 : Symbol(m7, Decl(moduledecl.ts, 43, 20)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) +>a : Symbol(m5.a, Decl(moduledecl.ts, 7, 9)) +>b : Symbol(m6.b, Decl(moduledecl.ts, 7, 11)) +} + +module m1 { +>m1 : Symbol(m1, Decl(moduledecl.ts, 45, 1)) + + export function f1() { +>f1 : Symbol(f1, Decl(moduledecl.ts, 47, 11)) + } + + export function f2(s: string); +>f2 : Symbol(f2, Decl(moduledecl.ts, 49, 5), Decl(moduledecl.ts, 51, 34), Decl(moduledecl.ts, 52, 34)) +>s : Symbol(s, Decl(moduledecl.ts, 51, 23)) + + export function f2(n: number); +>f2 : Symbol(f2, Decl(moduledecl.ts, 49, 5), Decl(moduledecl.ts, 51, 34), Decl(moduledecl.ts, 52, 34)) +>n : Symbol(n, Decl(moduledecl.ts, 52, 23)) + + export function f2(ns: any) { +>f2 : Symbol(f2, Decl(moduledecl.ts, 49, 5), Decl(moduledecl.ts, 51, 34), Decl(moduledecl.ts, 52, 34)) +>ns : Symbol(ns, Decl(moduledecl.ts, 53, 23)) + } + + export class c1 { +>c1 : Symbol(c1, Decl(moduledecl.ts, 54, 5)) + + public a: () =>string; +>a : Symbol(a, Decl(moduledecl.ts, 56, 21)) + + private b: () =>number; +>b : Symbol(b, Decl(moduledecl.ts, 57, 30)) + + private static s1; +>s1 : Symbol(c1.s1, Decl(moduledecl.ts, 58, 31)) + + public static s2; +>s2 : Symbol(c1.s2, Decl(moduledecl.ts, 59, 26)) + + public d() { +>d : Symbol(d, Decl(moduledecl.ts, 60, 25)) + + return "Hello"; + } + + public e: { x: number; y: string; }; +>e : Symbol(e, Decl(moduledecl.ts, 64, 9)) +>x : Symbol(x, Decl(moduledecl.ts, 66, 19)) +>y : Symbol(y, Decl(moduledecl.ts, 66, 30)) + + constructor (public n, public n2: number, private n3, private n4: string) { +>n : Symbol(n, Decl(moduledecl.ts, 67, 21)) +>n2 : Symbol(n2, Decl(moduledecl.ts, 67, 30)) +>n3 : Symbol(n3, Decl(moduledecl.ts, 67, 49)) +>n4 : Symbol(n4, Decl(moduledecl.ts, 67, 61)) + } + } + + export interface i1 { +>i1 : Symbol(i1, Decl(moduledecl.ts, 69, 5)) + + () : Object; +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + [n: number]: c1; +>n : Symbol(n, Decl(moduledecl.ts, 73, 9)) +>c1 : Symbol(c1, Decl(moduledecl.ts, 54, 5)) + } + + import m2 = a; +>m2 : Symbol(m2, Decl(moduledecl.ts, 74, 5)) +>a : Symbol(m2, Decl(moduledecl.ts, 0, 0)) + + import m3 = b; +>m3 : Symbol(m3, Decl(moduledecl.ts, 76, 18)) +>b : Symbol(m3, Decl(moduledecl.ts, 2, 1)) + + import m4 = b.a; +>m4 : Symbol(m4, Decl(moduledecl.ts, 77, 18)) +>b : Symbol(m3, Decl(moduledecl.ts, 2, 1)) +>a : Symbol(m3.a, Decl(moduledecl.ts, 4, 9)) + + import m5 = c; +>m5 : Symbol(m5, Decl(moduledecl.ts, 78, 20)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) + + import m6 = c.a; +>m6 : Symbol(m6, Decl(moduledecl.ts, 79, 18)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) +>a : Symbol(m5.a, Decl(moduledecl.ts, 7, 9)) + + import m7 = c.a.b; +>m7 : Symbol(m7, Decl(moduledecl.ts, 80, 20)) +>c : Symbol(m5, Decl(moduledecl.ts, 5, 1)) +>a : Symbol(m5.a, Decl(moduledecl.ts, 7, 9)) +>b : Symbol(m6.b, Decl(moduledecl.ts, 7, 11)) +} + +module m { +>m : Symbol(m, Decl(moduledecl.ts, 82, 1), Decl(moduledecl.ts, 93, 1)) + + export module m2 { +>m2 : Symbol(m2, Decl(moduledecl.ts, 84, 10)) + + var a = 10; +>a : Symbol(a, Decl(moduledecl.ts, 86, 11)) + + export var b: number; +>b : Symbol(b, Decl(moduledecl.ts, 87, 18)) + } + + export module m3 { +>m3 : Symbol(m3, Decl(moduledecl.ts, 88, 5)) + + export var c: number; +>c : Symbol(c, Decl(moduledecl.ts, 91, 18)) + } +} + +module m { +>m : Symbol(m, Decl(moduledecl.ts, 82, 1), Decl(moduledecl.ts, 93, 1)) + + export module m25 { +>m25 : Symbol(m25, Decl(moduledecl.ts, 95, 10)) + + export module m5 { +>m5 : Symbol(m5, Decl(moduledecl.ts, 97, 23)) + + export var c: number; +>c : Symbol(c, Decl(moduledecl.ts, 99, 22)) + } + } +} + +module m13 { +>m13 : Symbol(m13, Decl(moduledecl.ts, 102, 1)) + + export module m4 { +>m4 : Symbol(m4, Decl(moduledecl.ts, 104, 12)) + + export module m2 { +>m2 : Symbol(m2, Decl(moduledecl.ts, 105, 22)) + + export module m3 { +>m3 : Symbol(m3, Decl(moduledecl.ts, 106, 26)) + + export var c: number; +>c : Symbol(c, Decl(moduledecl.ts, 108, 26)) + } + } + + export function f() { +>f : Symbol(f, Decl(moduledecl.ts, 110, 9)) + + return 20; + } + } +} + +declare module m4 { +>m4 : Symbol(m4, Decl(moduledecl.ts, 116, 1)) + + export var b; +>b : Symbol(b, Decl(moduledecl.ts, 119, 14)) +} + +declare module m5 { +>m5 : Symbol(m5, Decl(moduledecl.ts, 120, 1)) + + export var c; +>c : Symbol(c, Decl(moduledecl.ts, 123, 14)) +} + +declare module m43 { +>m43 : Symbol(m43, Decl(moduledecl.ts, 124, 1)) + + export var b; +>b : Symbol(b, Decl(moduledecl.ts, 127, 14)) +} + +declare module m55 { +>m55 : Symbol(m55, Decl(moduledecl.ts, 128, 1)) + + export var c; +>c : Symbol(c, Decl(moduledecl.ts, 131, 14)) +} + +declare module "m3" { + export var b: number; +>b : Symbol(b, Decl(moduledecl.ts, 135, 14)) +} + +module exportTests { +>exportTests : Symbol(exportTests, Decl(moduledecl.ts, 136, 1)) + + export class C1_public { +>C1_public : Symbol(C1_public, Decl(moduledecl.ts, 138, 20)) + + private f2() { +>f2 : Symbol(f2, Decl(moduledecl.ts, 139, 28)) + + return 30; + } + + public f3() { +>f3 : Symbol(f3, Decl(moduledecl.ts, 142, 9)) + + return "string"; + } + } + class C2_private { +>C2_private : Symbol(C2_private, Decl(moduledecl.ts, 147, 5)) + + private f2() { +>f2 : Symbol(f2, Decl(moduledecl.ts, 148, 22)) + + return 30; + } + + public f3() { +>f3 : Symbol(f3, Decl(moduledecl.ts, 151, 9)) + + return "string"; + } + } + + export class C3_public { +>C3_public : Symbol(C3_public, Decl(moduledecl.ts, 156, 5)) + + private getC2_private() { +>getC2_private : Symbol(getC2_private, Decl(moduledecl.ts, 158, 28)) + + return new C2_private(); +>C2_private : Symbol(C2_private, Decl(moduledecl.ts, 147, 5)) + } + private setC2_private(arg: C2_private) { +>setC2_private : Symbol(setC2_private, Decl(moduledecl.ts, 161, 9)) +>arg : Symbol(arg, Decl(moduledecl.ts, 162, 30)) +>C2_private : Symbol(C2_private, Decl(moduledecl.ts, 147, 5)) + } + private get c2() { +>c2 : Symbol(c2, Decl(moduledecl.ts, 163, 9)) + + return new C2_private(); +>C2_private : Symbol(C2_private, Decl(moduledecl.ts, 147, 5)) + } + public getC1_public() { +>getC1_public : Symbol(getC1_public, Decl(moduledecl.ts, 166, 9)) + + return new C1_public(); +>C1_public : Symbol(C1_public, Decl(moduledecl.ts, 138, 20)) + } + public setC1_public(arg: C1_public) { +>setC1_public : Symbol(setC1_public, Decl(moduledecl.ts, 169, 9)) +>arg : Symbol(arg, Decl(moduledecl.ts, 170, 28)) +>C1_public : Symbol(C1_public, Decl(moduledecl.ts, 138, 20)) + } + public get c1() { +>c1 : Symbol(c1, Decl(moduledecl.ts, 171, 9)) + + return new C1_public(); +>C1_public : Symbol(C1_public, Decl(moduledecl.ts, 138, 20)) + } + } +} + +declare module mAmbient { +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) + + class C { +>C : Symbol(C, Decl(moduledecl.ts, 178, 25)) + + public myProp: number; +>myProp : Symbol(myProp, Decl(moduledecl.ts, 179, 13)) + } + + function foo() : C; +>foo : Symbol(foo, Decl(moduledecl.ts, 181, 5)) +>C : Symbol(C, Decl(moduledecl.ts, 178, 25)) + + var aVar: C; +>aVar : Symbol(aVar, Decl(moduledecl.ts, 184, 7)) +>C : Symbol(C, Decl(moduledecl.ts, 178, 25)) + + interface B { +>B : Symbol(B, Decl(moduledecl.ts, 184, 16)) + + x: number; +>x : Symbol(x, Decl(moduledecl.ts, 185, 17)) + + y: C; +>y : Symbol(y, Decl(moduledecl.ts, 186, 18)) +>C : Symbol(C, Decl(moduledecl.ts, 178, 25)) + } + enum e { +>e : Symbol(e, Decl(moduledecl.ts, 188, 5)) + + x, +>x : Symbol(e.x, Decl(moduledecl.ts, 189, 12)) + + y, +>y : Symbol(e.y, Decl(moduledecl.ts, 190, 10)) + + z +>z : Symbol(e.z, Decl(moduledecl.ts, 191, 10)) + } + + module m3 { +>m3 : Symbol(m3, Decl(moduledecl.ts, 193, 5)) + + class C { +>C : Symbol(C, Decl(moduledecl.ts, 195, 15)) + + public myProp: number; +>myProp : Symbol(myProp, Decl(moduledecl.ts, 196, 17)) + } + + function foo(): C; +>foo : Symbol(foo, Decl(moduledecl.ts, 198, 9)) +>C : Symbol(C, Decl(moduledecl.ts, 195, 15)) + + var aVar: C; +>aVar : Symbol(aVar, Decl(moduledecl.ts, 201, 11)) +>C : Symbol(C, Decl(moduledecl.ts, 195, 15)) + + interface B { +>B : Symbol(B, Decl(moduledecl.ts, 201, 20)) + + x: number; +>x : Symbol(x, Decl(moduledecl.ts, 202, 21)) + + y: C; +>y : Symbol(y, Decl(moduledecl.ts, 203, 22)) +>C : Symbol(C, Decl(moduledecl.ts, 195, 15)) + } + enum e { +>e : Symbol(e, Decl(moduledecl.ts, 205, 9)) + + x, +>x : Symbol(e.x, Decl(moduledecl.ts, 206, 16)) + + y, +>y : Symbol(e.y, Decl(moduledecl.ts, 207, 14)) + + z +>z : Symbol(e.z, Decl(moduledecl.ts, 208, 14)) + } + } +} + +function foo() { +>foo : Symbol(foo, Decl(moduledecl.ts, 212, 1)) + + return mAmbient.foo(); +>mAmbient.foo : Symbol(mAmbient.foo, Decl(moduledecl.ts, 181, 5)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>foo : Symbol(mAmbient.foo, Decl(moduledecl.ts, 181, 5)) +} + +var cVar = new mAmbient.C(); +>cVar : Symbol(cVar, Decl(moduledecl.ts, 218, 3)) +>mAmbient.C : Symbol(mAmbient.C, Decl(moduledecl.ts, 178, 25)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>C : Symbol(mAmbient.C, Decl(moduledecl.ts, 178, 25)) + +var aVar = mAmbient.aVar; +>aVar : Symbol(aVar, Decl(moduledecl.ts, 219, 3)) +>mAmbient.aVar : Symbol(mAmbient.aVar, Decl(moduledecl.ts, 184, 7)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>aVar : Symbol(mAmbient.aVar, Decl(moduledecl.ts, 184, 7)) + +var bB: mAmbient.B; +>bB : Symbol(bB, Decl(moduledecl.ts, 220, 3)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>B : Symbol(mAmbient.B, Decl(moduledecl.ts, 184, 16)) + +var eVar: mAmbient.e; +>eVar : Symbol(eVar, Decl(moduledecl.ts, 221, 3)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>e : Symbol(mAmbient.e, Decl(moduledecl.ts, 188, 5)) + +function m3foo() { +>m3foo : Symbol(m3foo, Decl(moduledecl.ts, 221, 21)) + + return mAmbient.m3.foo(); +>mAmbient.m3.foo : Symbol(mAmbient.m3.foo, Decl(moduledecl.ts, 198, 9)) +>mAmbient.m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>foo : Symbol(mAmbient.m3.foo, Decl(moduledecl.ts, 198, 9)) +} + +var m3cVar = new mAmbient.m3.C(); +>m3cVar : Symbol(m3cVar, Decl(moduledecl.ts, 227, 3)) +>mAmbient.m3.C : Symbol(mAmbient.m3.C, Decl(moduledecl.ts, 195, 15)) +>mAmbient.m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>C : Symbol(mAmbient.m3.C, Decl(moduledecl.ts, 195, 15)) + +var m3aVar = mAmbient.m3.aVar; +>m3aVar : Symbol(m3aVar, Decl(moduledecl.ts, 228, 3)) +>mAmbient.m3.aVar : Symbol(mAmbient.m3.aVar, Decl(moduledecl.ts, 201, 11)) +>mAmbient.m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>aVar : Symbol(mAmbient.m3.aVar, Decl(moduledecl.ts, 201, 11)) + +var m3bB: mAmbient.m3.B; +>m3bB : Symbol(m3bB, Decl(moduledecl.ts, 229, 3)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>B : Symbol(mAmbient.m3.B, Decl(moduledecl.ts, 201, 20)) + +var m3eVar: mAmbient.m3.e; +>m3eVar : Symbol(m3eVar, Decl(moduledecl.ts, 230, 3)) +>mAmbient : Symbol(mAmbient, Decl(moduledecl.ts, 176, 1)) +>m3 : Symbol(mAmbient.m3, Decl(moduledecl.ts, 193, 5)) +>e : Symbol(mAmbient.m3.e, Decl(moduledecl.ts, 205, 9)) + + diff --git a/tests/baselines/reference/moduledecl.types b/tests/baselines/reference/moduledecl.types new file mode 100644 index 00000000000..0c117fb5184 --- /dev/null +++ b/tests/baselines/reference/moduledecl.types @@ -0,0 +1,551 @@ +=== tests/cases/compiler/moduledecl.ts === + +module a { +>a : any +} + +module b.a { +>b : any +>a : any +} + +module c.a.b { +>c : any +>a : any +>b : any + + import ma = a; +>ma : any +>a : any +} + +module mImport { +>mImport : any + + import d = a; +>d : any +>a : any + + import e = b.a; +>e : any +>b : any +>a : any + + import d1 = a; +>d1 : any +>a : any + + import e1 = b.a; +>e1 : any +>b : any +>a : any +} + +module m0 { +>m0 : typeof m0 + + function f1() { +>f1 : () => void + } + + function f2(s: string); +>f2 : { (s: string): any; (n: number): any; } +>s : string + + function f2(n: number); +>f2 : { (s: string): any; (n: number): any; } +>n : number + + function f2(ns: any) { +>f2 : { (s: string): any; (n: number): any; } +>ns : any + } + + class c1 { +>c1 : c1 + + public a : ()=>string; +>a : () => string + + private b: ()=>number; +>b : () => number + + private static s1; +>s1 : any + + public static s2; +>s2 : any + } + + interface i1 { +>i1 : i1 + + () : Object; +>Object : Object + + [n: number]: c1; +>n : number +>c1 : c1 + } + + import m2 = a; +>m2 : any +>a : any + + import m3 = b; +>m3 : any +>b : any + + import m4 = b.a; +>m4 : any +>b : any +>a : any + + import m5 = c; +>m5 : any +>c : any + + import m6 = c.a; +>m6 : any +>c : any +>a : any + + import m7 = c.a.b; +>m7 : any +>c : any +>a : any +>b : any +} + +module m1 { +>m1 : typeof m1 + + export function f1() { +>f1 : () => void + } + + export function f2(s: string); +>f2 : { (s: string): any; (n: number): any; } +>s : string + + export function f2(n: number); +>f2 : { (s: string): any; (n: number): any; } +>n : number + + export function f2(ns: any) { +>f2 : { (s: string): any; (n: number): any; } +>ns : any + } + + export class c1 { +>c1 : c1 + + public a: () =>string; +>a : () => string + + private b: () =>number; +>b : () => number + + private static s1; +>s1 : any + + public static s2; +>s2 : any + + public d() { +>d : () => string + + return "Hello"; +>"Hello" : string + } + + public e: { x: number; y: string; }; +>e : { x: number; y: string; } +>x : number +>y : string + + constructor (public n, public n2: number, private n3, private n4: string) { +>n : any +>n2 : number +>n3 : any +>n4 : string + } + } + + export interface i1 { +>i1 : i1 + + () : Object; +>Object : Object + + [n: number]: c1; +>n : number +>c1 : c1 + } + + import m2 = a; +>m2 : any +>a : any + + import m3 = b; +>m3 : any +>b : any + + import m4 = b.a; +>m4 : any +>b : any +>a : any + + import m5 = c; +>m5 : any +>c : any + + import m6 = c.a; +>m6 : any +>c : any +>a : any + + import m7 = c.a.b; +>m7 : any +>c : any +>a : any +>b : any +} + +module m { +>m : typeof m + + export module m2 { +>m2 : typeof m2 + + var a = 10; +>a : number +>10 : number + + export var b: number; +>b : number + } + + export module m3 { +>m3 : typeof m3 + + export var c: number; +>c : number + } +} + +module m { +>m : typeof m + + export module m25 { +>m25 : typeof m25 + + export module m5 { +>m5 : typeof m5 + + export var c: number; +>c : number + } + } +} + +module m13 { +>m13 : typeof m13 + + export module m4 { +>m4 : typeof m4 + + export module m2 { +>m2 : typeof m2 + + export module m3 { +>m3 : typeof m3 + + export var c: number; +>c : number + } + } + + export function f() { +>f : () => number + + return 20; +>20 : number + } + } +} + +declare module m4 { +>m4 : typeof m4 + + export var b; +>b : any +} + +declare module m5 { +>m5 : typeof m5 + + export var c; +>c : any +} + +declare module m43 { +>m43 : typeof m43 + + export var b; +>b : any +} + +declare module m55 { +>m55 : typeof m55 + + export var c; +>c : any +} + +declare module "m3" { + export var b: number; +>b : number +} + +module exportTests { +>exportTests : typeof exportTests + + export class C1_public { +>C1_public : C1_public + + private f2() { +>f2 : () => number + + return 30; +>30 : number + } + + public f3() { +>f3 : () => string + + return "string"; +>"string" : string + } + } + class C2_private { +>C2_private : C2_private + + private f2() { +>f2 : () => number + + return 30; +>30 : number + } + + public f3() { +>f3 : () => string + + return "string"; +>"string" : string + } + } + + export class C3_public { +>C3_public : C3_public + + private getC2_private() { +>getC2_private : () => C2_private + + return new C2_private(); +>new C2_private() : C2_private +>C2_private : typeof C2_private + } + private setC2_private(arg: C2_private) { +>setC2_private : (arg: C2_private) => void +>arg : C2_private +>C2_private : C2_private + } + private get c2() { +>c2 : C2_private + + return new C2_private(); +>new C2_private() : C2_private +>C2_private : typeof C2_private + } + public getC1_public() { +>getC1_public : () => C1_public + + return new C1_public(); +>new C1_public() : C1_public +>C1_public : typeof C1_public + } + public setC1_public(arg: C1_public) { +>setC1_public : (arg: C1_public) => void +>arg : C1_public +>C1_public : C1_public + } + public get c1() { +>c1 : C1_public + + return new C1_public(); +>new C1_public() : C1_public +>C1_public : typeof C1_public + } + } +} + +declare module mAmbient { +>mAmbient : typeof mAmbient + + class C { +>C : C + + public myProp: number; +>myProp : number + } + + function foo() : C; +>foo : () => C +>C : C + + var aVar: C; +>aVar : C +>C : C + + interface B { +>B : B + + x: number; +>x : number + + y: C; +>y : C +>C : C + } + enum e { +>e : e + + x, +>x : e + + y, +>y : e + + z +>z : e + } + + module m3 { +>m3 : typeof m3 + + class C { +>C : C + + public myProp: number; +>myProp : number + } + + function foo(): C; +>foo : () => C +>C : C + + var aVar: C; +>aVar : C +>C : C + + interface B { +>B : B + + x: number; +>x : number + + y: C; +>y : C +>C : C + } + enum e { +>e : e + + x, +>x : e + + y, +>y : e + + z +>z : e + } + } +} + +function foo() { +>foo : () => mAmbient.C + + return mAmbient.foo(); +>mAmbient.foo() : mAmbient.C +>mAmbient.foo : () => mAmbient.C +>mAmbient : typeof mAmbient +>foo : () => mAmbient.C +} + +var cVar = new mAmbient.C(); +>cVar : mAmbient.C +>new mAmbient.C() : mAmbient.C +>mAmbient.C : typeof mAmbient.C +>mAmbient : typeof mAmbient +>C : typeof mAmbient.C + +var aVar = mAmbient.aVar; +>aVar : mAmbient.C +>mAmbient.aVar : mAmbient.C +>mAmbient : typeof mAmbient +>aVar : mAmbient.C + +var bB: mAmbient.B; +>bB : mAmbient.B +>mAmbient : any +>B : mAmbient.B + +var eVar: mAmbient.e; +>eVar : mAmbient.e +>mAmbient : any +>e : mAmbient.e + +function m3foo() { +>m3foo : () => mAmbient.m3.C + + return mAmbient.m3.foo(); +>mAmbient.m3.foo() : mAmbient.m3.C +>mAmbient.m3.foo : () => mAmbient.m3.C +>mAmbient.m3 : typeof mAmbient.m3 +>mAmbient : typeof mAmbient +>m3 : typeof mAmbient.m3 +>foo : () => mAmbient.m3.C +} + +var m3cVar = new mAmbient.m3.C(); +>m3cVar : mAmbient.m3.C +>new mAmbient.m3.C() : mAmbient.m3.C +>mAmbient.m3.C : typeof mAmbient.m3.C +>mAmbient.m3 : typeof mAmbient.m3 +>mAmbient : typeof mAmbient +>m3 : typeof mAmbient.m3 +>C : typeof mAmbient.m3.C + +var m3aVar = mAmbient.m3.aVar; +>m3aVar : mAmbient.m3.C +>mAmbient.m3.aVar : mAmbient.m3.C +>mAmbient.m3 : typeof mAmbient.m3 +>mAmbient : typeof mAmbient +>m3 : typeof mAmbient.m3 +>aVar : mAmbient.m3.C + +var m3bB: mAmbient.m3.B; +>m3bB : mAmbient.m3.B +>mAmbient : any +>m3 : any +>B : mAmbient.m3.B + +var m3eVar: mAmbient.m3.e; +>m3eVar : mAmbient.m3.e +>mAmbient : any +>m3 : any +>e : mAmbient.m3.e + + diff --git a/tests/baselines/reference/nonMergedDeclarationsAndOverloads.errors.txt b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.errors.txt new file mode 100644 index 00000000000..252cd6880d4 --- /dev/null +++ b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.errors.txt @@ -0,0 +1,23 @@ +tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts(2,5): error TS2300: Duplicate identifier 'm1'. +tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts(4,5): error TS2300: Duplicate identifier 'm1'. +tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts(5,5): error TS2300: Duplicate identifier 'm1'. +tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts(6,5): error TS2300: Duplicate identifier 'm1'. + + +==== tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts (4 errors) ==== + class A { + m1: string; + ~~ +!!! error TS2300: Duplicate identifier 'm1'. + f() {} + m1 (a: string): void; + ~~ +!!! error TS2300: Duplicate identifier 'm1'. + m1 (a: number): void; + ~~ +!!! error TS2300: Duplicate identifier 'm1'. + m1 (a: any): void { + ~~ +!!! error TS2300: Duplicate identifier 'm1'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js new file mode 100644 index 00000000000..3ca6a963515 --- /dev/null +++ b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js @@ -0,0 +1,19 @@ +//// [nonMergedDeclarationsAndOverloads.ts] +class A { + m1: string; + f() {} + m1 (a: string): void; + m1 (a: number): void; + m1 (a: any): void { + } +} + +//// [nonMergedDeclarationsAndOverloads.js] +var A = (function () { + function A() { + } + A.prototype.f = function () { }; + A.prototype.m1 = function (a) { + }; + return A; +})(); diff --git a/tests/baselines/reference/nonMergedOverloads.errors.txt b/tests/baselines/reference/nonMergedOverloads.errors.txt new file mode 100644 index 00000000000..9a38ebdc3b3 --- /dev/null +++ b/tests/baselines/reference/nonMergedOverloads.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/nonMergedOverloads.ts(1,5): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. +tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/nonMergedOverloads.ts(4,17): error TS2300: Duplicate identifier 'f'. + + +==== tests/cases/compiler/nonMergedOverloads.ts (4 errors) ==== + var f = 10; + ~ +!!! error TS2300: Duplicate identifier 'f'. + + export function f(); + ~ +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. + ~ +!!! error TS2300: Duplicate identifier 'f'. + export function f() { + ~ +!!! error TS2300: Duplicate identifier 'f'. + } \ No newline at end of file diff --git a/tests/baselines/reference/nonMergedOverloads.js b/tests/baselines/reference/nonMergedOverloads.js new file mode 100644 index 00000000000..2e7f7f67ee6 --- /dev/null +++ b/tests/baselines/reference/nonMergedOverloads.js @@ -0,0 +1,12 @@ +//// [nonMergedOverloads.ts] +var f = 10; + +export function f(); +export function f() { +} + +//// [nonMergedOverloads.js] +var f = 10; +function f() { +} +exports.f = f; diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt b/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt new file mode 100644 index 00000000000..a9efb0e2971 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt @@ -0,0 +1,9 @@ +error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'. +error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. + + +!!! error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'. +!!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. +==== tests/cases/compiler/optionsInlineSourceMapMapRoot.ts (0 errors) ==== + + var a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.js b/tests/baselines/reference/optionsInlineSourceMapMapRoot.js new file mode 100644 index 00000000000..c165c49ec29 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.js @@ -0,0 +1,7 @@ +//// [optionsInlineSourceMapMapRoot.ts] + +var a = 10; + +//// [optionsInlineSourceMapMapRoot.js] +var a = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9vcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt b/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt new file mode 100644 index 00000000000..66d860c22b2 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt @@ -0,0 +1,33 @@ +=================================================================== +JsFile: optionsInlineSourceMapMapRoot.js +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9vcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== +sourceRoot: +sources: ../optionsInlineSourceMapMapRoot.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsInlineSourceMapMapRoot.js +sourceFile:../optionsInlineSourceMapMapRoot.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9vcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.js b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.js new file mode 100644 index 00000000000..748fae7320c --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.js @@ -0,0 +1,7 @@ +//// [optionsInlineSourceMapSourceRoot.ts] + +var a = 10; + +//// [optionsInlineSourceMapSourceRoot.js] +var a = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZVJvb3QuanMiLCJzb3VyY2VSb290IjoibG9jYWwvIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwU291cmNlUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.sourcemap.txt b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.sourcemap.txt new file mode 100644 index 00000000000..6178766b21c --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.sourcemap.txt @@ -0,0 +1,33 @@ +=================================================================== +JsFile: optionsInlineSourceMapSourceRoot.js +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZVJvb3QuanMiLCJzb3VyY2VSb290IjoibG9jYWwvIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwU291cmNlUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== +sourceRoot: local/ +sources: optionsInlineSourceMapSourceRoot.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsInlineSourceMapSourceRoot.js +sourceFile:optionsInlineSourceMapSourceRoot.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZVJvb3QuanMiLCJzb3VyY2VSb290IjoibG9jYWwvIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwU291cmNlUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.symbols b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.symbols new file mode 100644 index 00000000000..cf8c0826d8e --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts === + +var a = 10; +>a : Symbol(a, Decl(optionsInlineSourceMapSourceRoot.ts, 1, 3)) + diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types new file mode 100644 index 00000000000..1f6a5fc9dc6 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts === + +var a = 10; +>a : number +>10 : number + diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt b/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt new file mode 100644 index 00000000000..e91781ccd77 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt @@ -0,0 +1,7 @@ +error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. + + +!!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. +==== tests/cases/compiler/optionsInlineSourceMapSourcemap.ts (0 errors) ==== + + var a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.js b/tests/baselines/reference/optionsInlineSourceMapSourcemap.js new file mode 100644 index 00000000000..96d468d27da --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.js @@ -0,0 +1,7 @@ +//// [optionsInlineSourceMapSourcemap.ts] + +var a = 10; + +//// [optionsInlineSourceMapSourcemap.js] +var a = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0= \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt b/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt new file mode 100644 index 00000000000..6ca02eb22d1 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt @@ -0,0 +1,33 @@ +=================================================================== +JsFile: optionsInlineSourceMapSourcemap.js +mapUrl: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0= +sourceRoot: +sources: optionsInlineSourceMapSourcemap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsInlineSourceMapSourcemap.js +sourceFile:optionsInlineSourceMapSourcemap.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0= \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.js b/tests/baselines/reference/optionsSourcemapInlineSources.js new file mode 100644 index 00000000000..029575ab992 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSources.js @@ -0,0 +1,7 @@ +//// [optionsSourcemapInlineSources.ts] + +var a = 10; + +//// [optionsSourcemapInlineSources.js] +var a = 10; +//# sourceMappingURL=optionsSourcemapInlineSources.js.map \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.js.map b/tests/baselines/reference/optionsSourcemapInlineSources.js.map new file mode 100644 index 00000000000..2be06332573 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSources.js.map @@ -0,0 +1,2 @@ +//// [optionsSourcemapInlineSources.js.map] +{"version":3,"file":"optionsSourcemapInlineSources.js","sourceRoot":"","sources":["optionsSourcemapInlineSources.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]} \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.sourcemap.txt b/tests/baselines/reference/optionsSourcemapInlineSources.sourcemap.txt new file mode 100644 index 00000000000..79119d8c687 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSources.sourcemap.txt @@ -0,0 +1,34 @@ +=================================================================== +JsFile: optionsSourcemapInlineSources.js +mapUrl: optionsSourcemapInlineSources.js.map +sourceRoot: +sources: optionsSourcemapInlineSources.ts +sourcesContent: ["\nvar a = 10;"] +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsSourcemapInlineSources.js +sourceFile:optionsSourcemapInlineSources.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=optionsSourcemapInlineSources.js.map \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.symbols b/tests/baselines/reference/optionsSourcemapInlineSources.symbols new file mode 100644 index 00000000000..50649b86a0d --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSources.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/optionsSourcemapInlineSources.ts === + +var a = 10; +>a : Symbol(a, Decl(optionsSourcemapInlineSources.ts, 1, 3)) + diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.types b/tests/baselines/reference/optionsSourcemapInlineSources.types new file mode 100644 index 00000000000..42fa1839371 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSources.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/optionsSourcemapInlineSources.ts === + +var a = 10; +>a : number +>10 : number + diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js new file mode 100644 index 00000000000..f7100140850 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js @@ -0,0 +1,7 @@ +//// [optionsSourcemapInlineSourcesMapRoot.ts] + +var a = 10; + +//// [optionsSourcemapInlineSourcesMapRoot.js] +var a = 10; +//# sourceMappingURL=local/optionsSourcemapInlineSourcesMapRoot.js.map \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js.map b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js.map new file mode 100644 index 00000000000..e99843b577f --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.js.map @@ -0,0 +1,2 @@ +//// [optionsSourcemapInlineSourcesMapRoot.js.map] +{"version":3,"file":"optionsSourcemapInlineSourcesMapRoot.js","sourceRoot":"","sources":["../optionsSourcemapInlineSourcesMapRoot.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]} \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.sourcemap.txt b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.sourcemap.txt new file mode 100644 index 00000000000..a00040a9c93 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.sourcemap.txt @@ -0,0 +1,34 @@ +=================================================================== +JsFile: optionsSourcemapInlineSourcesMapRoot.js +mapUrl: local/optionsSourcemapInlineSourcesMapRoot.js.map +sourceRoot: +sources: ../optionsSourcemapInlineSourcesMapRoot.ts +sourcesContent: ["\nvar a = 10;"] +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.js +sourceFile:../optionsSourcemapInlineSourcesMapRoot.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=local/optionsSourcemapInlineSourcesMapRoot.js.map \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.symbols b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.symbols new file mode 100644 index 00000000000..57833abe2ee --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts === + +var a = 10; +>a : Symbol(a, Decl(optionsSourcemapInlineSourcesMapRoot.ts, 1, 3)) + diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types new file mode 100644 index 00000000000..77abb6f7b11 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts === + +var a = 10; +>a : number +>10 : number + diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.errors.txt b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.errors.txt new file mode 100644 index 00000000000..bfa77ff5a3e --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.errors.txt @@ -0,0 +1,7 @@ +error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSources'. + + +!!! error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSources'. +==== tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts (0 errors) ==== + + var a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js new file mode 100644 index 00000000000..948d6536f46 --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js @@ -0,0 +1,7 @@ +//// [optionsSourcemapInlineSourcesSourceRoot.ts] + +var a = 10; + +//// [optionsSourcemapInlineSourcesSourceRoot.js] +var a = 10; +//# sourceMappingURL=optionsSourcemapInlineSourcesSourceRoot.js.map \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js.map b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js.map new file mode 100644 index 00000000000..ad373e11aab --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.js.map @@ -0,0 +1,2 @@ +//// [optionsSourcemapInlineSourcesSourceRoot.js.map] +{"version":3,"file":"optionsSourcemapInlineSourcesSourceRoot.js","sourceRoot":"local/","sources":["optionsSourcemapInlineSourcesSourceRoot.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]} \ No newline at end of file diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.sourcemap.txt b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.sourcemap.txt new file mode 100644 index 00000000000..55102f5c1cd --- /dev/null +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.sourcemap.txt @@ -0,0 +1,34 @@ +=================================================================== +JsFile: optionsSourcemapInlineSourcesSourceRoot.js +mapUrl: optionsSourcemapInlineSourcesSourceRoot.js.map +sourceRoot: local/ +sources: optionsSourcemapInlineSourcesSourceRoot.ts +sourcesContent: ["\nvar a = 10;"] +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.js +sourceFile:optionsSourcemapInlineSourcesSourceRoot.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(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=optionsSourcemapInlineSourcesSourceRoot.js.map \ No newline at end of file diff --git a/tests/baselines/reference/out-flag2.errors.txt b/tests/baselines/reference/out-flag2.errors.txt new file mode 100644 index 00000000000..ea6fed45bd0 --- /dev/null +++ b/tests/baselines/reference/out-flag2.errors.txt @@ -0,0 +1,10 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== tests/cases/compiler/a.ts (0 errors) ==== + + class A { } + +==== tests/cases/compiler/b.ts (0 errors) ==== + class B { } \ No newline at end of file diff --git a/tests/baselines/reference/out-flag2.symbols b/tests/baselines/reference/out-flag2.symbols deleted file mode 100644 index 1bca057c580..00000000000 --- a/tests/baselines/reference/out-flag2.symbols +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/compiler/a.ts === - -class A { } ->A : Symbol(A, Decl(a.ts, 0, 0)) - -=== tests/cases/compiler/b.ts === -class B { } ->B : Symbol(B, Decl(b.ts, 0, 0)) - diff --git a/tests/baselines/reference/out-flag2.types b/tests/baselines/reference/out-flag2.types deleted file mode 100644 index 5a13642f99f..00000000000 --- a/tests/baselines/reference/out-flag2.types +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/compiler/a.ts === - -class A { } ->A : A - -=== tests/cases/compiler/b.ts === -class B { } ->B : B - diff --git a/tests/baselines/reference/out-flag3.errors.txt b/tests/baselines/reference/out-flag3.errors.txt index 6b7dda7c962..c01cef151f3 100644 --- a/tests/baselines/reference/out-flag3.errors.txt +++ b/tests/baselines/reference/out-flag3.errors.txt @@ -1,7 +1,9 @@ error TS5053: Option 'out' cannot be specified with option 'outFile'. +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. !!! error TS5053: Option 'out' cannot be specified with option 'outFile'. +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. ==== tests/cases/compiler/a.ts (0 errors) ==== // --out and --outFile error diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js new file mode 100644 index 00000000000..a1c874abb7c --- /dev/null +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -0,0 +1,46 @@ +//// [tests/cases/compiler/outModuleConcatAmd.ts] //// + +//// [a.ts] + +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + +//// [all.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) { + var A = (function () { + function A() { + } + return A; + })(); + exports.A = A; +}); +define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) { + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(a_1.A); + exports.B = B; +}); +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +declare module "tests/cases/compiler/ref/a" { + export class A { + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatAmd.js.map b/tests/baselines/reference/outModuleConcatAmd.js.map new file mode 100644 index 00000000000..44cd5ce9955 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatAmd.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":["A","A.constructor","B","B.constructor"],"mappings":";;;;;;IACA;QAAAA;QAAiBC,CAACA;QAADD,QAACA;IAADA,CAACA,AAAlB,IAAkB;IAAL,SAAC,IAAI,CAAA;;;ICAlB;QAAuBE,qBAACA;QAAxBA;YAAuBC,8BAACA;QAAGA,CAACA;QAADD,QAACA;IAADA,CAACA,AAA5B,EAAuB,KAAC,EAAI;IAAf,SAAC,IAAc,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt new file mode 100644 index 00000000000..eec3a6014aa --- /dev/null +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -0,0 +1,164 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>var __extends = (this && this.__extends) || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) { +>>> var A = (function () { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 5) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(8, 9) Source(2, 1) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->export class A { +2 > } +1->Emitted(9, 9) Source(2, 18) + SourceIndex(0) name (A.constructor) +2 >Emitted(9, 10) Source(2, 19) + SourceIndex(0) name (A.constructor) +--- +>>> return A; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(10, 9) Source(2, 18) + SourceIndex(0) name (A) +2 >Emitted(10, 17) Source(2, 19) + SourceIndex(0) name (A) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class A { } +1 >Emitted(11, 5) Source(2, 18) + SourceIndex(0) name (A) +2 >Emitted(11, 6) Source(2, 19) + SourceIndex(0) name (A) +3 >Emitted(11, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(11, 10) Source(2, 19) + SourceIndex(0) +--- +>>> exports.A = A; +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +1-> +2 > A +3 > { } +4 > +1->Emitted(12, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(12, 14) Source(2, 15) + SourceIndex(0) +3 >Emitted(12, 18) Source(2, 19) + SourceIndex(0) +4 >Emitted(12, 19) Source(2, 19) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>>}); +>>>define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) { +>>> var B = (function (_super) { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >import {A} from "./ref/a"; + > +1 >Emitted(15, 5) Source(2, 1) + SourceIndex(1) +--- +>>> __extends(B, _super); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(16, 9) Source(2, 24) + SourceIndex(1) name (B) +2 >Emitted(16, 30) Source(2, 25) + SourceIndex(1) name (B) +--- +>>> function B() { +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(17, 9) Source(2, 1) + SourceIndex(1) name (B) +--- +>>> _super.apply(this, arguments); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(18, 13) Source(2, 24) + SourceIndex(1) name (B.constructor) +2 >Emitted(18, 43) Source(2, 25) + SourceIndex(1) name (B.constructor) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { +2 > } +1 >Emitted(19, 9) Source(2, 28) + SourceIndex(1) name (B.constructor) +2 >Emitted(19, 10) Source(2, 29) + SourceIndex(1) name (B.constructor) +--- +>>> return B; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(20, 9) Source(2, 28) + SourceIndex(1) name (B) +2 >Emitted(20, 17) Source(2, 29) + SourceIndex(1) name (B) +--- +>>> })(a_1.A); +1 >^^^^ +2 > ^ +3 > +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> +1 > +2 > } +3 > +4 > export class B extends +5 > A +6 > { } +1 >Emitted(21, 5) Source(2, 28) + SourceIndex(1) name (B) +2 >Emitted(21, 6) Source(2, 29) + SourceIndex(1) name (B) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 8) Source(2, 24) + SourceIndex(1) +5 >Emitted(21, 13) Source(2, 25) + SourceIndex(1) +6 >Emitted(21, 15) Source(2, 29) + SourceIndex(1) +--- +>>> exports.B = B; +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +1-> +2 > B +3 > extends A { } +4 > +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 14) Source(2, 15) + SourceIndex(1) +3 >Emitted(22, 18) Source(2, 29) + SourceIndex(1) +4 >Emitted(22, 19) Source(2, 29) + SourceIndex(1) +--- +>>>}); +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatAmd.symbols b/tests/baselines/reference/outModuleConcatAmd.symbols new file mode 100644 index 00000000000..349de40815a --- /dev/null +++ b/tests/baselines/reference/outModuleConcatAmd.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/ref/a.ts === + +export class A { } +>A : Symbol(A, Decl(a.ts, 0, 0)) + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : Symbol(A, Decl(b.ts, 0, 8)) + +export class B extends A { } +>B : Symbol(B, Decl(b.ts, 0, 26)) +>A : Symbol(A, Decl(b.ts, 0, 8)) + diff --git a/tests/baselines/reference/outModuleConcatAmd.types b/tests/baselines/reference/outModuleConcatAmd.types new file mode 100644 index 00000000000..6e0d9398853 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatAmd.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/ref/a.ts === + +export class A { } +>A : A + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : typeof A + +export class B extends A { } +>B : B +>A : A + diff --git a/tests/baselines/reference/outModuleConcatCommonjs.errors.txt b/tests/baselines/reference/outModuleConcatCommonjs.errors.txt new file mode 100644 index 00000000000..d1a2adbc93f --- /dev/null +++ b/tests/baselines/reference/outModuleConcatCommonjs.errors.txt @@ -0,0 +1,13 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== tests/cases/compiler/ref/a.ts (0 errors) ==== + + // This should be an error + + export class A { } + +==== tests/cases/compiler/b.ts (0 errors) ==== + import {A} from "./ref/a"; + export class B extends A { } \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatCommonjs.js b/tests/baselines/reference/outModuleConcatCommonjs.js new file mode 100644 index 00000000000..c859d6c63ef --- /dev/null +++ b/tests/baselines/reference/outModuleConcatCommonjs.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/outModuleConcatCommonjs.ts] //// + +//// [a.ts] + +// This should be an error + +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + +//// [all.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +// This should be an error +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +declare module "tests/cases/compiler/ref/a" { + export class A { + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatCommonjs.js.map b/tests/baselines/reference/outModuleConcatCommonjs.js.map new file mode 100644 index 00000000000..09646467406 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatCommonjs.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;AACA,0BAA0B"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatCommonjs.sourcemap.txt b/tests/baselines/reference/outModuleConcatCommonjs.sourcemap.txt new file mode 100644 index 00000000000..698328649e2 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatCommonjs.sourcemap.txt @@ -0,0 +1,26 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>var __extends = (this && this.__extends) || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>// This should be an error +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^-> +1 > + > +2 >// This should be an error +1 >Emitted(6, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(6, 27) Source(2, 27) + SourceIndex(0) +--- +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatES6.errors.txt b/tests/baselines/reference/outModuleConcatES6.errors.txt new file mode 100644 index 00000000000..d1a2adbc93f --- /dev/null +++ b/tests/baselines/reference/outModuleConcatES6.errors.txt @@ -0,0 +1,13 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== tests/cases/compiler/ref/a.ts (0 errors) ==== + + // This should be an error + + export class A { } + +==== tests/cases/compiler/b.ts (0 errors) ==== + import {A} from "./ref/a"; + export class B extends A { } \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatES6.js b/tests/baselines/reference/outModuleConcatES6.js new file mode 100644 index 00000000000..037d52eb410 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatES6.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/outModuleConcatES6.ts] //// + +//// [a.ts] + +// This should be an error + +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + +//// [all.js] +// This should be an error +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +declare module "tests/cases/compiler/ref/a" { + export class A { + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatES6.js.map b/tests/baselines/reference/outModuleConcatES6.js.map new file mode 100644 index 00000000000..bd3e6f58731 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatES6.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AACA,0BAA0B"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatES6.sourcemap.txt b/tests/baselines/reference/outModuleConcatES6.sourcemap.txt new file mode 100644 index 00000000000..78b6e98ac15 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatES6.sourcemap.txt @@ -0,0 +1,21 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>// This should be an error +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^-> +1 > + > +2 >// This should be an error +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 27) Source(2, 27) + SourceIndex(0) +--- +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js new file mode 100644 index 00000000000..1f8bdbd8070 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -0,0 +1,62 @@ +//// [tests/cases/compiler/outModuleConcatSystem.ts] //// + +//// [a.ts] + +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + +//// [all.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +System.register("tests/cases/compiler/ref/a", [], function(exports_1) { + var A; + return { + setters:[], + execute: function() { + A = (function () { + function A() { + } + return A; + })(); + exports_1("A", A); + } + } +}); +System.register("tests/cases/compiler/b", ["tests/cases/compiler/ref/a"], function(exports_2) { + var a_1; + var B; + return { + setters:[ + function (a_1_1) { + a_1 = a_1_1; + }], + execute: function() { + B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(a_1.A); + exports_2("B", B); + } + } +}); +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +declare module "tests/cases/compiler/ref/a" { + export class A { + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatSystem.js.map b/tests/baselines/reference/outModuleConcatSystem.js.map new file mode 100644 index 00000000000..77ff05f84fb --- /dev/null +++ b/tests/baselines/reference/outModuleConcatSystem.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":["A","A.constructor","B","B.constructor"],"mappings":";;;;;;;;;;YACA;gBAAAA;gBAAiBC,CAACA;gBAADD,QAACA;YAADA,CAACA,AAAlB,IAAkB;YAAlB,iBAAkB,CAAA;;;;;;;;;;;;;YCAlB;gBAAuBE,qBAACA;gBAAxBA;oBAAuBC,8BAACA;gBAAGA,CAACA;gBAADD,QAACA;YAADA,CAACA,AAA5B,EAAuB,KAAC,EAAI;YAA5B,iBAA4B,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt new file mode 100644 index 00000000000..489487772db --- /dev/null +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -0,0 +1,174 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>var __extends = (this && this.__extends) || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>System.register("tests/cases/compiler/ref/a", [], function(exports_1) { +>>> var A; +>>> return { +>>> setters:[], +>>> execute: function() { +>>> A = (function () { +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(11, 13) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^^^^^^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(12, 17) Source(2, 1) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->export class A { +2 > } +1->Emitted(13, 17) Source(2, 18) + SourceIndex(0) name (A.constructor) +2 >Emitted(13, 18) Source(2, 19) + SourceIndex(0) name (A.constructor) +--- +>>> return A; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(14, 17) Source(2, 18) + SourceIndex(0) name (A) +2 >Emitted(14, 25) Source(2, 19) + SourceIndex(0) name (A) +--- +>>> })(); +1 >^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class A { } +1 >Emitted(15, 13) Source(2, 18) + SourceIndex(0) name (A) +2 >Emitted(15, 14) Source(2, 19) + SourceIndex(0) name (A) +3 >Emitted(15, 14) Source(2, 1) + SourceIndex(0) +4 >Emitted(15, 18) Source(2, 19) + SourceIndex(0) +--- +>>> exports_1("A", A); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^ +1-> +2 > export class A { } +3 > +1->Emitted(16, 13) Source(2, 1) + SourceIndex(0) +2 >Emitted(16, 30) Source(2, 19) + SourceIndex(0) +3 >Emitted(16, 31) Source(2, 19) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>> } +>>> } +>>>}); +>>>System.register("tests/cases/compiler/b", ["tests/cases/compiler/ref/a"], function(exports_2) { +>>> var a_1; +>>> var B; +>>> return { +>>> setters:[ +>>> function (a_1_1) { +>>> a_1 = a_1_1; +>>> }], +>>> execute: function() { +>>> B = (function (_super) { +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >import {A} from "./ref/a"; + > +1 >Emitted(29, 13) Source(2, 1) + SourceIndex(1) +--- +>>> __extends(B, _super); +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(30, 17) Source(2, 24) + SourceIndex(1) name (B) +2 >Emitted(30, 38) Source(2, 25) + SourceIndex(1) name (B) +--- +>>> function B() { +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(31, 17) Source(2, 1) + SourceIndex(1) name (B) +--- +>>> _super.apply(this, arguments); +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(32, 21) Source(2, 24) + SourceIndex(1) name (B.constructor) +2 >Emitted(32, 51) Source(2, 25) + SourceIndex(1) name (B.constructor) +--- +>>> } +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { +2 > } +1 >Emitted(33, 17) Source(2, 28) + SourceIndex(1) name (B.constructor) +2 >Emitted(33, 18) Source(2, 29) + SourceIndex(1) name (B.constructor) +--- +>>> return B; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(34, 17) Source(2, 28) + SourceIndex(1) name (B) +2 >Emitted(34, 25) Source(2, 29) + SourceIndex(1) name (B) +--- +>>> })(a_1.A); +1 >^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class B extends +5 > A +6 > { } +1 >Emitted(35, 13) Source(2, 28) + SourceIndex(1) name (B) +2 >Emitted(35, 14) Source(2, 29) + SourceIndex(1) name (B) +3 >Emitted(35, 14) Source(2, 1) + SourceIndex(1) +4 >Emitted(35, 16) Source(2, 24) + SourceIndex(1) +5 >Emitted(35, 21) Source(2, 25) + SourceIndex(1) +6 >Emitted(35, 23) Source(2, 29) + SourceIndex(1) +--- +>>> exports_2("B", B); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^ +1-> +2 > export class B extends A { } +3 > +1->Emitted(36, 13) Source(2, 1) + SourceIndex(1) +2 >Emitted(36, 30) Source(2, 29) + SourceIndex(1) +3 >Emitted(36, 31) Source(2, 29) + SourceIndex(1) +--- +>>> } +>>> } +>>>}); +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.symbols b/tests/baselines/reference/outModuleConcatSystem.symbols new file mode 100644 index 00000000000..349de40815a --- /dev/null +++ b/tests/baselines/reference/outModuleConcatSystem.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/ref/a.ts === + +export class A { } +>A : Symbol(A, Decl(a.ts, 0, 0)) + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : Symbol(A, Decl(b.ts, 0, 8)) + +export class B extends A { } +>B : Symbol(B, Decl(b.ts, 0, 26)) +>A : Symbol(A, Decl(b.ts, 0, 8)) + diff --git a/tests/baselines/reference/outModuleConcatSystem.types b/tests/baselines/reference/outModuleConcatSystem.types new file mode 100644 index 00000000000..6e0d9398853 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatSystem.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/ref/a.ts === + +export class A { } +>A : A + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : typeof A + +export class B extends A { } +>B : B +>A : A + diff --git a/tests/baselines/reference/outModuleConcatUmd.errors.txt b/tests/baselines/reference/outModuleConcatUmd.errors.txt new file mode 100644 index 00000000000..8695199c7eb --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUmd.errors.txt @@ -0,0 +1,13 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== tests/cases/compiler/ref/a.ts (0 errors) ==== + + // This should error + + export class A { } + +==== tests/cases/compiler/b.ts (0 errors) ==== + import {A} from "./ref/a"; + export class B extends A { } \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatUmd.js b/tests/baselines/reference/outModuleConcatUmd.js new file mode 100644 index 00000000000..c4aad41c6ed --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUmd.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/outModuleConcatUmd.ts] //// + +//// [a.ts] + +// This should error + +export class A { } + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + +//// [all.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +// This should error +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +declare module "tests/cases/compiler/ref/a" { + export class A { + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleConcatUmd.js.map b/tests/baselines/reference/outModuleConcatUmd.js.map new file mode 100644 index 00000000000..7a9fcd77bdf --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUmd.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;AACA,oBAAoB"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatUmd.sourcemap.txt b/tests/baselines/reference/outModuleConcatUmd.sourcemap.txt new file mode 100644 index 00000000000..d2fbe17fe65 --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUmd.sourcemap.txt @@ -0,0 +1,26 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>var __extends = (this && this.__extends) || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>// This should error +1 > +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^-> +1 > + > +2 >// This should error +1 >Emitted(6, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(6, 21) Source(2, 21) + SourceIndex(0) +--- +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js new file mode 100644 index 00000000000..ae4ac43b5c9 --- /dev/null +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -0,0 +1,81 @@ +//// [tests/cases/compiler/outModuleTripleSlashRefs.ts] //// + +//// [a.ts] + +/// +export class A { + member: typeof GlobalFoo; +} + +//// [b.ts] +/// +class Foo { + member: Bar; +} +declare var GlobalFoo: Foo; + +//// [c.d.ts] +/// +declare class Bar { + member: Baz; +} + +//// [d.d.ts] +declare class Baz { + member: number; +} + +//// [b.ts] +import {A} from "./ref/a"; +export class B extends A { } + + +//// [all.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +/// +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) { + /// + var A = (function () { + function A() { + } + return A; + })(); + exports.A = A; +}); +define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) { + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(a_1.A); + exports.B = B; +}); +//# sourceMappingURL=all.js.map + +//// [all.d.ts] +/// +declare class Foo { + member: Bar; +} +declare var GlobalFoo: Foo; +declare module "tests/cases/compiler/ref/a" { + export class A { + member: typeof GlobalFoo; + } +} +declare module "tests/cases/compiler/b" { + import { A } from "tests/cases/compiler/ref/a"; + export class B extends A { + } +} diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js.map b/tests/baselines/reference/outModuleTripleSlashRefs.js.map new file mode 100644 index 00000000000..711163a76e8 --- /dev/null +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js.map @@ -0,0 +1,2 @@ +//// [all.js.map] +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/b.ts","tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":["Foo","Foo.constructor","A","A.constructor","B","B.constructor"],"mappings":";;;;;AAAA,iCAAiC;AACjC;IAAAA;IAEAC,CAACA;IAADD,UAACA;AAADA,CAACA,AAFD,IAEC;;ICFD,+BAA+B;IAC/B;QAAAE;QAEAC,CAACA;QAADD,QAACA;IAADA,CAACA,AAFD,IAEC;IAFY,SAAC,IAEb,CAAA;;;ICHD;QAAuBE,qBAACA;QAAxBA;YAAuBC,8BAACA;QAAGA,CAACA;QAADD,QAACA;IAADA,CAACA,AAA5B,EAAuB,KAAC,EAAI;IAAf,SAAC,IAAc,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt new file mode 100644 index 00000000000..c95eb22cb10 --- /dev/null +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -0,0 +1,240 @@ +=================================================================== +JsFile: all.js +mapUrl: all.js.map +sourceRoot: +sources: tests/cases/compiler/ref/b.ts,tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/b.ts +------------------------------------------------------------------- +>>>var __extends = (this && this.__extends) || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>/// +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 >/// +1 >Emitted(6, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(6, 34) Source(1, 34) + SourceIndex(0) +--- +>>>var Foo = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function Foo() { +1->^^^^ +2 > ^^-> +1-> +1->Emitted(8, 5) Source(2, 1) + SourceIndex(0) name (Foo) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^^^-> +1->class Foo { + > member: Bar; + > +2 > } +1->Emitted(9, 5) Source(4, 1) + SourceIndex(0) name (Foo.constructor) +2 >Emitted(9, 6) Source(4, 2) + SourceIndex(0) name (Foo.constructor) +--- +>>> return Foo; +1->^^^^ +2 > ^^^^^^^^^^ +1-> +2 > } +1->Emitted(10, 5) Source(4, 1) + SourceIndex(0) name (Foo) +2 >Emitted(10, 15) Source(4, 2) + SourceIndex(0) name (Foo) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class Foo { + > member: Bar; + > } +1 >Emitted(11, 1) Source(4, 1) + SourceIndex(0) name (Foo) +2 >Emitted(11, 2) Source(4, 2) + SourceIndex(0) name (Foo) +3 >Emitted(11, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(11, 6) Source(4, 2) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/ref/a.ts +------------------------------------------------------------------- +>>>define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) { +>>> /// +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> + > +2 > /// +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +2 >Emitted(13, 36) Source(2, 32) + SourceIndex(1) +--- +>>> var A = (function () { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(14, 5) Source(3, 1) + SourceIndex(1) +--- +>>> function A() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(15, 9) Source(3, 1) + SourceIndex(1) name (A) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->export class A { + > member: typeof GlobalFoo; + > +2 > } +1->Emitted(16, 9) Source(5, 1) + SourceIndex(1) name (A.constructor) +2 >Emitted(16, 10) Source(5, 2) + SourceIndex(1) name (A.constructor) +--- +>>> return A; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(17, 9) Source(5, 1) + SourceIndex(1) name (A) +2 >Emitted(17, 17) Source(5, 2) + SourceIndex(1) name (A) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class A { + > member: typeof GlobalFoo; + > } +1 >Emitted(18, 5) Source(5, 1) + SourceIndex(1) name (A) +2 >Emitted(18, 6) Source(5, 2) + SourceIndex(1) name (A) +3 >Emitted(18, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(18, 10) Source(5, 2) + SourceIndex(1) +--- +>>> exports.A = A; +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +1-> +2 > A +3 > { + > member: typeof GlobalFoo; + > } +4 > +1->Emitted(19, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(19, 14) Source(3, 15) + SourceIndex(1) +3 >Emitted(19, 18) Source(5, 2) + SourceIndex(1) +4 >Emitted(19, 19) Source(5, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:all.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>>}); +>>>define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) { +>>> var B = (function (_super) { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >import {A} from "./ref/a"; + > +1 >Emitted(22, 5) Source(2, 1) + SourceIndex(2) +--- +>>> __extends(B, _super); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(23, 9) Source(2, 24) + SourceIndex(2) name (B) +2 >Emitted(23, 30) Source(2, 25) + SourceIndex(2) name (B) +--- +>>> function B() { +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(24, 9) Source(2, 1) + SourceIndex(2) name (B) +--- +>>> _super.apply(this, arguments); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->export class B extends +2 > A +1->Emitted(25, 13) Source(2, 24) + SourceIndex(2) name (B.constructor) +2 >Emitted(25, 43) Source(2, 25) + SourceIndex(2) name (B.constructor) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { +2 > } +1 >Emitted(26, 9) Source(2, 28) + SourceIndex(2) name (B.constructor) +2 >Emitted(26, 10) Source(2, 29) + SourceIndex(2) name (B.constructor) +--- +>>> return B; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(27, 9) Source(2, 28) + SourceIndex(2) name (B) +2 >Emitted(27, 17) Source(2, 29) + SourceIndex(2) name (B) +--- +>>> })(a_1.A); +1 >^^^^ +2 > ^ +3 > +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> +1 > +2 > } +3 > +4 > export class B extends +5 > A +6 > { } +1 >Emitted(28, 5) Source(2, 28) + SourceIndex(2) name (B) +2 >Emitted(28, 6) Source(2, 29) + SourceIndex(2) name (B) +3 >Emitted(28, 6) Source(2, 1) + SourceIndex(2) +4 >Emitted(28, 8) Source(2, 24) + SourceIndex(2) +5 >Emitted(28, 13) Source(2, 25) + SourceIndex(2) +6 >Emitted(28, 15) Source(2, 29) + SourceIndex(2) +--- +>>> exports.B = B; +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +1-> +2 > B +3 > extends A { } +4 > +1->Emitted(29, 5) Source(2, 14) + SourceIndex(2) +2 >Emitted(29, 14) Source(2, 15) + SourceIndex(2) +3 >Emitted(29, 18) Source(2, 29) + SourceIndex(2) +4 >Emitted(29, 19) Source(2, 29) + SourceIndex(2) +--- +>>>}); +>>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.symbols b/tests/baselines/reference/outModuleTripleSlashRefs.symbols new file mode 100644 index 00000000000..f8d550aedb6 --- /dev/null +++ b/tests/baselines/reference/outModuleTripleSlashRefs.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/ref/a.ts === + +/// +export class A { +>A : Symbol(A, Decl(a.ts, 0, 0)) + + member: typeof GlobalFoo; +>member : Symbol(member, Decl(a.ts, 2, 16)) +>GlobalFoo : Symbol(GlobalFoo, Decl(b.ts, 4, 11)) +} + +=== tests/cases/compiler/ref/b.ts === +/// +class Foo { +>Foo : Symbol(Foo, Decl(b.ts, 0, 0)) + + member: Bar; +>member : Symbol(member, Decl(b.ts, 1, 11)) +>Bar : Symbol(Bar, Decl(c.d.ts, 0, 0)) +} +declare var GlobalFoo: Foo; +>GlobalFoo : Symbol(GlobalFoo, Decl(b.ts, 4, 11)) +>Foo : Symbol(Foo, Decl(b.ts, 0, 0)) + +=== tests/cases/compiler/ref/c.d.ts === +/// +declare class Bar { +>Bar : Symbol(Bar, Decl(c.d.ts, 0, 0)) + + member: Baz; +>member : Symbol(member, Decl(c.d.ts, 1, 19)) +>Baz : Symbol(Baz, Decl(d.d.ts, 0, 0)) +} + +=== tests/cases/compiler/ref/d.d.ts === +declare class Baz { +>Baz : Symbol(Baz, Decl(d.d.ts, 0, 0)) + + member: number; +>member : Symbol(member, Decl(d.d.ts, 0, 19)) +} + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : Symbol(A, Decl(b.ts, 0, 8)) + +export class B extends A { } +>B : Symbol(B, Decl(b.ts, 0, 26)) +>A : Symbol(A, Decl(b.ts, 0, 8)) + diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.types b/tests/baselines/reference/outModuleTripleSlashRefs.types new file mode 100644 index 00000000000..917704cce5a --- /dev/null +++ b/tests/baselines/reference/outModuleTripleSlashRefs.types @@ -0,0 +1,50 @@ +=== tests/cases/compiler/ref/a.ts === + +/// +export class A { +>A : A + + member: typeof GlobalFoo; +>member : Foo +>GlobalFoo : Foo +} + +=== tests/cases/compiler/ref/b.ts === +/// +class Foo { +>Foo : Foo + + member: Bar; +>member : Bar +>Bar : Bar +} +declare var GlobalFoo: Foo; +>GlobalFoo : Foo +>Foo : Foo + +=== tests/cases/compiler/ref/c.d.ts === +/// +declare class Bar { +>Bar : Bar + + member: Baz; +>member : Baz +>Baz : Baz +} + +=== tests/cases/compiler/ref/d.d.ts === +declare class Baz { +>Baz : Baz + + member: number; +>member : number +} + +=== tests/cases/compiler/b.ts === +import {A} from "./ref/a"; +>A : typeof A + +export class B extends A { } +>B : B +>A : A + diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.types b/tests/baselines/reference/overloadOnConstConstraintChecks1.types index cc561eb6e21..012774b3cc9 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.types @@ -22,23 +22,23 @@ interface MyDoc { // Document >MyDoc : MyDoc createElement(tagName: string): Base; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } >tagName : string >Base : Base createElement(tagName: 'canvas'): Derived1; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'canvas' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "canvas" >Derived1 : Derived1 createElement(tagName: 'div'): Derived2; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'div' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "div" >Derived2 : Derived2 createElement(tagName: 'span'): Derived3; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'span' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "span" >Derived3 : Derived3 // + 100 more @@ -49,27 +49,27 @@ class D implements MyDoc { >MyDoc : MyDoc createElement(tagName:string): Base; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } >tagName : string >Base : Base createElement(tagName: 'canvas'): Derived1; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'canvas' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "canvas" >Derived1 : Derived1 createElement(tagName: 'div'): Derived2; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'div' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "div" >Derived2 : Derived2 createElement(tagName: 'span'): Derived3; ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } ->tagName : 'span' +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } +>tagName : "span" >Derived3 : Derived3 createElement(tagName:any): Base { ->createElement : { (tagName: string): Base; (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; } +>createElement : { (tagName: string): Base; (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; } >tagName : any >Base : Base diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.types b/tests/baselines/reference/overloadOnConstConstraintChecks2.types index 36fa89dec4a..6102c282a60 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.types @@ -14,22 +14,22 @@ class C extends A { >foo : () => void } function foo(name: 'hi'): B; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } ->name : 'hi' +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } +>name : "hi" >B : B function foo(name: 'bye'): C; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } ->name : 'bye' +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } +>name : "bye" >C : C function foo(name: string): A; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } >name : string >A : A function foo(name: any): A { ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } >name : any >A : A diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index 94a03bb7680..0348d3d4b79 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -16,22 +16,22 @@ class C extends A { >foo : () => void } function foo(name: 'hi'): B; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } ->name : 'hi' +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } +>name : "hi" >B : B function foo(name: 'bye'): C; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } ->name : 'bye' +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } +>name : "bye" >C : C function foo(name: string): A; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } >name : string >A : A function foo(name: any): A { ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : { (name: "hi"): B; (name: "bye"): C; (name: string): A; } >name : any >A : A diff --git a/tests/baselines/reference/overloadOnConstInheritance1.types b/tests/baselines/reference/overloadOnConstInheritance1.types index 96f8df3dffd..4721c18e55c 100644 --- a/tests/baselines/reference/overloadOnConstInheritance1.types +++ b/tests/baselines/reference/overloadOnConstInheritance1.types @@ -3,23 +3,23 @@ interface Base { >Base : Base addEventListener(x: string): any; ->addEventListener : { (x: string): any; (x: 'foo'): string; } +>addEventListener : { (x: string): any; (x: "foo"): string; } >x : string addEventListener(x: 'foo'): string; ->addEventListener : { (x: string): any; (x: 'foo'): string; } ->x : 'foo' +>addEventListener : { (x: string): any; (x: "foo"): string; } +>x : "foo" } interface Deriver extends Base { >Deriver : Deriver >Base : Base addEventListener(x: string): any; ->addEventListener : { (x: string): any; (x: 'bar'): string; } +>addEventListener : { (x: string): any; (x: "bar"): string; } >x : string addEventListener(x: 'bar'): string; ->addEventListener : { (x: string): any; (x: 'bar'): string; } ->x : 'bar' +>addEventListener : { (x: string): any; (x: "bar"): string; } +>x : "bar" } diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt index 159af64a13a..4870106f474 100644 --- a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: 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; }'. + Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'. tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -13,7 +13,7 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali ~~~~~~~ !!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'addEventListener' are incompatible. -!!! error TS2430: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. +!!! error TS2430: 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt index e0fff7b1ec7..b338f9795d7 100644 --- a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: 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'. + Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'. tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -13,7 +13,7 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali ~~~~~~~ !!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'addEventListener' are incompatible. -!!! error TS2430: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. +!!! error TS2430: 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; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt index 1676a2fb426..4fea7cc1227 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(7,10): error TS2381: A signature with an implementation cannot use a string literal type. -tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'. +tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type '"HI"' is not assignable to parameter of type '"SPAN"'. ==== tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts (3 errors) ==== @@ -20,4 +20,4 @@ tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: foo("HI"); ~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'. \ No newline at end of file +!!! error TS2345: Argument of type '"HI"' is not assignable to parameter of type '"SPAN"'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index c6d63523576..b448deaadc7 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/overloadingOnConstants2.ts(8,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type 'string' is not assignable to parameter of type '"bye"'. +tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -25,7 +25,7 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2382: Specialize var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"bye"'. +!!! error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt b/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt new file mode 100644 index 00000000000..54ddb963f94 --- /dev/null +++ b/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt @@ -0,0 +1,44 @@ +tests/cases/compiler/parameterNamesInTypeParameterList.ts(1,30): error TS2304: Cannot find name 'a'. +tests/cases/compiler/parameterNamesInTypeParameterList.ts(5,30): error TS2304: Cannot find name 'a'. +tests/cases/compiler/parameterNamesInTypeParameterList.ts(9,30): error TS2304: Cannot find name 'a'. +tests/cases/compiler/parameterNamesInTypeParameterList.ts(14,22): error TS2304: Cannot find name 'a'. +tests/cases/compiler/parameterNamesInTypeParameterList.ts(17,22): error TS2304: Cannot find name 'a'. +tests/cases/compiler/parameterNamesInTypeParameterList.ts(20,22): error TS2304: Cannot find name 'a'. + + +==== tests/cases/compiler/parameterNamesInTypeParameterList.ts (6 errors) ==== + function f0(a: T) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b; + } + + function f1({a}: {a:T}) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b; + } + + function f2([a]: T[]) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b; + } + + class A { + m0(a: T) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b + } + m1({a}: {a:T}) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b + } + m2([a]: T[]) { + ~ +!!! error TS2304: Cannot find name 'a'. + a.b + } + } \ No newline at end of file diff --git a/tests/baselines/reference/parameterNamesInTypeParameterList.js b/tests/baselines/reference/parameterNamesInTypeParameterList.js new file mode 100644 index 00000000000..2fbd7fad3cb --- /dev/null +++ b/tests/baselines/reference/parameterNamesInTypeParameterList.js @@ -0,0 +1,53 @@ +//// [parameterNamesInTypeParameterList.ts] +function f0(a: T) { + a.b; +} + +function f1({a}: {a:T}) { + a.b; +} + +function f2([a]: T[]) { + a.b; +} + +class A { + m0(a: T) { + a.b + } + m1({a}: {a:T}) { + a.b + } + m2([a]: T[]) { + a.b + } +} + +//// [parameterNamesInTypeParameterList.js] +function f0(a) { + a.b; +} +function f1(_a) { + var a = _a.a; + a.b; +} +function f2(_a) { + var a = _a[0]; + a.b; +} +var A = (function () { + function A() { + } + A.prototype.m0 = function (a) { + a.b; + }; + A.prototype.m1 = function (_a) { + var a = _a.a; + a.b; + }; + A.prototype.m2 = function (_a) { + var a = _a[0]; + a.b; + }; + return A; +})(); diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt deleted file mode 100644 index 707e68c2c45..00000000000 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt +++ /dev/null @@ -1,34 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts(12,21): error TS1110: Type expected. - - -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts (1 errors) ==== - // Interface - interface IPoint { - getDist(): number; - } - - // Module - module Shapes { - - // Class - export class Point implements IPoint { - - public con: "hello"; - ~~~~~~~ -!!! error TS1110: Type expected. - // 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); - } - - } - - // Local variables - var p: IPoint = new Shapes.Point(3, 4); - var dist = p.getDist(); - \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js index ae2509c3f49..8055cd9d494 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js @@ -38,7 +38,6 @@ var Shapes; function Point(x, y) { this.x = x; this.y = y; - this.con = "hello"; } // Instance member Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.symbols b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.symbols new file mode 100644 index 00000000000..7b8be05f923 --- /dev/null +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts === +// Interface +interface IPoint { +>IPoint : Symbol(IPoint, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 0, 0)) + + getDist(): number; +>getDist : Symbol(getDist, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 1, 18)) +} + +// Module +module Shapes { +>Shapes : Symbol(Shapes, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 3, 1)) + + // Class + export class Point implements IPoint { +>Point : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>IPoint : Symbol(IPoint, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 0, 0)) + + public con: "hello"; +>con : Symbol(con, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 9, 42)) + + // Constructor + constructor (public x: number, public y: number) { } +>x : Symbol(x, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 21)) +>y : Symbol(y, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 38)) + + // Instance member + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } +>getDist : Symbol(getDist, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 60)) +>Math.sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, --, --)) +>this.x : Symbol(x, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 21)) +>this : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>x : Symbol(x, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 21)) +>this.x : Symbol(x, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 21)) +>this : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>x : Symbol(x, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 21)) +>this.y : Symbol(y, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 38)) +>this : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>y : Symbol(y, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 38)) +>this.y : Symbol(y, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 38)) +>this : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>y : Symbol(y, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 13, 38)) + + // Static member + static origin = new Point(0, 0); +>origin : Symbol(Point.origin, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 16, 74)) +>Point : Symbol(Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) + } + +} + +// Local variables +var p: IPoint = new Shapes.Point(3, 4); +>p : Symbol(p, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 25, 3)) +>IPoint : Symbol(IPoint, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 0, 0)) +>Shapes.Point : Symbol(Shapes.Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) +>Shapes : Symbol(Shapes, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 3, 1)) +>Point : Symbol(Shapes.Point, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 6, 15)) + +var dist = p.getDist(); +>dist : Symbol(dist, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 26, 3)) +>p.getDist : Symbol(IPoint.getDist, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 1, 18)) +>p : Symbol(p, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 25, 3)) +>getDist : Symbol(IPoint.getDist, Decl(parserErrorRecovery_IncompleteMemberVariable1.ts, 1, 18)) + diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types new file mode 100644 index 00000000000..b38bbbfe64d --- /dev/null +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types @@ -0,0 +1,78 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts === +// Interface +interface IPoint { +>IPoint : IPoint + + getDist(): number; +>getDist : () => number +} + +// Module +module Shapes { +>Shapes : typeof Shapes + + // Class + export class Point implements IPoint { +>Point : Point +>IPoint : IPoint + + public con: "hello"; +>con : "hello" + + // Constructor + constructor (public x: number, public y: number) { } +>x : number +>y : number + + // Instance member + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } +>getDist : () => number +>Math.sqrt(this.x * this.x + this.y * this.y) : number +>Math.sqrt : (x: number) => number +>Math : Math +>sqrt : (x: number) => number +>this.x * this.x + this.y * this.y : number +>this.x * this.x : number +>this.x : number +>this : this +>x : number +>this.x : number +>this : this +>x : number +>this.y * this.y : number +>this.y : number +>this : this +>y : number +>this.y : number +>this : this +>y : number + + // Static member + static origin = new Point(0, 0); +>origin : Point +>new Point(0, 0) : Point +>Point : typeof Point +>0 : number +>0 : number + } + +} + +// Local variables +var p: IPoint = new Shapes.Point(3, 4); +>p : IPoint +>IPoint : IPoint +>new Shapes.Point(3, 4) : Shapes.Point +>Shapes.Point : typeof Shapes.Point +>Shapes : typeof Shapes +>Point : typeof Shapes.Point +>3 : number +>4 : number + +var dist = p.getDist(); +>dist : number +>p.getDist() : number +>p.getDist : () => number +>p : IPoint +>getDist : () => number + diff --git a/tests/baselines/reference/primtiveTypesAreIdentical.types b/tests/baselines/reference/primtiveTypesAreIdentical.types index bbff4623f0b..0b8e7dadf7d 100644 --- a/tests/baselines/reference/primtiveTypesAreIdentical.types +++ b/tests/baselines/reference/primtiveTypesAreIdentical.types @@ -50,19 +50,19 @@ function foo4(x: any) { } >x : any function foo5(x: 'a'); ->foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; } ->x : 'a' +>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; } +>x : "a" function foo5(x: 'a'); ->foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; } ->x : 'a' +>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; } +>x : "a" function foo5(x: string); ->foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; } +>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; } >x : string function foo5(x: any) { } ->foo5 : { (x: 'a'): any; (x: 'a'): any; (x: string): any; } +>foo5 : { (x: "a"): any; (x: "a"): any; (x: string): any; } >x : any enum E { A } diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.json new file mode 100644 index 00000000000..0729dbedfae --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/jsFileCompilationDifferentNamesNotSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesNotSpecified/a.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/amd/test.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt new file mode 100644 index 00000000000..e1a24fa3842 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.errors.txt @@ -0,0 +1,6 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== DifferentNamesNotSpecified/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.json new file mode 100644 index 00000000000..0729dbedfae --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/jsFileCompilationDifferentNamesNotSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesNotSpecified/a.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecified/node/test.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..67b0592c05f --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,8 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== DifferentNamesNotSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; +==== DifferentNamesNotSpecifiedWithAllowJs/b.js (0 errors) ==== + var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..4487623500b --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json @@ -0,0 +1,16 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesNotSpecifiedWithAllowJs/a.ts", + "DifferentNamesNotSpecifiedWithAllowJs/b.js" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.js new file mode 100644 index 00000000000..f2115703462 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/test.js @@ -0,0 +1,2 @@ +var test = 10; +var test2 = 10; // Should get compiled diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..dbebea69cce --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,10 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== DifferentNamesNotSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; +==== DifferentNamesNotSpecifiedWithAllowJs/b.js (0 errors) ==== + var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..4487623500b --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json @@ -0,0 +1,16 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesNotSpecifiedWithAllowJs/a.ts", + "DifferentNamesNotSpecifiedWithAllowJs/b.js" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.js new file mode 100644 index 00000000000..f2115703462 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/test.js @@ -0,0 +1,2 @@ +var test = 10; +var test2 = 10; // Should get compiled diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt new file mode 100644 index 00000000000..5fa60d18af9 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.errors.txt @@ -0,0 +1,6 @@ +error TS6054: File 'DifferentNamesSpecified/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. + + +!!! error TS6054: File 'DifferentNamesSpecified/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +==== DifferentNamesSpecified/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.json new file mode 100644 index 00000000000..36eed6a6518 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/jsFileCompilationDifferentNamesSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesSpecified/a.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/amd/test.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt new file mode 100644 index 00000000000..c05a142a93c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.errors.txt @@ -0,0 +1,8 @@ +error TS6054: File 'DifferentNamesSpecified/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6054: File 'DifferentNamesSpecified/b.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'. +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== DifferentNamesSpecified/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.json new file mode 100644 index 00000000000..36eed6a6518 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/jsFileCompilationDifferentNamesSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesSpecified/a.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecified/node/test.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..35c913a5835 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,8 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== DifferentNamesSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; +==== DifferentNamesSpecifiedWithAllowJs/b.js (0 errors) ==== + var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..e77cc5ad6bd --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json @@ -0,0 +1,16 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesSpecifiedWithAllowJs/a.ts", + "DifferentNamesSpecifiedWithAllowJs/b.js" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.js new file mode 100644 index 00000000000..f2115703462 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/test.js @@ -0,0 +1,2 @@ +var test = 10; +var test2 = 10; // Should get compiled diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..c8c2ca976c6 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,10 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== DifferentNamesSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; +==== DifferentNamesSpecifiedWithAllowJs/b.js (0 errors) ==== + var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..e77cc5ad6bd --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json @@ -0,0 +1,16 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "DifferentNamesSpecifiedWithAllowJs/a.ts", + "DifferentNamesSpecifiedWithAllowJs/b.js" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.d.ts b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.js b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.js new file mode 100644 index 00000000000..f2115703462 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/test.js @@ -0,0 +1,2 @@ +var test = 10; +var test2 = 10; // Should get compiled diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/amd/jsFileCompilationSameNameDTsSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/amd/jsFileCompilationSameNameDTsSpecified.json new file mode 100644 index 00000000000..d0ffac121e4 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/amd/jsFileCompilationSameNameDTsSpecified.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsSpecified/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/node/jsFileCompilationSameNameDTsSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/node/jsFileCompilationSameNameDTsSpecified.json new file mode 100644 index 00000000000..d0ffac121e4 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecified/node/jsFileCompilationSameNameDTsSpecified.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsSpecified/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..cdec4ffb398 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameDTsSpecifiedWithAllowJs/a.d.ts (0 errors) ==== + declare var test: number; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..27ec20feb8d --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsSpecifiedWithAllowJs/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..cdec4ffb398 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameDTsSpecifiedWithAllowJs/a.d.ts (0 errors) ==== + declare var test: number; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..27ec20feb8d --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsSpecifiedWithAllowJs/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/amd/jsFileCompilationSameNameDtsNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/amd/jsFileCompilationSameNameDtsNotSpecified.json new file mode 100644 index 00000000000..a619f0e1e22 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/amd/jsFileCompilationSameNameDtsNotSpecified.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsNotSpecified/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/node/jsFileCompilationSameNameDtsNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/node/jsFileCompilationSameNameDtsNotSpecified.json new file mode 100644 index 00000000000..a619f0e1e22 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecified/node/jsFileCompilationSameNameDtsNotSpecified.json @@ -0,0 +1,12 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsNotSpecified/a.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..ac25edc1bd5 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,10 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +!!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. +==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== + declare var a: number; +==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ==== + var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..b4c3fb8f51b --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json @@ -0,0 +1,13 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsNotSpecifiedWithAllowJs/a.d.ts", + "SameNameDTsNotSpecifiedWithAllowJs/a.js" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..ac25edc1bd5 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,10 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +!!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. +==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== + declare var a: number; +==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ==== + var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..b4c3fb8f51b --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json @@ -0,0 +1,13 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameDTsNotSpecifiedWithAllowJs/a.d.ts", + "SameNameDTsNotSpecifiedWithAllowJs/a.js" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/SameNameFilesNotSpecified/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/jsFileCompilationSameNameFilesNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/jsFileCompilationSameNameFilesNotSpecified.json new file mode 100644 index 00000000000..2b4d6b2b35a --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/amd/jsFileCompilationSameNameFilesNotSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameFilesNotSpecified/a.ts" + ], + "emittedFiles": [ + "SameNameFilesNotSpecified/a.js", + "SameNameFilesNotSpecified/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/SameNameFilesNotSpecified/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/jsFileCompilationSameNameFilesNotSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/jsFileCompilationSameNameFilesNotSpecified.json new file mode 100644 index 00000000000..2b4d6b2b35a --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecified/node/jsFileCompilationSameNameFilesNotSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameFilesNotSpecified/a.ts" + ], + "emittedFiles": [ + "SameNameFilesNotSpecified/a.js", + "SameNameFilesNotSpecified/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/SameNameFilesNotSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..9eb81a5f9f1 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameFilesNotSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..34d6768372f --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameFilesNotSpecifiedWithAllowJs/a.ts" + ], + "emittedFiles": [ + "SameNameFilesNotSpecifiedWithAllowJs/a.js", + "SameNameFilesNotSpecifiedWithAllowJs/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/SameNameFilesNotSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..9eb81a5f9f1 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameFilesNotSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..34d6768372f --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameFilesNotSpecifiedWithAllowJs/a.ts" + ], + "emittedFiles": [ + "SameNameFilesNotSpecifiedWithAllowJs/a.js", + "SameNameFilesNotSpecifiedWithAllowJs/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/SameNameTsSpecified/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/jsFileCompilationSameNameFilesSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/jsFileCompilationSameNameFilesSpecified.json new file mode 100644 index 00000000000..ddf148ea982 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/amd/jsFileCompilationSameNameFilesSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameTsSpecified/a.ts" + ], + "emittedFiles": [ + "SameNameTsSpecified/a.js", + "SameNameTsSpecified/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/SameNameTsSpecified/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/jsFileCompilationSameNameFilesSpecified.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/jsFileCompilationSameNameFilesSpecified.json new file mode 100644 index 00000000000..ddf148ea982 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecified/node/jsFileCompilationSameNameFilesSpecified.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecified", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameTsSpecified/a.ts" + ], + "emittedFiles": [ + "SameNameTsSpecified/a.js", + "SameNameTsSpecified/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/SameNameTsSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..ddfb63686b4 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameTsSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..ae68fac44bd --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameTsSpecifiedWithAllowJs/a.ts" + ], + "emittedFiles": [ + "SameNameTsSpecifiedWithAllowJs/a.js", + "SameNameTsSpecifiedWithAllowJs/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.d.ts b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.js b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/SameNameTsSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt new file mode 100644 index 00000000000..ddfb63686b4 --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt @@ -0,0 +1,6 @@ +error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. + + +!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. +==== SameNameTsSpecifiedWithAllowJs/a.ts (0 errors) ==== + var test = 10; \ No newline at end of file diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..ae68fac44bd --- /dev/null +++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecifiedWithAllowJs", + "resolvedInputFiles": [ + "lib.d.ts", + "SameNameTsSpecifiedWithAllowJs/a.ts" + ], + "emittedFiles": [ + "SameNameTsSpecifiedWithAllowJs/a.js", + "SameNameTsSpecifiedWithAllowJs/a.d.ts" + ] +} \ 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 index fa9e0b566a9..8a96d681f24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json index fa9e0b566a9..8a96d681f24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json index ebaec46d1e3..997c2ed46c0 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json index ebaec46d1e3..997c2ed46c0 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 7ef36232b8d..af837fd2031 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index a1d591a0497..94371fe696d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index ee020b0ff80..39641313eb9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 133c266cc9e..94348f987ce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:../ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:../ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:../test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 9dad0db002a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 0e907c1a2ca..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index a1d591a0497..a580c050d07 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ee020b0ff80..39641313eb9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0b573b627cf..3f16355ad76 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:../test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index 3eaebd5c136..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index cbb2dc36492..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index fc53d59d7cb..de704afeedb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 4f87045fd25..22aaecafe2d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index ed7bcd289e7..a088b23354e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a9e2e3f0e3c..c0dbdb42cdf 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:../ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:../test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 9dad0db002a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 0e907c1a2ca..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 4f87045fd25..2eab0f87324 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ed7bcd289e7..a088b23354e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index c4c267ec395..963b3f3bb22 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:../test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 3eaebd5c136..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index cbb2dc36492..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json index 8f512dcc98c..7474a34ec8c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json index 8f512dcc98c..7474a34ec8c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json index 4f65daf7560..b0c91671012 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json index 4f65daf7560..b0c91671012 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 18e06e5bc50..25cd156c4ab 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/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 index c1e0281a2ab..c532c3846d9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index b02c7fdd8c2..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 8fe95a1506f..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json index 6432d5ae91e..14643d2565d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index da94013dea3..4462b142d98 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map sourceRoot: -sources: ../../../ref/m1.ts +sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../ref/m1.ts +emittedFile:bin/test.js +sourceFile:../ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../../../ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:../../../outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:../../test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:../../test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:../../test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:../../test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:../../test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:../../test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:../../test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:../../test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:../../test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:../../test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index 52b5e682660..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 652d934d602..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index a2a29b4dcfc..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index be0b3a580f5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..2974abdc1cc 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"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 deleted file mode 100644 index f9d0dd89e9c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 589c5838a2c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json index 6432d5ae91e..14643d2565d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index f348cfad93c..5b0497285e2 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index b0e6a265bc9..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 15bddd32fe5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 16422a234c5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index eae921435ac..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/mapRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json index 31a0fb89c50..ff1b014410e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json index 31a0fb89c50..ff1b014410e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json index 355458526bc..a1559326528 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json index 355458526bc..a1559326528 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index f6e3eb542f4..d3d9bd9dc85 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..6377a26395e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index 86c0ba41238..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 7f5576a8a9c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index f703a63b71f..40d72149fd9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 759b9dab302..d8ab3db1266 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: /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: ../m1.ts +sources: ../m1.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:../m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:../test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:../test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:../test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:../test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:../test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:../test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:../test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:../test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:../test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:../test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 6e24571a3f2..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 80d6bbf450b..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..f491a9ec373 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index c8a4f5c91a4..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index ce271e4a3cd..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index f703a63b71f..40d72149fd9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 75228e5ea64..1eef0eba6f2 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../m1.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index 080dcf6e818..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index de9ec1f9859..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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 index a6bc71dd664..27d5d010b40 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json index a6bc71dd664..27d5d010b40 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json index e873c8fc472..8e16e5d165d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json index e873c8fc472..8e16e5d165d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 7ff280253f1..176c3f78407 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..f77c1351b15 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index d8f4cc74008..8787d932d29 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 18b397608e4..d63cf86d236 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: /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: ../../ref/m1.ts +sources: ../ref/m1.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts +emittedFile:bin/test.js +sourceFile:../ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../../ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:../test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:../test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:../test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:../test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:../test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:../test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:../test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:../test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:../test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:../test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index e819d557c40..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 88e67e19b36..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 3b2cd1a24c4..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 80d6bbf450b..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..bfdacf69428 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index d8f4cc74008..8787d932d29 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 97c6b8a85e4..20f2ab47188 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../ref/m1.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index a420241c901..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 420650feeac..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index f6319258d8f..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 15d4e3e1c9b..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json index 49018ee5973..f511365c917 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json index 49018ee5973..f511365c917 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json index 097c9bbf209..b3c5617dffa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json index 097c9bbf209..b3c5617dffa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json index bcf3a4400aa..81f0ad78eb3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index bcf3a4400aa..81f0ad78eb3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json index d5914d92950..8a32acd12e1 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json index d5914d92950..8a32acd12e1 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json index 2c5e1dae38a..23cc45f9645 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json index 2c5e1dae38a..23cc45f9645 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json index 8431a99c800..72a0dce3007 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 8431a99c800..72a0dce3007 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json index 4a180368e20..d26b77e4675 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json index 4a180368e20..d26b77e4675 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json index a44a569a0a6..e712eab1a75 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json index a44a569a0a6..e712eab1a75 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json index 7c0069605da..c66cea7fd44 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 7c0069605da..c66cea7fd44 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json index 1b09decc58d..a3c1bede2a1 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json index 1b09decc58d..a3c1bede2a1 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json index a02eb484aa2..ddd2bdee5a8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json index a02eb484aa2..ddd2bdee5a8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json index ec516baecfe..d452a55784f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ec516baecfe..d452a55784f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", - "resolveMapRoot": true, "declaration": true, "baselineCheck": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json index 5352fd8a988..af9fb8ba53b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json index 5352fd8a988..af9fb8ba53b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json index 0a0d68e300a..9faeb47e4c8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json index 0a0d68e300a..9faeb47e4c8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index c4c79e0454b..bd14cd07502 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index b63911a2bc8..ca8dd0934b5 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index 8e87f61b8df..1ec6dbe907e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index f1cc6df9de8..cfd0952c941 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:../outputdir_mixed_subfolder/ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../outputdir_mixed_subfolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 4f0b35f21c7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 81bb9202e5a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index b63911a2bc8..02be1ec09fb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 8e87f61b8df..1ec6dbe907e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0a373a20359..931a09b3ae6 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index f13773b3384..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 98da596cfa4..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index c0138423cae..59405bccb9c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 630508cb9f8..794d2a58176 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index 4ed441e2552..fc1dc40836b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index fd08e128cfe..cb14a553f05 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:../outputdir_mixed_subfolder/ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../outputdir_mixed_subfolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index e4c8f7b3610..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 81bb9202e5a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 630508cb9f8..43710b5f061 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 4ed441e2552..fc1dc40836b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index eb9ad2993b2..eddbc79711c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index d78261fe225..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 98da596cfa4..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json index 8ec143b2dce..42354ecded5 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json index 8ec143b2dce..42354ecded5 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json index 96777b6f502..969b730a251 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json index 96777b6f502..969b730a251 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index f359cef4be2..8b109433561 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/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 index c1e0281a2ab..a7235c6c2b3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_module_multifolder/ref/m1.ts","../projects/outputdir_module_multifolder_ref/m2.ts","../projects/outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index 9745ad1a4ab..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index ad9b3f68611..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json index f3c86f22eb7..2f6c92af199 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index c2eacec3bdc..47e1835365a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map sourceRoot: -sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +sources: ../projects/outputdir_module_multifolder/ref/m1.ts,../projects/outputdir_module_multifolder_ref/m2.ts,../projects/outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +emittedFile:bin/test.js +sourceFile:../projects/outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:../../projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index 09fbf68994d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index e7200adafdb..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 90dee0800c7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index f2b1ea70110..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..ca280b23052 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_module_multifolder/ref/m1.ts","../projects/outputdir_module_multifolder_ref/m2.ts","../projects/outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index c2ac2bc2710..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 573ce2ac6c5..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json index f3c86f22eb7..2f6c92af199 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index 1d6a282976d..ce08ef2c878 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: ../projects/outputdir_module_multifolder/ref/m1.ts,../projects/outputdir_module_multifolder_ref/m2.ts,../projects/outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 87f1f3a51b7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 074ab743af3..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 6e2fb8d7851..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 85da8e39421..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/mapRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json index a4e8c09b004..162bcbaa749 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json index a4e8c09b004..162bcbaa749 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json index f4a8884b58e..440dbb0972e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json index f4a8884b58e..440dbb0972e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index 58e831a041d..8ff2bbdb75b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..b94a5ff18e5 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts","../outputdir_module_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index 1fe3446e4bc..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index e2625035edb..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index fe0b8045a5c..2346dd23910 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 410dc94963f..8099c2f176a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: ../mapFiles/m1.js.map +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map sourceRoot: -sources: ../outputdir_module_simple/m1.ts +sources: ../outputdir_module_simple/m1.ts,../outputdir_module_simple/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:../outputdir_module_simple/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../outputdir_module_simple/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:../outputdir_module_simple/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:../outputdir_module_simple/test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:../outputdir_module_simple/test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:../outputdir_module_simple/test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:../outputdir_module_simple/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:../outputdir_module_simple/test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:../outputdir_module_simple/test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:../outputdir_module_simple/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:../outputdir_module_simple/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:../outputdir_module_simple/test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 14471b6e983..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 5ce16293424..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..847236565f8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts","../outputdir_module_simple/test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 73a399fe253..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0950101384d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index fe0b8045a5c..2346dd23910 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 0af20dc5ef9..4c009331988 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../outputdir_module_simple/m1.ts,../outputdir_module_simple/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index 1a2a4fc5e6a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c0654a8e141..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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 index a2779060068..5abb8eec3da 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json index a2779060068..5abb8eec3da 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json index 120bb5afbb6..d587558fbaf 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json index 120bb5afbb6..d587558fbaf 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 58e831a041d..ccc0a7b503b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..ae6d9b42221 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/ref/m1.ts","../outputdir_module_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index a87c7d36d8e..c688513f28f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index fe747e98d9c..e666ef224a3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map sourceRoot: -sources: ../../outputdir_module_subfolder/ref/m1.ts +sources: ../outputdir_module_subfolder/ref/m1.ts,../outputdir_module_subfolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_module_subfolder/ref/m1.ts +emittedFile:bin/test.js +sourceFile:../outputdir_module_subfolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:../../outputdir_module_subfolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:../outputdir_module_subfolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:../outputdir_module_subfolder/test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:../outputdir_module_subfolder/test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:../outputdir_module_subfolder/test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:../outputdir_module_subfolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:../outputdir_module_subfolder/test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:../outputdir_module_subfolder/test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:../outputdir_module_subfolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:../outputdir_module_subfolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:../outputdir_module_subfolder/test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index 3e8406858e2..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 66acf4aace7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 84b62ed0fc7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 6139e8293b0..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..b8c7cced3ae 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/ref/m1.ts","../outputdir_module_subfolder/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index a87c7d36d8e..c688513f28f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 8f609cc28d9..a57632c4e07 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../outputdir_module_subfolder/ref/m1.ts,../outputdir_module_subfolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 2dbac1edb8e..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 7e9c3643b99..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index c6dd0639fb7..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 64b21aa3115..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json index 718cfdabf0f..89fc00cb3ec 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json index 718cfdabf0f..89fc00cb3ec 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json index f51e53f02f6..d0034c920bc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json index f51e53f02f6..d0034c920bc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js index 8fafee438e6..acd2d113c02 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -30,4 +30,4 @@ var instance1 = new c1(); function f1() { return instance1; } -//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file +//# 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 index 03cefb2f8d3..fc3b27ea65c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index 0d3f3ad02d5..17fc8719be6 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index d173bd36fb2..534e9184f7b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,12 +1,12 @@ =================================================================== JsFile: test.js -mapUrl: ../../mapFiles/test.js.map +mapUrl: ../../../mapFiles/test.js.map sourceRoot: -sources: ../outputdir_multifolder/ref/m1.ts,../outputdir_multifolder_ref/m2.ts,../outputdir_multifolder/test.ts +sources: ../projects/outputdir_multifolder/ref/m1.ts,../projects/outputdir_multifolder_ref/m2.ts,../projects/outputdir_multifolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder/ref/m1.ts +sourceFile:../projects/outputdir_multifolder/ref/m1.ts ------------------------------------------------------------------- >>>var m1_a1 = 10; 1 > @@ -143,7 +143,7 @@ sourceFile:../outputdir_multifolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder_ref/m2.ts +sourceFile:../projects/outputdir_multifolder_ref/m2.ts ------------------------------------------------------------------- >>>var m2_a1 = 10; 1-> @@ -280,7 +280,7 @@ sourceFile:../outputdir_multifolder_ref/m2.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder/test.ts +sourceFile:../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> @@ -427,11 +427,11 @@ sourceFile:../outputdir_multifolder/test.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) name (f1) 2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) name (f1) --- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js index 8fafee438e6..acd2d113c02 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -30,4 +30,4 @@ var instance1 = new c1(); function f1() { return instance1; } -//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file +//# 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 index 03cefb2f8d3..fc3b27ea65c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 0d3f3ad02d5..17fc8719be6 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index d173bd36fb2..534e9184f7b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,12 +1,12 @@ =================================================================== JsFile: test.js -mapUrl: ../../mapFiles/test.js.map +mapUrl: ../../../mapFiles/test.js.map sourceRoot: -sources: ../outputdir_multifolder/ref/m1.ts,../outputdir_multifolder_ref/m2.ts,../outputdir_multifolder/test.ts +sources: ../projects/outputdir_multifolder/ref/m1.ts,../projects/outputdir_multifolder_ref/m2.ts,../projects/outputdir_multifolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder/ref/m1.ts +sourceFile:../projects/outputdir_multifolder/ref/m1.ts ------------------------------------------------------------------- >>>var m1_a1 = 10; 1 > @@ -143,7 +143,7 @@ sourceFile:../outputdir_multifolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder_ref/m2.ts +sourceFile:../projects/outputdir_multifolder_ref/m2.ts ------------------------------------------------------------------- >>>var m2_a1 = 10; 1-> @@ -280,7 +280,7 @@ sourceFile:../outputdir_multifolder_ref/m2.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js -sourceFile:../outputdir_multifolder/test.ts +sourceFile:../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> @@ -427,11 +427,11 @@ sourceFile:../outputdir_multifolder/test.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) name (f1) 2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) name (f1) --- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ 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 index d4d500a397e..ee2758b4e87 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json index d4d500a397e..ee2758b4e87 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json index 12801537d2b..de85b187e28 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json index 12801537d2b..de85b187e28 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json index d6bbe96a7e0..0e7a2f759bc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index d6bbe96a7e0..0e7a2f759bc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json index bb7ccbf453b..f8b9e1b96c2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json index bb7ccbf453b..f8b9e1b96c2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json index f654dbc3fac..4960088c269 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json index f654dbc3fac..4960088c269 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json index fc285030e8f..e14165a2094 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index fc285030e8f..e14165a2094 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json index b5b1dfba62e..f47e52efaae 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json index b5b1dfba62e..f47e52efaae 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json index a06e2f34d5a..d54421a13ac 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json index a06e2f34d5a..d54421a13ac 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json index 77243118702..da673bae82c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 77243118702..da673bae82c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "../mapFiles", "declaration": true, "baselineCheck": true, + "mapRoot": "../mapFiles", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json index c6612841210..24e51c87f59 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json index c6612841210..24e51c87f59 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json index b225c4e408f..9ad38e70ea2 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json index b225c4e408f..9ad38e70ea2 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index af0071d7e46..6fbac81a12d 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index df57785d945..c6996bb53b9 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index f987aa49ffe..c8af9ff2c3c 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0c806666ef0..0fa723ff01b 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index aa404804b45..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c2157bc3b1b..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index df57785d945..0b202d40b8c 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index f987aa49ffe..c8af9ff2c3c 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index aede30c6f73..bfe9f5dff6a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index a39f0f50e5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0230aad40a5..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 2ebe138ffda..8c16871c4a7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index e7042dca90a..d78e3b4607a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index 2bb23cdc610..55020dd2a68 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 5637274312d..6746d0609b6 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index aa404804b45..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c2157bc3b1b..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index e7042dca90a..363ef3c21bf 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 2bb23cdc610..55020dd2a68 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index fa3d5513061..14ca884e9f7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index a39f0f50e5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0230aad40a5..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json index 6ecdc26ccd4..e63320ddb6a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json index 6ecdc26ccd4..e63320ddb6a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json index 9884550745c..8bedb002041 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json index 9884550745c..8bedb002041 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 52f1b822100..0734d350e11 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/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 index c1e0281a2ab..211bf71cbed 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index 66c8fa96a0b..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index e926e95f3c3..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json index e061982b32f..d6640cdb404 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index 1fce6af3084..5805c876be8 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>}); +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- ->>>}); ->>>//# 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 +emittedFile:bin/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) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index e8004c87aad..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 37bc8039271..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 01ad8f96e78..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 4e7e9721b83..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..1c42486b782 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index ec29dfcad18..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 721fdf3827f..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json index e061982b32f..d6640cdb404 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index aaf57c9d055..e66e92ff5cf 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 7b14808a067..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c88465aaec4..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index b9191db7d5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 6a18d277c10..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/maprootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json index f9f02dcf789..f8a6fa3cd59 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json index f9f02dcf789..f8a6fa3cd59 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json index db2995acf69..c307775e549 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json index db2995acf69..c307775e549 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index 52f1b822100..77db9e80a53 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..445268f27c1 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts","file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index 1a4d200cdcb..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d2270dfd2ce..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index e636ce61f7e..e96204c5faa 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index 7c3fae48716..36bfe394d39 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: 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/m1.ts +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts,file:///tests/cases/projects/outputdir_module_simple/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index d752d7f8395..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index de9d99184d2..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..a7424e92122 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts","file:///tests/cases/projects/outputdir_module_simple/test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 02ca4ab81c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index bc2e2667bcd..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index e636ce61f7e..e96204c5faa 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index 804e4408446..ef808a08b3f 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts,file:///tests/cases/projects/outputdir_module_simple/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index 1d5a32f0ad5..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index b9c164bb732..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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 index 2c7699ff0fa..91546861e01 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json index 2c7699ff0fa..91546861e01 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json index a61a50a760d..80247e1b009 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json index a61a50a760d..80247e1b009 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 52f1b822100..10c38a74411 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..439677f8aba 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index 05da8c15292..10de4bede9e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index 894bcf6cef4..617b90f7c81 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: 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/ref/m1.ts +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_subfolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index 73309eabe30..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index ec8a7690d47..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 270604ea7cb..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 35691a873b8..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..44276925bda 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 05da8c15292..10de4bede9e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index 9a7f754c534..16bcb98e00c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_subfolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 8f31dc2aaa2..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 95de442e92d..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 9bb4ed0180a..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index fee2f4cb129..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json index 5ea7aa80665..078c565dee6 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json index 5ea7aa80665..078c565dee6 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json index 0d16b53af66..dfd35e2a11e 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json index 0d16b53af66..dfd35e2a11e 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json index 8fb63eb43b0..e515573b4d8 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 8fb63eb43b0..e515573b4d8 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json index 6f141f81511..6ea29c1e036 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json index 6f141f81511..6ea29c1e036 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json index 1f73a2a33d6..999d4c5c3cb 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json index 1f73a2a33d6..999d4c5c3cb 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json index dcd18f3e946..85527f93f24 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index dcd18f3e946..85527f93f24 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json index 689739aedce..9cdafc48766 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json index 689739aedce..9cdafc48766 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json index bbd1c10f320..7ee5dedd0de 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json index bbd1c10f320..7ee5dedd0de 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json index 634d80d7ff0..d48c8114927 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 634d80d7ff0..d48c8114927 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json index edd08fbfe10..eb0a847c3cb 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json index edd08fbfe10..eb0a847c3cb 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json index 0b2ea473029..ec6fe614b43 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json index 0b2ea473029..ec6fe614b43 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json index d4965ed4e74..f8d936825fd 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index d4965ed4e74..f8d936825fd 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json index 2f2a4280abf..25ba4998578 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json index 2f2a4280abf..25ba4998578 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json index 006720b1cc3..4978c9691b4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json index 006720b1cc3..4978c9691b4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index af0071d7e46..6fbac81a12d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 7a70d18105c..37bb9be8a95 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index c36f3ade5e0..fce465172dd 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index 49c44cde80e..1a75ab0b601 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index aa404804b45..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 04f168a6289..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 7a70d18105c..a6626039aa2 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index c36f3ade5e0..fce465172dd 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index d54d4d6245e..d1ab16ddf2b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index a39f0f50e5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0ce68e169af..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 2ebe138ffda..8c16871c4a7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 53e31e30260..f3058d9f878 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 index 4741b9cf9e1..430853b944d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 7793026dd6e..2a4bc95cbc2 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index aa404804b45..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 04f168a6289..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 53e31e30260..ba9f4ee590c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 4741b9cf9e1..430853b944d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a6deca12207..da3d501acb7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index a39f0f50e5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0ce68e169af..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json index ec6313ac50c..ce844561c41 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json index ec6313ac50c..ce844561c41 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json index 9a0d0258ca4..a73eb85b5c4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json index 9a0d0258ca4..a73eb85b5c4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 52f1b822100..0734d350e11 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/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 index d3e851981ec..85e465474d3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index 3b00d82ab66..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index e926e95f3c3..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json index 3ecf4bc4cc4..98804be1c15 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index deb74d2ae36..20a97890399 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder_ref/m2.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>}); +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- ->>>}); ->>>//# 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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index e8004c87aad..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 8c257bd1111..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 01ad8f96e78..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 8612cd0d108..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..f84040526ba 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index 058e405b606..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 721fdf3827f..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json index 3ecf4bc4cc4..98804be1c15 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index 5f476cfb8ed..909ae1c3750 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 7b14808a067..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index e7f54a4a2e1..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index b9191db7d5f..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 4ac74c2fcdb..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json index d901eb0a790..7b1ffa340c5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json index d901eb0a790..7b1ffa340c5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json index 278bc2c86e5..bf1e9882756 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json index 278bc2c86e5..bf1e9882756 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index 52f1b822100..77db9e80a53 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index d3e851981ec..2ace469f902 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index 1a4d200cdcb..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6751f2f82cd..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 2cfc9aebda2..7b5ccb6c071 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index 8b526ff5859..bd33dbb5ec7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts +sources: m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index d752d7f8395..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index a57b57d2b17..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..3b75f2878c9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 02ca4ab81c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index ca45773f423..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 2cfc9aebda2..7b5ccb6c071 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index ff984bf74ee..d9df59725a9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index 1d5a32f0ad5..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 41d3e11e995..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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 index fc4e8b7c9db..e57d54bde3b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json index fc4e8b7c9db..e57d54bde3b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json index a20ecf2d6c9..76e138ca511 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json index a20ecf2d6c9..76e138ca511 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 52f1b822100..10c38a74411 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index d3e851981ec..29e01bc0bc6 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index cfa0ec5cb81..66a2c90e80f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index 67e50350919..557f15f4e2a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: 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: ref/m1.ts +sources: ref/m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index 73309eabe30..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6c5413f630e..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 270604ea7cb..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index a57b57d2b17..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..4409af8d0a7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index cfa0ec5cb81..66a2c90e80f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index c5bce1a19d5..3a403373a8f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ref/m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 8f31dc2aaa2..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 35e7e9a48dd..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 9bb4ed0180a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d0638b6c34c..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json index ddfa8259401..ae04c034c8c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json index ddfa8259401..ae04c034c8c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json index 6e6c3e73c03..5bac47f1b0b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json index 6e6c3e73c03..5bac47f1b0b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json index f6aa3055f76..b0159f72fc0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index f6aa3055f76..b0159f72fc0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json index c85db0226a2..601a381b6bc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json index c85db0226a2..601a381b6bc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json index ceda4546fce..72d412d2e5c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json index ceda4546fce..72d412d2e5c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json index 2bdff3a64be..ad03221057b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 2bdff3a64be..ad03221057b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json index 2c66c2dc3a3..8ad3500d926 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json index 2c66c2dc3a3..8ad3500d926 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json index 4d7e0f659ef..82d34274776 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json index 4d7e0f659ef..82d34274776 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json index f68a658cc8b..323adcd17b9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index f68a658cc8b..323adcd17b9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json index 5f6d0ccd74b..f3fb4f89412 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json index 5f6d0ccd74b..f3fb4f89412 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json index 9dca1ba6d4b..8d6923824eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json index 9dca1ba6d4b..8d6923824eb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json index d3d7588f1ca..0bdb289d92d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index d3d7588f1ca..0bdb289d92d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "mapRoot": "http://www.typescriptlang.org/", - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.d.ts b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.js b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/noProjectOptionAndInputFiles.json b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/noProjectOptionAndInputFiles.json new file mode 100644 index 00000000000..32b8c5a28f7 --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/amd/noProjectOptionAndInputFiles.json @@ -0,0 +1,14 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption/Test", + "baselineCheck": true, + "declaration": true, + "resolvedInputFiles": [ + "lib.d.ts", + "a.ts" + ], + "emittedFiles": [ + "a.js", + "a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.d.ts b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.js b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/noProjectOptionAndInputFiles.json b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/noProjectOptionAndInputFiles.json new file mode 100644 index 00000000000..32b8c5a28f7 --- /dev/null +++ b/tests/baselines/reference/project/noProjectOptionAndInputFiles/node/noProjectOptionAndInputFiles.json @@ -0,0 +1,14 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption/Test", + "baselineCheck": true, + "declaration": true, + "resolvedInputFiles": [ + "lib.d.ts", + "a.ts" + ], + "emittedFiles": [ + "a.js", + "a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js index ad3b4896eec..40bdaa24fc9 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json index 975fcf59ca9..1b96d09cd3a 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json @@ -14,8 +14,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 2c61fd1d935..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,14 +0,0 @@ -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 index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json index 975fcf59ca9..1b96d09cd3a 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json @@ -14,8 +14,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index b7c7f5d8139..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,12 +0,0 @@ -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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index ad3b4896eec..40bdaa24fc9 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json index 2b0a20e739a..f2ea5b95015 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -15,8 +15,6 @@ "test.ts" ], "emittedFiles": [ - "outdir/outAndOutDirFolder/ref/m2.js", - "outdir/outAndOutDirFolder/ref/m2.d.ts", "bin/outAndOutDirFile.js", "bin/outAndOutDirFile.d.ts" ] 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 2c61fd1d935..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,14 +0,0 @@ -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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json index 2b0a20e739a..f2ea5b95015 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -15,8 +15,6 @@ "test.ts" ], "emittedFiles": [ - "outdir/outAndOutDirFolder/ref/m2.js", - "outdir/outAndOutDirFolder/ref/m2.d.ts", "bin/outAndOutDirFile.js", "bin/outAndOutDirFile.d.ts" ] 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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index b7c7f5d8139..00000000000 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,12 +0,0 @@ -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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js index e69de29bb2d..0814424ca39 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,44 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/amd/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile0.js deleted file mode 100644 index 2c61fd1d935..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile0.js +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json index 66eced5cc01..ef27e5d6f40 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" ] diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index c2a6326846e..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index f83ccabfd35..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js deleted file mode 100644 index b7c7f5d8139..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json index 66eced5cc01..ef27e5d6f40 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" ] diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 37f4ec486b2..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index d1c1b22a85b..00000000000 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js index e69de29bb2d..d07eebbd726 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,29 @@ +define("m1", ["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; +}); +define("test", ["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/amd/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index c2a6326846e..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,14 +0,0 @@ -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 index 166aaa982e7..11bd042a34c 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.json @@ -13,10 +13,6 @@ "test.ts" ], "emittedFiles": [ - "m1.js", - "m1.d.ts", - "test.js", - "test.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index b6c62f75f3c..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 37f4ec486b2..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,12 +0,0 @@ -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.errors.txt b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json index 166aaa982e7..11bd042a34c 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json @@ -13,10 +13,6 @@ "test.ts" ], "emittedFiles": [ - "m1.js", - "m1.d.ts", - "test.js", - "test.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index d016c5ff00a..00000000000 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,14 +0,0 @@ -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/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js index e69de29bb2d..a1bb15d7b35 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,29 @@ +define("ref/m1", ["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; +}); +define("test", ["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/amd/outModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json index f11b95edde9..d37850e3f0b 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json @@ -13,10 +13,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m1.js", - "ref/m1.d.ts", - "test.js", - "test.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index c2a6326846e..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index ef183a5773c..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json index f11b95edde9..d37850e3f0b 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json @@ -13,10 +13,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m1.js", - "ref/m1.d.ts", - "test.js", - "test.d.ts", "bin/test.js", "bin/test.d.ts" ] diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 37f4ec486b2..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 548a35e714c..00000000000 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,14 +0,0 @@ -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/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/projectOptionTest/amd/Test/a.d.ts b/tests/baselines/reference/project/projectOptionTest/amd/Test/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/amd/Test/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/projectOptionTest/amd/Test/a.js b/tests/baselines/reference/project/projectOptionTest/amd/Test/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/amd/Test/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/projectOptionTest/amd/projectOptionTest.json b/tests/baselines/reference/project/projectOptionTest/amd/projectOptionTest.json new file mode 100644 index 00000000000..e2be92cb38a --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/amd/projectOptionTest.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption", + "baselineCheck": true, + "declaration": true, + "project": "Test", + "resolvedInputFiles": [ + "lib.d.ts", + "Test/a.ts" + ], + "emittedFiles": [ + "Test/a.js", + "Test/a.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/projectOptionTest/node/Test/a.d.ts b/tests/baselines/reference/project/projectOptionTest/node/Test/a.d.ts new file mode 100644 index 00000000000..4c0b8989316 --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/node/Test/a.d.ts @@ -0,0 +1 @@ +declare var test: number; diff --git a/tests/baselines/reference/project/projectOptionTest/node/Test/a.js b/tests/baselines/reference/project/projectOptionTest/node/Test/a.js new file mode 100644 index 00000000000..e757934f20c --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/node/Test/a.js @@ -0,0 +1 @@ +var test = 10; diff --git a/tests/baselines/reference/project/projectOptionTest/node/projectOptionTest.json b/tests/baselines/reference/project/projectOptionTest/node/projectOptionTest.json new file mode 100644 index 00000000000..e2be92cb38a --- /dev/null +++ b/tests/baselines/reference/project/projectOptionTest/node/projectOptionTest.json @@ -0,0 +1,15 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption", + "baselineCheck": true, + "declaration": true, + "project": "Test", + "resolvedInputFiles": [ + "lib.d.ts", + "Test/a.ts" + ], + "emittedFiles": [ + "Test/a.js", + "Test/a.d.ts" + ] +} \ 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 index fb0ca5dfac0..42313b7ce64 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,11 +1,11 @@ -var _this = this; -// Add a lambda to ensure global 'this' capture is triggered -(function () { return _this.window; }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; +var _this = this; +// Add a lambda to ensure global 'this' capture is triggered +(function () { return _this.window; }); // class inheritance to ensure __extends is emitted var m; (function (m) { diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index fb0ca5dfac0..42313b7ce64 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,11 +1,11 @@ -var _this = this; -// Add a lambda to ensure global 'this' capture is triggered -(function () { return _this.window; }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; +var _this = this; +// Add a lambda to ensure global 'this' capture is triggered +(function () { return _this.window; }); // class inheritance to ensure __extends is emitted var m; (function (m) { diff --git a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt new file mode 100644 index 00000000000..8ce21315a95 --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== globalThisCapture.ts (0 errors) ==== + // Add a lambda to ensure global 'this' capture is triggered + (()=>this.window); + +==== __extends.ts (0 errors) ==== + // class inheritance to ensure __extends is emitted + module m { + export class base {} + export class child extends base {} + } \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json index 16831b328e9..bb8d7b36859 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json @@ -5,6 +5,7 @@ "foo.ts", "../../../bar/bar.ts" ], + "noResolve": true, "declaration": true, "baselineCheck": true, "resolvedInputFiles": [ diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json index 16831b328e9..bb8d7b36859 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json @@ -5,6 +5,7 @@ "foo.ts", "../../../bar/bar.ts" ], + "noResolve": true, "declaration": true, "baselineCheck": true, "resolvedInputFiles": [ diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json index b22aefac3ef..482cfcd40b4 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json @@ -5,6 +5,7 @@ "test.ts", "../ReferenceResolution/test.ts" ], + "noResolve": true, "declaration": true, "baselineCheck": true, "resolvedInputFiles": [ diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json index b22aefac3ef..482cfcd40b4 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json @@ -5,6 +5,7 @@ "test.ts", "../ReferenceResolution/test.ts" ], + "noResolve": true, "declaration": true, "baselineCheck": true, "resolvedInputFiles": [ diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json index 2ec18b3ac5a..bb79b1a7911 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json +++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json @@ -5,10 +5,10 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA", "sourceMap": true, "declaration": true, "baselineCheck": true, - "rootDir": "FolderA", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json index 2ec18b3ac5a..bb79b1a7911 100644 --- a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json +++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json @@ -5,10 +5,10 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA", "sourceMap": true, "declaration": true, "baselineCheck": true, - "rootDir": "FolderA", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json index fdde42592ca..42f348a4b56 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json @@ -5,9 +5,9 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA/FolderB/FolderC", "declaration": true, "baselineCheck": true, - "rootDir": "FolderA/FolderB/FolderC", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json index fdde42592ca..42f348a4b56 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json @@ -5,9 +5,9 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA/FolderB/FolderC", "declaration": true, "baselineCheck": true, - "rootDir": "FolderA/FolderB/FolderC", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json index deb12150736..57e51ed359a 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json @@ -5,10 +5,10 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA", "sourceMap": true, "sourceRoot": "SourceRootPath", "baselineCheck": true, - "rootDir": "FolderA", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json index deb12150736..57e51ed359a 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json @@ -5,10 +5,10 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "rootDir": "FolderA", "sourceMap": true, "sourceRoot": "SourceRootPath", "baselineCheck": true, - "rootDir": "FolderA", "resolvedInputFiles": [ "lib.d.ts", "FolderA/FolderB/FolderC/fileC.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json index 43059eaa5c6..734abfe9f95 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json index 43059eaa5c6..734abfe9f95 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json index 6d9cf2998a8..560eef6c490 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json index 6d9cf2998a8..560eef6c490 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 5af28cf8560..13e9de8f87f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 65bbb0e67c2..3aa34b0f833 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 381b239c573..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 09c6092f164..b128c28b5b1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index bbad2c102f9..7ede7f02c36 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 65bbb0e67c2..cf4a14ae9e9 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 2963737a5a0..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 09c6092f164..b128c28b5b1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index c409dc99f14..7330eac1399 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 1750a5975ae..81bb710c580 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 820efe6d9d1..454bdf3acb0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 381b239c573..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 6fb17fa06b8..32ec789f729 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 8536097d111..b686585c977 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 820efe6d9d1..f7d00d1aff9 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 2963737a5a0..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 6fb17fa06b8..32ec789f729 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,10 +7,10 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -18,9 +18,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 47e9f1da73a..71a33c01806 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) name (f1) --- >>>//# sourceMappingURL=outAndOutDirFile.js.map \ 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 index 9e98d46666f..2475d02eb47 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json index 9e98d46666f..2475d02eb47 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json index d96a3e5f832..8a746a518a3 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json index d96a3e5f832..8a746a518a3 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..994e21ca032 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index e53f2e0a755..0fd0b2def0c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index c4c57a82e12..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 71e1da5d3cc..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ 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 index b3e80123c04..279857bce8b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index e1bca270ba0..8c710d9c4da 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder_ref/m2.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>}); +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- ->>>}); ->>>//# 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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 5cca04a0f25..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index aeb0a1c3c5d..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index e53f2e0a755..027f9569ebc 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index 7e08245de72..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index de341c87ec1..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ 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 index b3e80123c04..279857bce8b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,15 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index 63e22ab64ba..e129af6a045 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 14c09e444a5..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 0b67e7ee481..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/sourceRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json index 6e1f133ef64..09cb6b546b3 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json index 6e1f133ef64..09cb6b546b3 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json index c15e91877ae..d3ba076ef6f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json index c15e91877ae..d3ba076ef6f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..f385e49ecd1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 42e5a82e74b..a910369c3e4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 89373fc1cfa..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index e2621b2fa52..eed9ed1ea34 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 0fc6cd6eb2a..827aa235ef2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts +sources: m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 372f1052b89..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 945ed0583ad..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map index 42e5a82e74b..487d57bd2ae 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 9bf6e024b3f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index e2621b2fa52..eed9ed1ea34 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 08491d50151..0a161bb4886 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index c2e7dfa443b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index a7792ef5242..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index b65bed61979..cdd0d1b3328 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json index b65bed61979..cdd0d1b3328 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json index a8662e09bf6..2e482f41e66 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json index a8662e09bf6..2e482f41e66 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..18d212c7e69 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 279042a1a0f..30bac946d14 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6f750f89857..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index a43e0f69172..048d4296ae5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 5e87f2ef555..af6c2b21fdc 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts +sources: ref/m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 6c8aeb3190b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index f65cfa554d1..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index 279042a1a0f..622f2c91c95 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 19b046a427c..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index a43e0f69172..048d4296ae5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -6,22 +6,16 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 67fc9030f41..5d837611e49 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ref/m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 46c9f29e55a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c63a0943976..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index b84ccc2bc23..c955083f7f1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json index b84ccc2bc23..c955083f7f1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json index 43d3db291ff..3fa14686a7c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json index 43d3db291ff..3fa14686a7c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json index 6bd6db427c4..ed994f82308 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 6bd6db427c4..ed994f82308 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json index f57c8110827..5ee7318ed14 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json index f57c8110827..5ee7318ed14 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json index 02981610092..a7a05e10248 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json index 02981610092..a7a05e10248 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json index 74add9e8d7b..3a215e043c6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 74add9e8d7b..3a215e043c6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_simple/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json index 772190b4851..369da8c6254 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json index 772190b4851..369da8c6254 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json index 8a6eb54b789..6534ef27847 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json index 8a6eb54b789..6534ef27847 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json index ec9d13d68de..71b375b8650 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ec9d13d68de..71b375b8650 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json index 03f06090742..3ec5d65f7a0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json index 03f06090742..3ec5d65f7a0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json @@ -5,10 +5,10 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json index 08bdabb1c6e..faa7592db45 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json index 08bdabb1c6e..faa7592db45 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -6,10 +6,10 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json index a6c034775ce..73333fd4868 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index a6c034775ce..73333fd4868 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -6,10 +6,10 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", - "resolveSourceRoot": true, "declaration": true, "baselineCheck": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json index 0e73f218462..326bb4aaff6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json index 0e73f218462..326bb4aaff6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json index 99815d52661..e47173aac84 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json index 99815d52661..e47173aac84 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 5af28cf8560..13e9de8f87f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 86afcf32e25..62f932a571e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 0927206ec1b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 82ef1c7d882..f42b01758d3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 94b86ffdde1..d722bc8936a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 86afcf32e25..03976e6a8d6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 84f18c56247..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 82ef1c7d882..f42b01758d3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 12a6fdbc6dd..b71c21b5b99 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 1750a5975ae..81bb710c580 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 13b958b1025..a9529891ffd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 0927206ec1b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d5f4fd9c654..7f0be1c2b21 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 11e34ee5a2e..d1799c07a98 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 13b958b1025..23957761470 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 84f18c56247..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index d5f4fd9c654..7f0be1c2b21 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 5b9ec51c270..2a0cc630cc0 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) name (f1) --- >>>//# sourceMappingURL=outAndOutDirFile.js.map \ 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 index 2acbea1cc8d..79c4217ab51 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json index 2acbea1cc8d..79c4217ab51 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json index 6603e36c281..bb4c3668735 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json index 6603e36c281..bb4c3668735 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..994e21ca032 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 512eba0e11a..39dcc66e06b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index 414fa845b2e..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 0cdc44d330d..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ 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 index 69a577baffd..328a26d1086 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index 9c817da60e9..43c4340ba37 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder_ref/m2.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>}); +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== ------------------------------------------------------------------- -emittedFile:test.js +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 5cca04a0f25..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 20138821cfe..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index 512eba0e11a..a3ab2ebecdb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index 92fd6e19cfb..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 292dcb61933..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ 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 index 69a577baffd..328a26d1086 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt index e34bffc6f61..7ef7adace73 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 14c09e444a5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index a603394fc15..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/sourceRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json index f28c784480f..910f5cd7e8f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json index f28c784480f..910f5cd7e8f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json index 77fa77f5fb0..29a92a51eec 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json index 77fa77f5fb0..29a92a51eec 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..f385e49ecd1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 512eba0e11a..262e5cdc1f3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index e0af3af9b22..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index a4a6698d3ca..d16c4a53d9c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt index c259bb45210..fc0f367f343 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: ../src/ -sources: m1.ts +sources: m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 372f1052b89..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 22f07c17544..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map index 512eba0e11a..f55a72e7977 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 05c53f0182e..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index a4a6698d3ca..d16c4a53d9c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt index 65bea50d84f..2910ad61478 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index c2e7dfa443b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 1e72e2a2203..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index 8a3035f3632..6ffc10b0448 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json index 8a3035f3632..6ffc10b0448 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json index 9f10fc5e7e0..28b99749a6e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json index 9f10fc5e7e0..28b99749a6e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..18d212c7e69 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 512eba0e11a..dc294ebd160 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index aaae11bb5b5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 71896f202b2..f1ef0403d6e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 7be1fe1fb8f..83f9ef1f262 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: ../src/ -sources: ref/m1.ts +sources: ref/m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 6c8aeb3190b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 22f07c17544..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index 512eba0e11a..f803a29f3bf 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 702b574b614..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 71896f202b2..f1ef0403d6e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt index 5a3d45c1960..b05ffee34ca 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ref/m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 46c9f29e55a..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index b3972a3cfc1..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index e7dfb0beff3..b785e8311f3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json index e7dfb0beff3..b785e8311f3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json index bfb74003401..83a4cf9e563 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json index bfb74003401..83a4cf9e563 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json index 1f2e577b0b3..f9f31a969c4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 1f2e577b0b3..f9f31a969c4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json index 4d33e85e2ba..a4fc65ac644 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json index 4d33e85e2ba..a4fc65ac644 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json index bf86309b59a..23096eb3267 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json index bf86309b59a..23096eb3267 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json index 4b371bf5924..e60785d9b57 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 4b371bf5924..e60785d9b57 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json index 06a55d4a7cc..c7799ba328c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json index 06a55d4a7cc..c7799ba328c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json index d87b6b22829..c9eabb14024 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json index d87b6b22829..c9eabb14024 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json index c80db3f739c..39e0e9577bb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index c80db3f739c..39e0e9577bb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json index ff189067e67..28fbd41bab9 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json index ff189067e67..28fbd41bab9 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json index 8896f911a99..d6c94f99165 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json index 8896f911a99..d6c94f99165 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json index ddcfbd2ff9c..bc02869d35b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ddcfbd2ff9c..bc02869d35b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "../src", "declaration": true, "baselineCheck": true, + "sourceRoot": "../src", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 5af28cf8560..13e9de8f87f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index a1d591a0497..94371fe696d 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index cbb7eed4953..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 3270fe610aa..39cb44f229f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.json @@ -15,9 +15,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt index b1d3f293b7e..821236c5c85 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:../ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:../ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:../test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index a1d591a0497..a580c050d07 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0826e9e95f3..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 3270fe610aa..39cb44f229f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.json @@ -15,9 +15,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt index 676e8f264ec..e37948398a3 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:../test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 1750a5975ae..81bb710c580 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 4f87045fd25..22aaecafe2d 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index aabf49f904d..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 3a260af84a0..117a18c7c7a 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -16,9 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a73c3b0852a..4394eb0748e 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:../ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:../ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:../test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 4f87045fd25..2eab0f87324 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index e31d90a8f0c..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 3a260af84a0..117a18c7c7a 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -16,9 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 77ff10492be..9486ad5e3a7 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ../ref/m1.ts,../ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:../test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:../test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:../test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:../test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:../test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:../test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:../test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:../test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) name (f1) --- >>>//# sourceMappingURL=outAndOutDirFile.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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..994e21ca032 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..c532c3846d9 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index cbb7eed4953..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 51755e4c9a3..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ 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 index 3d2df95ad66..7ba960c4bef 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.json @@ -15,15 +15,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt index 74ecef44103..6c8bdf4da74 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: -sources: m1.ts +sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts +emittedFile:bin/test.js +sourceFile:../ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 5cca04a0f25..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 462fa38ab42..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..2974abdc1cc 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"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 deleted file mode 100644 index 0826e9e95f3..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 095951a67d0..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ 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 index 3d2df95ad66..7ba960c4bef 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.json @@ -15,15 +15,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt index f8d10678ca0..70054e8f1c6 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 14c09e444a5..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 3b3ef6b145c..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..f385e49ecd1 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..6377a26395e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 51755e4c9a3..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9ff29662d40..c9889aff69b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt index a1646bc14e5..71c0a41b2d1 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: -sources: m1.ts +sources: ../m1.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts +emittedFile:bin/test.js +sourceFile:../m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 372f1052b89..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 9bcc170386c..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..f491a9ec373 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 095951a67d0..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 9ff29662d40..c9889aff69b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt index 4ff8b4fa8c7..056b7a1c7f2 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../m1.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index c2e7dfa443b..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 7bae4ed7491..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..18d212c7e69 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index c1e0281a2ab..f77c1351b15 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 51755e4c9a3..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 9d200ef685d..da85c1bf06c 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt index d0abf20190f..9c12e1749ca 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: -sources: m1.ts +sources: ../ref/m1.ts,../test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts +emittedFile:bin/test.js +sourceFile:../ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) --- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- >>>}); ->>>//# 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) { +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 6c8aeb3190b..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 9bcc170386c..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index c1e0281a2ab..bfdacf69428 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 095951a67d0..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 9d200ef685d..da85c1bf06c 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.json @@ -14,12 +14,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt index 205f70497ad..282a64dbc6f 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ../ref/m1.ts,../test.ts =================================================================== >>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 46c9f29e55a..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 56d42d8bdfd..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index ef5cb2df633..e949da7fdbf 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json index ef5cb2df633..e949da7fdbf 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json index a46fe845710..892bc6673b9 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json index a46fe845710..892bc6673b9 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 5af28cf8560..13e9de8f87f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 7a70d18105c..37bb9be8a95 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 04f168a6289..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 50a4518a1b0..80d11298c83 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index d4cac643490..51a641cb750 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/test.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 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/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts index d61b4c3b876..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 7a70d18105c..a6626039aa2 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0ce68e169af..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 50a4518a1b0..80d11298c83 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,9 +16,6 @@ "test.ts" ], "emittedFiles": [ - "ref/m2.js.map", - "ref/m2.js", - "ref/m2.d.ts", "bin/test.js.map", "bin/test.js", "bin/test.d.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index cb96dcbf7d7..38aecc15857 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/test.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 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/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 1750a5975ae..81bb710c580 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -8,6 +8,20 @@ var m1_instance1 = new m1_c1(); function m1_f1() { return m1_instance1; } +define("ref/m2", ["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; +}); /// /// var a1 = 10; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 53e31e30260..f3058d9f878 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 04f168a6289..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index b6ef6b5bd51..ba23bdd104c 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index d54fa316273..df760dc79b0 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,180 +1,8 @@ =================================================================== -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 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >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 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -306,7 +134,7 @@ sourceFile:ref/m1.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -315,16 +143,182 @@ sourceFile:ref/m1.ts --- ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define("ref/m2", ["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(12, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(12, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(12, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(12, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(12, 24) Source(1, 23) + SourceIndex(1) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^-> +1-> +1->Emitted(14, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1->export class m2_c1 { + > public m2_c1_p1: number; + > +2 > } +1->Emitted(15, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(15, 10) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(17, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(17, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(17, 10) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > { + > public m2_c1_p1: number; + > } +4 > +1->Emitted(18, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(18, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(18, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(18, 27) Source(4, 2) + SourceIndex(1) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(19, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(19, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(19, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(19, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(19, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(19, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(19, 40) Source(6, 39) + SourceIndex(1) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(20, 5) Source(7, 1) + SourceIndex(1) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->export function m2_f1() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(21, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(21, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(21, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(21, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(21, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(22, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +1-> +2 > m2_f1 +3 > () { + > return m2_instance1; + > } +4 > +1->Emitted(23, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(23, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(23, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(23, 27) Source(9, 2) + SourceIndex(1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js sourceFile:test.ts ------------------------------------------------------------------- +>>>}); >>>/// -1-> +1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^-> -1-> +1 > 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1 >Emitted(25, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(25, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -332,8 +326,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(26, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(26, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -350,25 +344,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(27, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(27, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(27, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(27, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(27, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(28, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(29, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -378,16 +372,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(30, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(30, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(31, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -401,10 +395,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(32, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(32, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(32, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(32, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -425,21 +419,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(33, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(33, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(33, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(33, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(33, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(33, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(33, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(33, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(34, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -453,11 +447,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(35, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(35, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(35, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(35, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(35, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -466,7 +460,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(36, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(36, 2) Source(11, 2) + SourceIndex(2) 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 index 9b9cdd4a214..c3a64f5b6eb 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -1,10 +1,17 @@ -/// declare var m1_a1: number; declare class m1_c1 { m1_c1_p1: number; } declare var m1_instance1: m1_c1; declare function m1_f1(): m1_c1; +declare module "ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} declare var a1: number; declare class c1 { p1: number; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 53e31e30260..ba9f4ee590c 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AERD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; 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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0ce68e169af..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt new file mode 100644 index 00000000000..2c420704766 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ref/m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index b6ef6b5bd51..ba23bdd104c 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -7,9 +7,9 @@ "out": "bin/outAndOutDirFile.js", "outDir": "outdir/outAndOutDirFolder", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -17,9 +17,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 8bd8c2ac035..c8507ca7df8 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -1,179 +1,8 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 +sources: ref/m1.ts,ref/m2.ts,test.ts =================================================================== ------------------------------------------------------------------- emittedFile:bin/outAndOutDirFile.js @@ -322,8 +151,8 @@ sourceFile:test.ts 3 > ^-> 1-> 2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -331,8 +160,8 @@ sourceFile:test.ts 1-> > 2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) --- >>>var a1 = 10; 1 > @@ -349,25 +178,25 @@ sourceFile:test.ts 4 > = 5 > 10 6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) +1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(1) +1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (c1) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^ @@ -377,16 +206,16 @@ sourceFile:test.ts > public p1: number; > 2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) --- >>> return c1; 1->^^^^ 2 > ^^^^^^^^^ 1-> 2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(1) name (c1) +1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) name (c1) --- >>>})(); 1 > @@ -400,10 +229,10 @@ sourceFile:test.ts 4 > class c1 { > public p1: number; > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(1) name (c1) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(1) name (c1) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(1) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(1) +1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) --- >>>var instance1 = new c1(); 1-> @@ -424,21 +253,21 @@ sourceFile:test.ts 6 > c1 7 > () 8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(1) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(1) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(1) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(1) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(1) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(1) +1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) --- >>>function f1() { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) --- >>> return instance1; 1->^^^^ @@ -452,11 +281,11 @@ sourceFile:test.ts 3 > 4 > instance1 5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(1) name (f1) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(1) name (f1) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(1) name (f1) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(1) name (f1) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(1) name (f1) +1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) name (f1) --- >>>} 1 > @@ -465,7 +294,7 @@ sourceFile:test.ts 1 > > 2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(1) name (f1) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(1) name (f1) +1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) name (f1) --- >>>//# sourceMappingURL=outAndOutDirFile.js.map \ 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 index c2594c0093c..f33a095e60e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json index c2594c0093c..f33a095e60e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json index d2c6956bf80..1a429c986d8 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json index d2c6956bf80..1a429c986d8 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..994e21ca032 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,45 @@ +define("ref/m1", ["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; +}); +define("../outputdir_module_multifolder_ref/m2", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index d3e851981ec..85e465474d3 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICRU,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAC;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICNU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map deleted file mode 100644 index 3b00d82ab66..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 deleted file mode 100644 index 144ad24e2de..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 8c257bd1111..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 00000000000..d827a2492f8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(9,16): error TS2436: Ambient module declaration cannot specify relative module name. +bin/test.d.ts(19,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +bin/test.d.ts(19,25): error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + + +==== bin/test.d.ts (3 errors) ==== + declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "../outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module '../outputdir_module_multifolder_ref/m2'. + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ 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 index cc2a6c9b1aa..4b7656e044e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index 86764c6d57a..d2331ef3579 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:outputdir_module_multifolder/ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder_ref/m2.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>}); +>>>define("../outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { >>> exports.m2_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -193,24 +187,24 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(16, 5) Source(1, 12) + SourceIndex(1) +2 >Emitted(16, 18) Source(1, 17) + SourceIndex(1) +3 >Emitted(16, 21) Source(1, 20) + SourceIndex(1) +4 >Emitted(16, 23) Source(1, 22) + SourceIndex(1) +5 >Emitted(16, 24) Source(1, 23) + SourceIndex(1) --- >>> var m2_c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(2, 1) + SourceIndex(1) --- >>> function m2_c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +1->Emitted(18, 9) Source(2, 1) + SourceIndex(1) name (m2_c1) --- >>> } 1->^^^^^^^^ @@ -220,16 +214,16 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > 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) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(19, 10) Source(4, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(20, 21) Source(4, 2) + SourceIndex(1) name (m2_c1) --- >>> })(); 1 >^^^^ @@ -243,10 +237,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(21, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(21, 6) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(21, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_c1 = m2_c1; 1->^^^^ @@ -260,10 +254,10 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > public m2_c1_p1: number; > } 4 > -1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(22, 18) Source(2, 19) + SourceIndex(1) +3 >Emitted(22, 26) Source(4, 2) + SourceIndex(1) +4 >Emitted(22, 27) Source(4, 2) + SourceIndex(1) --- >>> exports.m2_instance1 = new m2_c1(); 1->^^^^ @@ -282,20 +276,20 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1->Emitted(23, 5) Source(6, 12) + SourceIndex(1) +2 >Emitted(23, 25) Source(6, 24) + SourceIndex(1) +3 >Emitted(23, 28) Source(6, 27) + SourceIndex(1) +4 >Emitted(23, 32) Source(6, 31) + SourceIndex(1) +5 >Emitted(23, 37) Source(6, 36) + SourceIndex(1) +6 >Emitted(23, 39) Source(6, 38) + SourceIndex(1) +7 >Emitted(23, 40) Source(6, 39) + SourceIndex(1) --- >>> function m2_f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(7, 1) + SourceIndex(1) --- >>> return exports.m2_instance1; 1->^^^^^^^^ @@ -309,11 +303,11 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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->Emitted(25, 9) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(25, 15) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(25, 16) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(25, 36) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(25, 37) Source(8, 25) + SourceIndex(1) name (m2_f1) --- >>> } 1 >^^^^ @@ -322,8 +316,8 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts 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) +1 >Emitted(26, 5) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(26, 6) Source(9, 2) + SourceIndex(1) name (m2_f1) --- >>> exports.m2_f1 = m2_f1; 1->^^^^ @@ -336,23 +330,17 @@ sourceFile:outputdir_module_multifolder_ref/m2.ts > return m2_instance1; > } 4 > -1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(7, 17) + SourceIndex(1) +2 >Emitted(27, 18) Source(7, 22) + SourceIndex(1) +3 >Emitted(27, 26) Source(9, 2) + SourceIndex(1) +4 >Emitted(27, 27) Source(9, 2) + SourceIndex(1) --- ->>>}); ->>>//# 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 +emittedFile:bin/test.js sourceFile:outputdir_module_multifolder/test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -367,24 +355,24 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(30, 5) Source(3, 12) + SourceIndex(2) +2 >Emitted(30, 15) Source(3, 14) + SourceIndex(2) +3 >Emitted(30, 18) Source(3, 17) + SourceIndex(2) +4 >Emitted(30, 20) Source(3, 19) + SourceIndex(2) +5 >Emitted(30, 21) Source(3, 20) + SourceIndex(2) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +1->Emitted(31, 5) Source(4, 1) + SourceIndex(2) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +1->Emitted(32, 9) Source(4, 1) + SourceIndex(2) name (c1) --- >>> } 1->^^^^^^^^ @@ -394,16 +382,16 @@ sourceFile:outputdir_module_multifolder/test.ts > 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) +1->Emitted(33, 9) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(33, 10) Source(6, 2) + SourceIndex(2) 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->Emitted(34, 9) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(34, 18) Source(6, 2) + SourceIndex(2) name (c1) --- >>> })(); 1 >^^^^ @@ -417,10 +405,10 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1 >Emitted(35, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(35, 6) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(35, 6) Source(4, 1) + SourceIndex(2) +4 >Emitted(35, 10) Source(6, 2) + SourceIndex(2) --- >>> exports.c1 = c1; 1->^^^^ @@ -434,10 +422,10 @@ sourceFile:outputdir_module_multifolder/test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(4, 14) + SourceIndex(2) +2 >Emitted(36, 15) Source(4, 16) + SourceIndex(2) +3 >Emitted(36, 20) Source(6, 2) + SourceIndex(2) +4 >Emitted(36, 21) Source(6, 2) + SourceIndex(2) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -456,20 +444,20 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(37, 5) Source(8, 12) + SourceIndex(2) +2 >Emitted(37, 22) Source(8, 21) + SourceIndex(2) +3 >Emitted(37, 25) Source(8, 24) + SourceIndex(2) +4 >Emitted(37, 29) Source(8, 28) + SourceIndex(2) +5 >Emitted(37, 31) Source(8, 30) + SourceIndex(2) +6 >Emitted(37, 33) Source(8, 32) + SourceIndex(2) +7 >Emitted(37, 34) Source(8, 33) + SourceIndex(2) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +1 >Emitted(38, 5) Source(9, 1) + SourceIndex(2) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -483,11 +471,11 @@ sourceFile:outputdir_module_multifolder/test.ts 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->Emitted(39, 9) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(39, 15) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(39, 16) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(39, 33) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(39, 34) Source(10, 22) + SourceIndex(2) name (f1) --- >>> } 1 >^^^^ @@ -496,8 +484,8 @@ sourceFile:outputdir_module_multifolder/test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +1 >Emitted(40, 5) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(40, 6) Source(11, 2) + SourceIndex(2) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -511,10 +499,10 @@ sourceFile:outputdir_module_multifolder/test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(9, 17) + SourceIndex(2) +2 >Emitted(41, 15) Source(9, 19) + SourceIndex(2) +3 >Emitted(41, 20) Source(11, 2) + SourceIndex(2) +4 >Emitted(41, 21) Source(11, 2) + SourceIndex(2) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -534,13 +522,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(42, 5) Source(13, 12) + SourceIndex(2) +2 >Emitted(42, 15) Source(13, 14) + SourceIndex(2) +3 >Emitted(42, 18) Source(13, 17) + SourceIndex(2) +4 >Emitted(42, 20) Source(13, 19) + SourceIndex(2) +5 >Emitted(42, 21) Source(13, 20) + SourceIndex(2) +6 >Emitted(42, 26) Source(13, 25) + SourceIndex(2) +7 >Emitted(42, 27) Source(13, 26) + SourceIndex(2) --- >>> exports.a3 = m2.m2_c1; 1->^^^^ @@ -558,19 +546,13 @@ sourceFile:outputdir_module_multifolder/test.ts 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) +1->Emitted(43, 5) Source(14, 12) + SourceIndex(2) +2 >Emitted(43, 15) Source(14, 14) + SourceIndex(2) +3 >Emitted(43, 18) Source(14, 17) + SourceIndex(2) +4 >Emitted(43, 20) Source(14, 19) + SourceIndex(2) +5 >Emitted(43, 21) Source(14, 20) + SourceIndex(2) +6 >Emitted(43, 26) Source(14, 25) + SourceIndex(2) +7 >Emitted(43, 27) Source(14, 26) + SourceIndex(2) --- >>>}); ->>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 5cca04a0f25..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 8612cd0d108..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IAEW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..9b6af66589a 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,28 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "../outputdir_module_multifolder_ref/m2" { + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..f84040526ba 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"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 deleted file mode 100644 index 058e405b606..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,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 deleted file mode 100644 index ec0a73b5af8..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c09a3c0c32a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m2_a1: number; -export declare class m2_c1 { - m2_c1_p1: number; -} -export declare var m2_instance1: m2_c1; -export declare function m2_f1(): m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index e7f54a4a2e1..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..b0d02cf8120 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,39 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== m2.ts (0 errors) ==== + export var m2_a1 = 10; + export class m2_c1 { + public m2_c1_p1: number; + } + + export var m2_instance1 = new m2_c1(); + export function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + import m2 = require("../outputdir_module_multifolder_ref/m2"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; + export var a3 = m2.m2_c1; \ 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 index cc2a6c9b1aa..4b7656e044e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", @@ -16,15 +16,6 @@ "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt index eb2dff17042..95f7d3cee8f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -1,620 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) -4 >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: +sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 4afd4e69f2d..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import m1 = require("ref/m1"); -import m2 = require("../outputdir_module_multifolder_ref/m2"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; -export declare var a3: typeof m2.m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 14c09e444a5..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 4ac74c2fcdb..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,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/sourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json index 4a7cc668a6a..0c8a05da3b1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json index 4a7cc668a6a..0c8a05da3b1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json index 6766f67eab0..efb3da725dc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json index 6766f67eab0..efb3da725dc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..f385e49ecd1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index d3e851981ec..2ace469f902 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6751f2f82cd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index 5419c5a8225..49abba9156c 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index 3e447368494..e0c060eb889 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts +sources: m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:m1.js +emittedFile:bin/test.js sourceFile:m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js deleted file mode 100644 index 372f1052b89..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index a57b57d2b17..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..df062274b3e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..3b75f2878c9 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index ca45773f423..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..0dc033a09d2 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index 5419c5a8225..49abba9156c 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt index 4d3c5799e27..dfbb5f48fff 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index 250d2615a79..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js deleted file mode 100644 index c2e7dfa443b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 41d3e11e995..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index d7f99610bab..46f3e8aad7d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json index d7f99610bab..46f3e8aad7d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json index 1e722cb852e..bfd34fb2ec0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json index 1e722cb852e..bfd34fb2ec0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 6f3fefb9498..18d212c7e69 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1 +1,30 @@ +define("ref/m1", ["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; +}); +define("test", ["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/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index d3e851981ec..29e01bc0bc6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"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":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,CAAA;;;ICPU,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAC;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js deleted file mode 100644 index bbaba444ba2..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6c5413f630e..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAAAA;QAEAC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,QAEjB,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACIE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,QAEpB,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 index d80dacb3444..7db8ebc6926 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index 54c26748c78..54624487a57 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,14 +1,14 @@ =================================================================== -JsFile: m1.js -mapUrl: m1.js.map +JsFile: test.js +mapUrl: test.js.map sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts +sources: ref/m1.ts,test.ts =================================================================== ------------------------------------------------------------------- -emittedFile:ref/m1.js +emittedFile:bin/test.js sourceFile:ref/m1.ts ------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { +>>>define("ref/m1", ["require", "exports"], function (require, exports) { >>> exports.m1_a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^^^^ @@ -169,18 +169,12 @@ sourceFile:ref/m1.ts 3 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) 4 >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 +emittedFile:bin/test.js sourceFile:test.ts ------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +>>>}); +>>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { >>> exports.a1 = 10; 1 >^^^^ 2 > ^^^^^^^^^^ @@ -194,24 +188,24 @@ sourceFile:test.ts 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) +1 >Emitted(16, 5) Source(2, 12) + SourceIndex(1) +2 >Emitted(16, 15) Source(2, 14) + SourceIndex(1) +3 >Emitted(16, 18) Source(2, 17) + SourceIndex(1) +4 >Emitted(16, 20) Source(2, 19) + SourceIndex(1) +5 >Emitted(16, 21) Source(2, 20) + SourceIndex(1) --- >>> var c1 = (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +1->Emitted(17, 5) Source(3, 1) + SourceIndex(1) --- >>> function c1() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +1->Emitted(18, 9) Source(3, 1) + SourceIndex(1) name (c1) --- >>> } 1->^^^^^^^^ @@ -221,16 +215,16 @@ sourceFile:test.ts > 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) +1->Emitted(19, 9) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) 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->Emitted(20, 9) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(20, 18) Source(5, 2) + SourceIndex(1) name (c1) --- >>> })(); 1 >^^^^ @@ -244,10 +238,10 @@ sourceFile:test.ts 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) +1 >Emitted(21, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(21, 6) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(21, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.c1 = c1; 1->^^^^ @@ -261,10 +255,10 @@ sourceFile:test.ts > public p1: number; > } 4 > -1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +1->Emitted(22, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(22, 15) Source(3, 16) + SourceIndex(1) +3 >Emitted(22, 20) Source(5, 2) + SourceIndex(1) +4 >Emitted(22, 21) Source(5, 2) + SourceIndex(1) --- >>> exports.instance1 = new c1(); 1->^^^^ @@ -283,20 +277,20 @@ sourceFile:test.ts 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) +1->Emitted(23, 5) Source(7, 12) + SourceIndex(1) +2 >Emitted(23, 22) Source(7, 21) + SourceIndex(1) +3 >Emitted(23, 25) Source(7, 24) + SourceIndex(1) +4 >Emitted(23, 29) Source(7, 28) + SourceIndex(1) +5 >Emitted(23, 31) Source(7, 30) + SourceIndex(1) +6 >Emitted(23, 33) Source(7, 32) + SourceIndex(1) +7 >Emitted(23, 34) Source(7, 33) + SourceIndex(1) --- >>> function f1() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +1 >Emitted(24, 5) Source(8, 1) + SourceIndex(1) --- >>> return exports.instance1; 1->^^^^^^^^ @@ -310,11 +304,11 @@ sourceFile:test.ts 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->Emitted(25, 9) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(25, 15) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(25, 16) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(25, 33) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(25, 34) Source(9, 22) + SourceIndex(1) name (f1) --- >>> } 1 >^^^^ @@ -323,8 +317,8 @@ sourceFile:test.ts 1 > > 2 > } -1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) -2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +1 >Emitted(26, 5) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(26, 6) Source(10, 2) + SourceIndex(1) name (f1) --- >>> exports.f1 = f1; 1->^^^^ @@ -338,10 +332,10 @@ sourceFile:test.ts > return instance1; > } 4 > -1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +1->Emitted(27, 5) Source(8, 17) + SourceIndex(1) +2 >Emitted(27, 15) Source(8, 19) + SourceIndex(1) +3 >Emitted(27, 20) Source(10, 2) + SourceIndex(1) +4 >Emitted(27, 21) Source(10, 2) + SourceIndex(1) --- >>> exports.a2 = m1.m1_c1; 1->^^^^ @@ -360,19 +354,13 @@ sourceFile:test.ts 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) +1->Emitted(28, 5) Source(12, 12) + SourceIndex(1) +2 >Emitted(28, 15) Source(12, 14) + SourceIndex(1) +3 >Emitted(28, 18) Source(12, 17) + SourceIndex(1) +4 >Emitted(28, 20) Source(12, 19) + SourceIndex(1) +5 >Emitted(28, 21) Source(12, 20) + SourceIndex(1) +6 >Emitted(28, 26) Source(12, 25) + SourceIndex(1) +7 >Emitted(28, 27) Source(12, 26) + SourceIndex(1) --- >>>}); ->>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js deleted file mode 100644 index 6c8aeb3190b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index a57b57d2b17..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":";IACW,UAAE,GAAG,EAAE,CAAC;IACnB;QAAAA;QAEAC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,KAEd,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACIE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,KAEjB,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 index e69de29bb2d..18eee0fd4df 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1,18 @@ +declare module "ref/m1" { + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; +} +declare module "test" { + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; +} diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map index d3e851981ec..4409af8d0a7 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"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 deleted file mode 100644 index 4a53b24b156..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare var m1_a1: number; -export declare class m1_c1 { - m1_c1_p1: number; -} -export declare var m1_instance1: m1_c1; -export declare function m1_f1(): m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js deleted file mode 100644 index 1b4470e2b37..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 35e7e9a48dd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,QAEjB,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACIE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,QAEpB,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..7eb84ece29d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,27 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + export var m1_a1 = 10; + export class m1_c1 { + public m1_c1_p1: number; + } + + export var m1_instance1 = new m1_c1(); + export function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + import m1 = require("ref/m1"); + export var a1 = 10; + export class c1 { + public p1: number; + } + + export var instance1 = new c1(); + export function f1() { + return instance1; + } + + export var a2 = m1.m1_c1; \ 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 index d80dacb3444..7db8ebc6926 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -6,21 +6,15 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", "test.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" diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt index cf41966a818..2903ad0141c 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -1,399 +1,7 @@ =================================================================== -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 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 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 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > 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 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) -4 >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 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(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 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) -4 >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: +sources: ref/m1.ts,test.ts =================================================================== >>>//# 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 deleted file mode 100644 index a61d8541048..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import m1 = require("ref/m1"); -export declare var a1: number; -export declare class c1 { - p1: number; -} -export declare var instance1: c1; -export declare function f1(): c1; -export declare var a2: typeof m1.m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js deleted file mode 100644 index 46c9f29e55a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d0638b6c34c..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,KAEd,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACIE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,KAEjB,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ 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 index a68d507bdf3..b2e2f7f7b9b 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json index a68d507bdf3..b2e2f7f7b9b 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json index 1641625569c..0730753a471 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json index 1641625569c..0730753a471 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json index 085ef5e8f19..d1d60d81434 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..f420dc4be33 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt @@ -0,0 +1,36 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== ../outputdir_multifolder_ref/m2.ts (0 errors) ==== + var m2_a1 = 10; + class m2_c1 { + public m2_c1_p1: number; + } + + var m2_instance1 = new m2_c1(); + function m2_f1() { + return m2_instance1; + } +==== test.ts (0 errors) ==== + /// + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 085ef5e8f19..d1d60d81434 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json index 9df1fd3922e..46d15a907a4 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json index 9df1fd3922e..46d15a907a4 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json index 1a472ca17ee..53336eb9a6f 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json index 1a472ca17ee..53336eb9a6f 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json index 98a2dea2484..a5cf9d7d10e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..fa5c648451a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 98a2dea2484..a5cf9d7d10e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json index dbef889efec..edb9f68ed00 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json index dbef889efec..edb9f68ed00 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json index afc78006729..0091f700603 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json index afc78006729..0091f700603 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json index 53e86654ad1..259d1eb920a 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..6fdef1c0d9d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt @@ -0,0 +1,14 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== test.ts (0 errors) ==== + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 53e86654ad1..259d1eb920a 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "test.ts" diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json index 77912e79790..ac0c223a65f 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json index 77912e79790..ac0c223a65f 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json @@ -5,9 +5,9 @@ "test.ts" ], "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json index 362af3ded05..40a5e623164 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json index 362af3ded05..40a5e623164 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -6,9 +6,9 @@ ], "outDir": "outdir/simple", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json index 7c4bb20e942..b779b692d77 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..2a58fd1ab36 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt @@ -0,0 +1,25 @@ +error TS6082: Only 'amd' and 'system' modules are supported alongside --out. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +==== ref/m1.ts (0 errors) ==== + var m1_a1 = 10; + class m1_c1 { + public m1_c1_p1: number; + } + + var m1_instance1 = new m1_c1(); + function m1_f1() { + return m1_instance1; + } +==== test.ts (0 errors) ==== + /// + var a1 = 10; + class c1 { + public p1: number; + } + + var instance1 = new c1(); + function f1() { + return instance1; + } \ 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 index 7c4bb20e942..b779b692d77 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.json @@ -6,9 +6,9 @@ ], "out": "bin/test.js", "sourceMap": true, - "sourceRoot": "http://typescript.codeplex.com/", "declaration": true, "baselineCheck": true, + "sourceRoot": "http://typescript.codeplex.com/", "resolvedInputFiles": [ "lib.d.ts", "ref/m1.ts", diff --git a/tests/baselines/reference/reExportDefaultExport.js b/tests/baselines/reference/reExportDefaultExport.js new file mode 100644 index 00000000000..dbe3dfdbbae --- /dev/null +++ b/tests/baselines/reference/reExportDefaultExport.js @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/es6/modules/reExportDefaultExport.ts] //// + +//// [m1.ts] + +export default function f() { +} +export {f}; + + +//// [m2.ts] +import foo from "./m1"; +import {f} from "./m1"; + +f(); +foo(); + +//// [m1.js] +function f() { +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = f; +exports.f = f; +//// [m2.js] +var m1_1 = require("./m1"); +var m1_2 = require("./m1"); +m1_2.f(); +m1_1.default(); diff --git a/tests/baselines/reference/reExportDefaultExport.symbols b/tests/baselines/reference/reExportDefaultExport.symbols new file mode 100644 index 00000000000..cd0d6e493c9 --- /dev/null +++ b/tests/baselines/reference/reExportDefaultExport.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f() { +>f : Symbol(f, Decl(m1.ts, 0, 0)) +} +export {f}; +>f : Symbol(f, Decl(m1.ts, 3, 8)) + + +=== tests/cases/conformance/es6/modules/m2.ts === +import foo from "./m1"; +>foo : Symbol(foo, Decl(m2.ts, 0, 6)) + +import {f} from "./m1"; +>f : Symbol(f, Decl(m2.ts, 1, 8)) + +f(); +>f : Symbol(f, Decl(m2.ts, 1, 8)) + +foo(); +>foo : Symbol(foo, Decl(m2.ts, 0, 6)) + diff --git a/tests/baselines/reference/reExportDefaultExport.types b/tests/baselines/reference/reExportDefaultExport.types new file mode 100644 index 00000000000..f775571ac2c --- /dev/null +++ b/tests/baselines/reference/reExportDefaultExport.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f() { +>f : () => void +} +export {f}; +>f : () => void + + +=== tests/cases/conformance/es6/modules/m2.ts === +import foo from "./m1"; +>foo : () => void + +import {f} from "./m1"; +>f : () => void + +f(); +>f() : void +>f : () => void + +foo(); +>foo() : void +>foo : () => void + diff --git a/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.errors.txt new file mode 100644 index 00000000000..35fc45421c4 --- /dev/null +++ b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.errors.txt @@ -0,0 +1,19 @@ +tests/cases/compiler/test.ts(2,19): error TS2307: Cannot find module './missingModule'. + + +==== tests/cases/compiler/existingModule.ts (0 errors) ==== + + export var x = 1; + +==== tests/cases/compiler/test.ts (1 errors) ==== + import {x} from './existingModule'; + import {foo} from './missingModule'; + ~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './missingModule'. + + declare function use(a: any): void; + + const test = { x, foo }; + + use(x); + use(foo); \ No newline at end of file diff --git a/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js new file mode 100644 index 00000000000..1cb7fc677cd --- /dev/null +++ b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/shorthandPropertyAssignmentInES6Module.ts] //// + +//// [existingModule.ts] + +export var x = 1; + +//// [test.ts] +import {x} from './existingModule'; +import {foo} from './missingModule'; + +declare function use(a: any): void; + +const test = { x, foo }; + +use(x); +use(foo); + +//// [existingModule.js] +exports.x = 1; +//// [test.js] +var existingModule_1 = require('./existingModule'); +var missingModule_1 = require('./missingModule'); +const test = { x: existingModule_1.x, foo: missingModule_1.foo }; +use(existingModule_1.x); +use(missingModule_1.foo); diff --git a/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js new file mode 100644 index 00000000000..ec6b5682edd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js @@ -0,0 +1,10 @@ +//// [sourceMapValidationLambdaSpanningMultipleLines.ts] +((item: string) => + item +) + +//// [sourceMapValidationLambdaSpanningMultipleLines.js] +(function (item) { + return item; +}); +//# sourceMappingURL=sourceMapValidationLambdaSpanningMultipleLines.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js.map b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js.map new file mode 100644 index 00000000000..c0151106e7c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationLambdaSpanningMultipleLines.js.map] +{"version":3,"file":"sourceMapValidationLambdaSpanningMultipleLines.js","sourceRoot":"","sources":["sourceMapValidationLambdaSpanningMultipleLines.ts"],"names":[],"mappings":"AAAA,CAAC,UAAC,IAAY;IACV,OAAA,IAAI;AAAJ,CAAI,CACP,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.sourcemap.txt b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.sourcemap.txt new file mode 100644 index 00000000000..475aa1debef --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.sourcemap.txt @@ -0,0 +1,54 @@ +=================================================================== +JsFile: sourceMapValidationLambdaSpanningMultipleLines.js +mapUrl: sourceMapValidationLambdaSpanningMultipleLines.js.map +sourceRoot: +sources: sourceMapValidationLambdaSpanningMultipleLines.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.js +sourceFile:sourceMapValidationLambdaSpanningMultipleLines.ts +------------------------------------------------------------------- +>>>(function (item) { +1 > +2 >^ +3 > ^^^^^^^^^^ +4 > ^^^^ +5 > ^^-> +1 > +2 >( +3 > ( +4 > item: string +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 2) Source(1, 2) + SourceIndex(0) +3 >Emitted(1, 12) Source(1, 3) + SourceIndex(0) +4 >Emitted(1, 16) Source(1, 15) + SourceIndex(0) +--- +>>> return item; +1->^^^^ +2 > ^^^^^^^ +3 > ^^^^ +1->) => + > +2 > +3 > item +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 12) Source(2, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(2, 9) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >item +3 > + > ) +4 > +1 >Emitted(3, 1) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 2) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 3) Source(3, 2) + SourceIndex(0) +4 >Emitted(3, 4) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationLambdaSpanningMultipleLines.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.symbols b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.symbols new file mode 100644 index 00000000000..c7ff4ca9d9f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts === +((item: string) => +>item : Symbol(item, Decl(sourceMapValidationLambdaSpanningMultipleLines.ts, 0, 2)) + + item +>item : Symbol(item, Decl(sourceMapValidationLambdaSpanningMultipleLines.ts, 0, 2)) + +) diff --git a/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.types b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.types new file mode 100644 index 00000000000..d39119cbd91 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts === +((item: string) => +>((item: string) => item) : (item: string) => string +>(item: string) => item : (item: string) => string +>item : string + + item +>item : string + +) diff --git a/tests/baselines/reference/specializedSignatureInInterface.types b/tests/baselines/reference/specializedSignatureInInterface.types index c8f76f4cb9b..b9621af7b8b 100644 --- a/tests/baselines/reference/specializedSignatureInInterface.types +++ b/tests/baselines/reference/specializedSignatureInInterface.types @@ -11,8 +11,8 @@ interface B extends A { >A : A (key:'foo'):string; ->key : 'foo' +>key : "foo" (key:'bar'):string; ->key : 'bar' +>key : "bar" } diff --git a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.types b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.types index cb86966d65a..b27a935ced6 100644 --- a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.types +++ b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.types @@ -3,30 +3,30 @@ // All the below should not be errors function foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; } +>x : "a" function foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; } +>foo : { (x: "a"): any; (x: string): any; } >x : string function foo(x: any) { } ->foo : { (x: 'a'): any; (x: string): any; } +>foo : { (x: "a"): any; (x: string): any; } >x : any class C { >C : C foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; } +>foo : { (x: "a"): any; (x: string): any; } >x : string foo(x: any) { } ->foo : { (x: 'a'): any; (x: string): any; } +>foo : { (x: "a"): any; (x: string): any; } >x : any } @@ -35,20 +35,20 @@ class C2 { >T : T foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : string foo(x: T); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : T >T : T foo(x: any) { } ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : any } @@ -58,20 +58,20 @@ class C3 { >String : String foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : string foo(x: T); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : T >T : T foo(x: any) { } ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : any } @@ -79,7 +79,7 @@ interface I { >I : I (x: 'a'); ->x : 'a' +>x : "a" (x: number); >x : number @@ -88,15 +88,15 @@ interface I { >x : string foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; (x: number): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; (x: number): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; (x: number): any; } +>foo : { (x: "a"): any; (x: string): any; (x: number): any; } >x : string foo(x: number); ->foo : { (x: 'a'): any; (x: string): any; (x: number): any; } +>foo : { (x: "a"): any; (x: string): any; (x: number): any; } >x : number } @@ -105,7 +105,7 @@ interface I2 { >T : T (x: 'a'); ->x : 'a' +>x : "a" (x: T); >x : T @@ -115,15 +115,15 @@ interface I2 { >x : string foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : string foo(x: T); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : T >T : T } @@ -134,7 +134,7 @@ interface I3 { >String : String (x: 'a'); ->x : 'a' +>x : "a" (x: string); >x : string @@ -144,49 +144,49 @@ interface I3 { >T : T foo(x: 'a'); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } ->x : 'a' +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } +>x : "a" foo(x: string); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : string foo(x: T); ->foo : { (x: 'a'): any; (x: string): any; (x: T): any; } +>foo : { (x: "a"): any; (x: string): any; (x: T): any; } >x : T >T : T } var a: { ->a : { (x: string): any; (x: 'a'): any; (x: number): any; foo(x: string): any; foo(x: 'a'): any; foo(x: number): any; } +>a : { (x: string): any; (x: "a"): any; (x: number): any; foo(x: string): any; foo(x: "a"): any; foo(x: number): any; } (x: string); >x : string (x: 'a'); ->x : 'a' +>x : "a" (x: number); >x : number foo(x: string); ->foo : { (x: string): any; (x: 'a'): any; (x: number): any; } +>foo : { (x: string): any; (x: "a"): any; (x: number): any; } >x : string foo(x: 'a'); ->foo : { (x: string): any; (x: 'a'): any; (x: number): any; } ->x : 'a' +>foo : { (x: string): any; (x: "a"): any; (x: number): any; } +>x : "a" foo(x: number); ->foo : { (x: string): any; (x: 'a'): any; (x: number): any; } +>foo : { (x: string): any; (x: "a"): any; (x: number): any; } >x : number } var a2: { ->a2 : { (x: 'a'): any; (x: string): any; (x: T): any; foo(x: string): any; foo(x: 'a'): any; foo(x: T): any; } +>a2 : { (x: "a"): any; (x: string): any; (x: T): any; foo(x: string): any; foo(x: "a"): any; foo(x: T): any; } (x: 'a'); ->x : 'a' +>x : "a" (x: string); >x : string @@ -197,25 +197,25 @@ var a2: { >T : T foo(x: string); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } >x : string foo(x: 'a'); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } ->x : 'a' +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } +>x : "a" foo(x: T); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } >T : T >x : T >T : T } var a3: { ->a3 : { (x: 'a'): any; (x: T): any; (x: string): any; foo(x: string): any; foo(x: 'a'): any; foo(x: T): any; } +>a3 : { (x: "a"): any; (x: T): any; (x: string): any; foo(x: string): any; foo(x: "a"): any; foo(x: T): any; } (x: 'a'); ->x : 'a' +>x : "a" (x: T); >T : T @@ -226,15 +226,15 @@ var a3: { >x : string foo(x: string); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } >x : string foo(x: 'a'); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } ->x : 'a' +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } +>x : "a" foo(x: T); ->foo : { (x: string): any; (x: 'a'): any; (x: T): any; } +>foo : { (x: string): any; (x: "a"): any; (x: T): any; } >T : T >String : String >x : T diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.js b/tests/baselines/reference/stringLiteralCheckedInIf01.js new file mode 100644 index 00000000000..161c39b96ef --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.js @@ -0,0 +1,29 @@ +//// [stringLiteralCheckedInIf01.ts] + +type S = "a" | "b"; +type T = S[] | S; + +function f(foo: T) { + if (foo === "a") { + return foo; + } + else if (foo === "b") { + return foo; + } + else { + return (foo as S[])[0]; + } +} + +//// [stringLiteralCheckedInIf01.js] +function f(foo) { + if (foo === "a") { + return foo; + } + else if (foo === "b") { + return foo; + } + else { + return foo[0]; + } +} diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.symbols b/tests/baselines/reference/stringLiteralCheckedInIf01.symbols new file mode 100644 index 00000000000..1b4d5e6b071 --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts === + +type S = "a" | "b"; +>S : Symbol(S, Decl(stringLiteralCheckedInIf01.ts, 0, 0)) + +type T = S[] | S; +>T : Symbol(T, Decl(stringLiteralCheckedInIf01.ts, 1, 19)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf01.ts, 0, 0)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf01.ts, 0, 0)) + +function f(foo: T) { +>f : Symbol(f, Decl(stringLiteralCheckedInIf01.ts, 2, 17)) +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) +>T : Symbol(T, Decl(stringLiteralCheckedInIf01.ts, 1, 19)) + + if (foo === "a") { +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) + + return foo; +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) + } + else if (foo === "b") { +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) + + return foo; +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) + } + else { + return (foo as S[])[0]; +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf01.ts, 4, 11)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf01.ts, 0, 0)) + } +} diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.types b/tests/baselines/reference/stringLiteralCheckedInIf01.types new file mode 100644 index 00000000000..75b7eadbc19 --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.types @@ -0,0 +1,41 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts === + +type S = "a" | "b"; +>S : "a" | "b" + +type T = S[] | S; +>T : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>S : "a" | "b" + +function f(foo: T) { +>f : (foo: ("a" | "b")[] | "a" | "b") => ("a" | "b")[] | "a" | "b" +>foo : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" + + if (foo === "a") { +>foo === "a" : boolean +>foo : ("a" | "b")[] | "a" | "b" +>"a" : string + + return foo; +>foo : ("a" | "b")[] | "a" | "b" + } + else if (foo === "b") { +>foo === "b" : boolean +>foo : ("a" | "b")[] | "a" | "b" +>"b" : string + + return foo; +>foo : ("a" | "b")[] | "a" | "b" + } + else { + return (foo as S[])[0]; +>(foo as S[])[0] : "a" | "b" +>(foo as S[]) : ("a" | "b")[] +>foo as S[] : ("a" | "b")[] +>foo : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>0 : number + } +} diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.js b/tests/baselines/reference/stringLiteralCheckedInIf02.js new file mode 100644 index 00000000000..22bd6359f61 --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.js @@ -0,0 +1,30 @@ +//// [stringLiteralCheckedInIf02.ts] + +type S = "a" | "b"; +type T = S[] | S; + +function isS(t: T): t is S { + return t === "a" || t === "b"; +} + +function f(foo: T) { + if (isS(foo)) { + return foo; + } + else { + return foo[0]; + } +} + +//// [stringLiteralCheckedInIf02.js] +function isS(t) { + return t === "a" || t === "b"; +} +function f(foo) { + if (isS(foo)) { + return foo; + } + else { + return foo[0]; + } +} diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.symbols b/tests/baselines/reference/stringLiteralCheckedInIf02.symbols new file mode 100644 index 00000000000..629f990b912 --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf02.ts === + +type S = "a" | "b"; +>S : Symbol(S, Decl(stringLiteralCheckedInIf02.ts, 0, 0)) + +type T = S[] | S; +>T : Symbol(T, Decl(stringLiteralCheckedInIf02.ts, 1, 19)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf02.ts, 0, 0)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf02.ts, 0, 0)) + +function isS(t: T): t is S { +>isS : Symbol(isS, Decl(stringLiteralCheckedInIf02.ts, 2, 17)) +>t : Symbol(t, Decl(stringLiteralCheckedInIf02.ts, 4, 13)) +>T : Symbol(T, Decl(stringLiteralCheckedInIf02.ts, 1, 19)) +>t : Symbol(t, Decl(stringLiteralCheckedInIf02.ts, 4, 13)) +>S : Symbol(S, Decl(stringLiteralCheckedInIf02.ts, 0, 0)) + + return t === "a" || t === "b"; +>t : Symbol(t, Decl(stringLiteralCheckedInIf02.ts, 4, 13)) +>t : Symbol(t, Decl(stringLiteralCheckedInIf02.ts, 4, 13)) +} + +function f(foo: T) { +>f : Symbol(f, Decl(stringLiteralCheckedInIf02.ts, 6, 1)) +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf02.ts, 8, 11)) +>T : Symbol(T, Decl(stringLiteralCheckedInIf02.ts, 1, 19)) + + if (isS(foo)) { +>isS : Symbol(isS, Decl(stringLiteralCheckedInIf02.ts, 2, 17)) +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf02.ts, 8, 11)) + + return foo; +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf02.ts, 8, 11)) + } + else { + return foo[0]; +>foo : Symbol(foo, Decl(stringLiteralCheckedInIf02.ts, 8, 11)) + } +} diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types new file mode 100644 index 00000000000..79f4c6a223a --- /dev/null +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -0,0 +1,47 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf02.ts === + +type S = "a" | "b"; +>S : "a" | "b" + +type T = S[] | S; +>T : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>S : "a" | "b" + +function isS(t: T): t is S { +>isS : (t: ("a" | "b")[] | "a" | "b") => t is "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" +>t : any +>S : "a" | "b" + + return t === "a" || t === "b"; +>t === "a" || t === "b" : boolean +>t === "a" : boolean +>t : ("a" | "b")[] | "a" | "b" +>"a" : string +>t === "b" : boolean +>t : ("a" | "b")[] | "a" | "b" +>"b" : string +} + +function f(foo: T) { +>f : (foo: ("a" | "b")[] | "a" | "b") => "a" | "b" +>foo : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" + + if (isS(foo)) { +>isS(foo) : boolean +>isS : (t: ("a" | "b")[] | "a" | "b") => t is "a" | "b" +>foo : ("a" | "b")[] | "a" | "b" + + return foo; +>foo : "a" | "b" + } + else { + return foo[0]; +>foo[0] : "a" | "b" +>foo : ("a" | "b")[] +>0 : number + } +} diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.js b/tests/baselines/reference/stringLiteralMatchedInSwitch01.js new file mode 100644 index 00000000000..b9b24cf0c66 --- /dev/null +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.js @@ -0,0 +1,25 @@ +//// [stringLiteralMatchedInSwitch01.ts] + +type S = "a" | "b"; +type T = S[] | S; + +var foo: T; +switch (foo) { + case "a": + case "b": + break; + default: + foo = (foo as S[])[0]; + break; +} + +//// [stringLiteralMatchedInSwitch01.js] +var foo; +switch (foo) { + case "a": + case "b": + break; + default: + foo = foo[0]; + break; +} diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.symbols b/tests/baselines/reference/stringLiteralMatchedInSwitch01.symbols new file mode 100644 index 00000000000..0323371c307 --- /dev/null +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts === + +type S = "a" | "b"; +>S : Symbol(S, Decl(stringLiteralMatchedInSwitch01.ts, 0, 0)) + +type T = S[] | S; +>T : Symbol(T, Decl(stringLiteralMatchedInSwitch01.ts, 1, 19)) +>S : Symbol(S, Decl(stringLiteralMatchedInSwitch01.ts, 0, 0)) +>S : Symbol(S, Decl(stringLiteralMatchedInSwitch01.ts, 0, 0)) + +var foo: T; +>foo : Symbol(foo, Decl(stringLiteralMatchedInSwitch01.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralMatchedInSwitch01.ts, 1, 19)) + +switch (foo) { +>foo : Symbol(foo, Decl(stringLiteralMatchedInSwitch01.ts, 4, 3)) + + case "a": + case "b": + break; + default: + foo = (foo as S[])[0]; +>foo : Symbol(foo, Decl(stringLiteralMatchedInSwitch01.ts, 4, 3)) +>foo : Symbol(foo, Decl(stringLiteralMatchedInSwitch01.ts, 4, 3)) +>S : Symbol(S, Decl(stringLiteralMatchedInSwitch01.ts, 0, 0)) + + break; +} diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types new file mode 100644 index 00000000000..cfbb77e07e0 --- /dev/null +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts === + +type S = "a" | "b"; +>S : "a" | "b" + +type T = S[] | S; +>T : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>S : "a" | "b" + +var foo: T; +>foo : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" + +switch (foo) { +>foo : ("a" | "b")[] | "a" | "b" + + case "a": +>"a" : string + + case "b": +>"b" : string + + break; + default: + foo = (foo as S[])[0]; +>foo = (foo as S[])[0] : "a" | "b" +>foo : ("a" | "b")[] | "a" | "b" +>(foo as S[])[0] : "a" | "b" +>(foo as S[]) : ("a" | "b")[] +>foo as S[] : ("a" | "b")[] +>foo : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>0 : number + + break; +} diff --git a/tests/baselines/reference/stringLiteralType.errors.txt b/tests/baselines/reference/stringLiteralType.errors.txt deleted file mode 100644 index 275db139cf7..00000000000 --- a/tests/baselines/reference/stringLiteralType.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts(1,8): error TS1110: Type expected. - - -==== tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts (1 errors) ==== - var x: 'hi'; - ~~~~ -!!! error TS1110: 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/stringLiteralType.js b/tests/baselines/reference/stringLiteralType.js index 35f35f1cbef..a6926453c47 100644 --- a/tests/baselines/reference/stringLiteralType.js +++ b/tests/baselines/reference/stringLiteralType.js @@ -7,6 +7,6 @@ function f(x: any) { } //// [stringLiteralType.js] -var x = 'hi'; +var x; function f(x) { } diff --git a/tests/baselines/reference/stringLiteralType.symbols b/tests/baselines/reference/stringLiteralType.symbols new file mode 100644 index 00000000000..687d3052442 --- /dev/null +++ b/tests/baselines/reference/stringLiteralType.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts === +var x: 'hi'; +>x : Symbol(x, Decl(stringLiteralType.ts, 0, 3)) + +function f(x: 'hi'); +>f : Symbol(f, Decl(stringLiteralType.ts, 0, 12), Decl(stringLiteralType.ts, 2, 20), Decl(stringLiteralType.ts, 3, 22)) +>x : Symbol(x, Decl(stringLiteralType.ts, 2, 11)) + +function f(x: string); +>f : Symbol(f, Decl(stringLiteralType.ts, 0, 12), Decl(stringLiteralType.ts, 2, 20), Decl(stringLiteralType.ts, 3, 22)) +>x : Symbol(x, Decl(stringLiteralType.ts, 3, 11)) + +function f(x: any) { +>f : Symbol(f, Decl(stringLiteralType.ts, 0, 12), Decl(stringLiteralType.ts, 2, 20), Decl(stringLiteralType.ts, 3, 22)) +>x : Symbol(x, Decl(stringLiteralType.ts, 4, 11)) +} diff --git a/tests/baselines/reference/stringLiteralType.types b/tests/baselines/reference/stringLiteralType.types new file mode 100644 index 00000000000..affa995c2f3 --- /dev/null +++ b/tests/baselines/reference/stringLiteralType.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts === +var x: 'hi'; +>x : "hi" + +function f(x: 'hi'); +>f : { (x: "hi"): any; (x: string): any; } +>x : "hi" + +function f(x: string); +>f : { (x: "hi"): any; (x: string): any; } +>x : string + +function f(x: any) { +>f : { (x: "hi"): any; (x: string): any; } +>x : any +} diff --git a/tests/baselines/reference/stringLiteralTypeAssertion01.js b/tests/baselines/reference/stringLiteralTypeAssertion01.js new file mode 100644 index 00000000000..7877004cf01 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypeAssertion01.js @@ -0,0 +1,53 @@ +//// [stringLiteralTypeAssertion01.ts] + +type S = "a" | "b"; +type T = S[] | S; + +var s: S; +var t: T; +var str: string; + +//////////////// + +s = t; +s = t as S; + +s = str; +s = str as S; + +//////////////// + +t = s; +t = s as T; + +t = str; +t = str as T; + +//////////////// + +str = s; +str = s as string; + +str = t; +str = t as string; + + +//// [stringLiteralTypeAssertion01.js] +var s; +var t; +var str; +//////////////// +s = t; +s = t; +s = str; +s = str; +//////////////// +t = s; +t = s; +t = str; +t = str; +//////////////// +str = s; +str = s; +str = t; +str = t; diff --git a/tests/baselines/reference/stringLiteralTypeAssertion01.symbols b/tests/baselines/reference/stringLiteralTypeAssertion01.symbols new file mode 100644 index 00000000000..1491a32b6f8 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypeAssertion01.symbols @@ -0,0 +1,83 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts === + +type S = "a" | "b"; +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) + +type T = S[] | S; +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) + +var s: S; +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) + +var str: string; +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) + +//////////////// + +s = t; +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) + +s = t as S; +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) + +s = str; +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) + +s = str as S; +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>S : Symbol(S, Decl(stringLiteralTypeAssertion01.ts, 0, 0)) + +//////////////// + +t = s; +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) + +t = s as T; +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) + +t = str; +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) + +t = str as T; +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>T : Symbol(T, Decl(stringLiteralTypeAssertion01.ts, 1, 19)) + +//////////////// + +str = s; +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) + +str = s as string; +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>s : Symbol(s, Decl(stringLiteralTypeAssertion01.ts, 4, 3)) + +str = t; +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) + +str = t as string; +>str : Symbol(str, Decl(stringLiteralTypeAssertion01.ts, 6, 3)) +>t : Symbol(t, Decl(stringLiteralTypeAssertion01.ts, 5, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypeAssertion01.types b/tests/baselines/reference/stringLiteralTypeAssertion01.types new file mode 100644 index 00000000000..f70313f8347 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypeAssertion01.types @@ -0,0 +1,107 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts === + +type S = "a" | "b"; +>S : "a" | "b" + +type T = S[] | S; +>T : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" +>S : "a" | "b" + +var s: S; +>s : "a" | "b" +>S : "a" | "b" + +var t: T; +>t : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" + +var str: string; +>str : string + +//////////////// + +s = t; +>s = t : "a" | "b" +>s : "a" | "b" +>t : "a" | "b" +>S : "a" | "b" +>t : ("a" | "b")[] | "a" | "b" + +s = t as S; +>s = t as S : "a" | "b" +>s : "a" | "b" +>t as S : "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>S : "a" | "b" + +s = str; +>s = str : "a" | "b" +>s : "a" | "b" +>str : "a" | "b" +>S : "a" | "b" +>str : string + +s = str as S; +>s = str as S : "a" | "b" +>s : "a" | "b" +>str as S : "a" | "b" +>str : string +>S : "a" | "b" + +//////////////// + +t = s; +>t = s : ("a" | "b")[] | "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>s : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" +>s : "a" | "b" + +t = s as T; +>t = s as T : ("a" | "b")[] | "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>s as T : ("a" | "b")[] | "a" | "b" +>s : "a" | "b" +>T : ("a" | "b")[] | "a" | "b" + +t = str; +>t = str : ("a" | "b")[] | "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>str : ("a" | "b")[] | "a" | "b" +>T : ("a" | "b")[] | "a" | "b" +>str : string + +t = str as T; +>t = str as T : ("a" | "b")[] | "a" | "b" +>t : ("a" | "b")[] | "a" | "b" +>str as T : ("a" | "b")[] | "a" | "b" +>str : string +>T : ("a" | "b")[] | "a" | "b" + +//////////////// + +str = s; +>str = s : string +>str : string +>s : string +>s : "a" | "b" + +str = s as string; +>str = s as string : string +>str : string +>s as string : string +>s : "a" | "b" + +str = t; +>str = t : string +>str : string +>t : string +>t : ("a" | "b")[] | "a" | "b" + +str = t as string; +>str = t as string : string +>str : string +>t as string : string +>t : ("a" | "b")[] | "a" | "b" + diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js new file mode 100644 index 00000000000..479256b18b7 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js @@ -0,0 +1,26 @@ +//// [stringLiteralTypesAndLogicalOrExpressions01.ts] + +declare function myRandBool(): boolean; + +let a: "foo" = "foo"; +let b = a || "foo"; +let c: "foo" = b; +let d = b || "bar"; +let e: "foo" | "bar" = d; + + +//// [stringLiteralTypesAndLogicalOrExpressions01.js] +var a = "foo"; +var b = a || "foo"; +var c = b; +var d = b || "bar"; +var e = d; + + +//// [stringLiteralTypesAndLogicalOrExpressions01.d.ts] +declare function myRandBool(): boolean; +declare let a: "foo"; +declare let b: "foo"; +declare let c: "foo"; +declare let d: "foo" | "bar"; +declare let e: "foo" | "bar"; diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.symbols b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.symbols new file mode 100644 index 00000000000..2a9f28e85a5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts === + +declare function myRandBool(): boolean; +>myRandBool : Symbol(myRandBool, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 0, 0)) + +let a: "foo" = "foo"; +>a : Symbol(a, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 3, 3)) + +let b = a || "foo"; +>b : Symbol(b, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 4, 3)) +>a : Symbol(a, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 3, 3)) + +let c: "foo" = b; +>c : Symbol(c, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 5, 3)) +>b : Symbol(b, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 4, 3)) + +let d = b || "bar"; +>d : Symbol(d, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 6, 3)) +>b : Symbol(b, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 4, 3)) + +let e: "foo" | "bar" = d; +>e : Symbol(e, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 7, 3)) +>d : Symbol(d, Decl(stringLiteralTypesAndLogicalOrExpressions01.ts, 6, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.types b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.types new file mode 100644 index 00000000000..ddc79b81857 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.types @@ -0,0 +1,29 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts === + +declare function myRandBool(): boolean; +>myRandBool : () => boolean + +let a: "foo" = "foo"; +>a : "foo" +>"foo" : "foo" + +let b = a || "foo"; +>b : "foo" +>a || "foo" : "foo" +>a : "foo" +>"foo" : "foo" + +let c: "foo" = b; +>c : "foo" +>b : "foo" + +let d = b || "bar"; +>d : "foo" | "bar" +>b || "bar" : "foo" | "bar" +>b : "foo" +>"bar" : "bar" + +let e: "foo" | "bar" = d; +>e : "foo" | "bar" +>d : "foo" | "bar" + diff --git a/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.js b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.js new file mode 100644 index 00000000000..1fe1225c6f4 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.js @@ -0,0 +1,23 @@ +//// [stringLiteralTypesAndParenthesizedExpressions01.ts] + +declare function myRandBool(): boolean; + +let a: "foo" = ("foo"); +let b: "foo" | "bar" = ("foo"); +let c: "foo" = (myRandBool ? "foo" : ("foo")); +let d: "foo" | "bar" = (myRandBool ? "foo" : ("bar")); + + +//// [stringLiteralTypesAndParenthesizedExpressions01.js] +var a = ("foo"); +var b = ("foo"); +var c = (myRandBool ? "foo" : ("foo")); +var d = (myRandBool ? "foo" : ("bar")); + + +//// [stringLiteralTypesAndParenthesizedExpressions01.d.ts] +declare function myRandBool(): boolean; +declare let a: "foo"; +declare let b: "foo" | "bar"; +declare let c: "foo"; +declare let d: "foo" | "bar"; diff --git a/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.symbols b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.symbols new file mode 100644 index 00000000000..2206a5185c1 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts === + +declare function myRandBool(): boolean; +>myRandBool : Symbol(myRandBool, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 0, 0)) + +let a: "foo" = ("foo"); +>a : Symbol(a, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 3, 3)) + +let b: "foo" | "bar" = ("foo"); +>b : Symbol(b, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 4, 3)) + +let c: "foo" = (myRandBool ? "foo" : ("foo")); +>c : Symbol(c, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 5, 3)) +>myRandBool : Symbol(myRandBool, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 0, 0)) + +let d: "foo" | "bar" = (myRandBool ? "foo" : ("bar")); +>d : Symbol(d, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 6, 3)) +>myRandBool : Symbol(myRandBool, Decl(stringLiteralTypesAndParenthesizedExpressions01.ts, 0, 0)) + diff --git a/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.types b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.types new file mode 100644 index 00000000000..0bb2e1dd3c7 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndParenthesizedExpressions01.types @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts === + +declare function myRandBool(): boolean; +>myRandBool : () => boolean + +let a: "foo" = ("foo"); +>a : "foo" +>("foo") : "foo" +>"foo" : "foo" + +let b: "foo" | "bar" = ("foo"); +>b : "foo" | "bar" +>("foo") : "foo" +>"foo" : "foo" + +let c: "foo" = (myRandBool ? "foo" : ("foo")); +>c : "foo" +>(myRandBool ? "foo" : ("foo")) : "foo" +>myRandBool ? "foo" : ("foo") : "foo" +>myRandBool : () => boolean +>"foo" : "foo" +>("foo") : "foo" +>"foo" : "foo" + +let d: "foo" | "bar" = (myRandBool ? "foo" : ("bar")); +>d : "foo" | "bar" +>(myRandBool ? "foo" : ("bar")) : "foo" | "bar" +>myRandBool ? "foo" : ("bar") : "foo" | "bar" +>myRandBool : () => boolean +>"foo" : "foo" +>("bar") : "bar" +>"bar" : "bar" + diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.js b/tests/baselines/reference/stringLiteralTypesAndTuples01.js new file mode 100644 index 00000000000..ae02d12429a --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.js @@ -0,0 +1,42 @@ +//// [stringLiteralTypesAndTuples01.ts] + +// Should all be strings. +let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; + +type RexOrRaptor = "t-rex" | "raptor" +let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; + +rawr(dinosaur); + +function rawr(dino: RexOrRaptor) { + if (dino === "t-rex") { + return "ROAAAAR!"; + } + if (dino === "raptor") { + return "yip yip!"; + } + + throw "Unexpected " + dino; +} + +//// [stringLiteralTypesAndTuples01.js] +// Should all be strings. +var _a = ["Hello", "Brave", "New", "World"], hello = _a[0], brave = _a[1], newish = _a[2], world = _a[3]; +var _b = ['I\'m', 'a', 't-rex'], im = _b[0], a = _b[1], dinosaur = _b[2]; +rawr(dinosaur); +function rawr(dino) { + if (dino === "t-rex") { + return "ROAAAAR!"; + } + if (dino === "raptor") { + return "yip yip!"; + } + throw "Unexpected " + dino; +} + + +//// [stringLiteralTypesAndTuples01.d.ts] +declare let hello: string, brave: string, newish: string, world: string; +declare type RexOrRaptor = "t-rex" | "raptor"; +declare let im: "I'm", a: "a", dinosaur: "t-rex" | "raptor"; +declare function rawr(dino: RexOrRaptor): string; diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.symbols b/tests/baselines/reference/stringLiteralTypesAndTuples01.symbols new file mode 100644 index 00000000000..b7ca53517ca --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndTuples01.ts === + +// Should all be strings. +let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; +>hello : Symbol(hello, Decl(stringLiteralTypesAndTuples01.ts, 2, 5)) +>brave : Symbol(brave, Decl(stringLiteralTypesAndTuples01.ts, 2, 11)) +>newish : Symbol(newish, Decl(stringLiteralTypesAndTuples01.ts, 2, 18)) +>world : Symbol(world, Decl(stringLiteralTypesAndTuples01.ts, 2, 26)) + +type RexOrRaptor = "t-rex" | "raptor" +>RexOrRaptor : Symbol(RexOrRaptor, Decl(stringLiteralTypesAndTuples01.ts, 2, 71)) + +let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; +>im : Symbol(im, Decl(stringLiteralTypesAndTuples01.ts, 5, 5)) +>a : Symbol(a, Decl(stringLiteralTypesAndTuples01.ts, 5, 8)) +>dinosaur : Symbol(dinosaur, Decl(stringLiteralTypesAndTuples01.ts, 5, 11)) +>RexOrRaptor : Symbol(RexOrRaptor, Decl(stringLiteralTypesAndTuples01.ts, 2, 71)) + +rawr(dinosaur); +>rawr : Symbol(rawr, Decl(stringLiteralTypesAndTuples01.ts, 7, 15)) +>dinosaur : Symbol(dinosaur, Decl(stringLiteralTypesAndTuples01.ts, 5, 11)) + +function rawr(dino: RexOrRaptor) { +>rawr : Symbol(rawr, Decl(stringLiteralTypesAndTuples01.ts, 7, 15)) +>dino : Symbol(dino, Decl(stringLiteralTypesAndTuples01.ts, 9, 14)) +>RexOrRaptor : Symbol(RexOrRaptor, Decl(stringLiteralTypesAndTuples01.ts, 2, 71)) + + if (dino === "t-rex") { +>dino : Symbol(dino, Decl(stringLiteralTypesAndTuples01.ts, 9, 14)) + + return "ROAAAAR!"; + } + if (dino === "raptor") { +>dino : Symbol(dino, Decl(stringLiteralTypesAndTuples01.ts, 9, 14)) + + return "yip yip!"; + } + + throw "Unexpected " + dino; +>dino : Symbol(dino, Decl(stringLiteralTypesAndTuples01.ts, 9, 14)) +} diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.types b/tests/baselines/reference/stringLiteralTypesAndTuples01.types new file mode 100644 index 00000000000..c874973e3e5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.types @@ -0,0 +1,59 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndTuples01.ts === + +// Should all be strings. +let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; +>hello : string +>brave : string +>newish : string +>world : string +>["Hello", "Brave", "New", "World"] : [string, string, string, string] +>"Hello" : string +>"Brave" : string +>"New" : string +>"World" : string + +type RexOrRaptor = "t-rex" | "raptor" +>RexOrRaptor : "t-rex" | "raptor" + +let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; +>im : "I'm" +>a : "a" +>dinosaur : "t-rex" | "raptor" +>RexOrRaptor : "t-rex" | "raptor" +>['I\'m', 'a', 't-rex'] : ["I'm", "a", "t-rex"] +>'I\'m' : "I'm" +>'a' : "a" +>'t-rex' : "t-rex" + +rawr(dinosaur); +>rawr(dinosaur) : string +>rawr : (dino: "t-rex" | "raptor") => string +>dinosaur : "t-rex" | "raptor" + +function rawr(dino: RexOrRaptor) { +>rawr : (dino: "t-rex" | "raptor") => string +>dino : "t-rex" | "raptor" +>RexOrRaptor : "t-rex" | "raptor" + + if (dino === "t-rex") { +>dino === "t-rex" : boolean +>dino : "t-rex" | "raptor" +>"t-rex" : string + + return "ROAAAAR!"; +>"ROAAAAR!" : string + } + if (dino === "raptor") { +>dino === "raptor" : boolean +>dino : "t-rex" | "raptor" +>"raptor" : string + + return "yip yip!"; +>"yip yip!" : string + } + + throw "Unexpected " + dino; +>"Unexpected " + dino : string +>"Unexpected " : string +>dino : "t-rex" | "raptor" +} diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.errors.txt b/tests/baselines/reference/stringLiteralTypesAsTags01.errors.txt new file mode 100644 index 00000000000..6e4f8943fb6 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts(18,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts(19,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts(20,10): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts(22,21): error TS2304: Cannot find name 'is'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts (4 errors) ==== + + type Kind = "A" | "B" + + interface Entity { + kind: Kind; + } + + interface A extends Entity { + kind: "A"; + a: number; + } + + interface B extends Entity { + kind: "B"; + b: string; + } + + function hasKind(entity: Entity, kind: "A"): entity is A; + ~~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function hasKind(entity: Entity, kind: "B"): entity is B; + ~~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function hasKind(entity: Entity, kind: Kind): entity is Entity; + ~~~~~~~ +!!! error TS2394: Overload signature is not compatible with function implementation. + function hasKind(entity: Entity, kind: Kind): boolean { + return kind === is; + ~~ +!!! error TS2304: Cannot find name 'is'. + } + + let x: A = { + kind: "A", + a: 100, + } + + if (hasKind(x, "A")) { + let a = x; + } + else { + let b = x; + } + + if (!hasKind(x, "B")) { + let c = x; + } + else { + let d = x; + } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.js b/tests/baselines/reference/stringLiteralTypesAsTags01.js new file mode 100644 index 00000000000..3fe33ace487 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.js @@ -0,0 +1,83 @@ +//// [stringLiteralTypesAsTags01.ts] + +type Kind = "A" | "B" + +interface Entity { + kind: Kind; +} + +interface A extends Entity { + kind: "A"; + a: number; +} + +interface B extends Entity { + kind: "B"; + b: string; +} + +function hasKind(entity: Entity, kind: "A"): entity is A; +function hasKind(entity: Entity, kind: "B"): entity is B; +function hasKind(entity: Entity, kind: Kind): entity is Entity; +function hasKind(entity: Entity, kind: Kind): boolean { + return kind === is; +} + +let x: A = { + kind: "A", + a: 100, +} + +if (hasKind(x, "A")) { + let a = x; +} +else { + let b = x; +} + +if (!hasKind(x, "B")) { + let c = x; +} +else { + let d = x; +} + +//// [stringLiteralTypesAsTags01.js] +function hasKind(entity, kind) { + return kind === is; +} +var x = { + kind: "A", + a: 100 +}; +if (hasKind(x, "A")) { + var a = x; +} +else { + var b = x; +} +if (!hasKind(x, "B")) { + var c = x; +} +else { + var d = x; +} + + +//// [stringLiteralTypesAsTags01.d.ts] +declare type Kind = "A" | "B"; +interface Entity { + kind: Kind; +} +interface A extends Entity { + kind: "A"; + a: number; +} +interface B extends Entity { + kind: "B"; + b: string; +} +declare function hasKind(entity: Entity, kind: "A"): entity is A; +declare function hasKind(entity: Entity, kind: "B"): entity is B; +declare function hasKind(entity: Entity, kind: Kind): entity is Entity; +declare let x: A; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js new file mode 100644 index 00000000000..558f6bdf4c2 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js @@ -0,0 +1,68 @@ +//// [stringLiteralTypesAsTypeParameterConstraint01.ts] + +function foo(f: (x: T) => T) { + return f; +} + +function bar(f: (x: T) => T) { + return f; +} + +let f = foo(x => x); +let fResult = f("foo"); + +let g = foo((x => x)); +let gResult = g("foo"); + +let h = bar(x => x); +let hResult = h("foo"); +hResult = h("bar"); + +//// [stringLiteralTypesAsTypeParameterConstraint01.js] +function foo(f) { + return f; +} +function bar(f) { + return f; +} +var f = foo(function (x) { return x; }); +var fResult = f("foo"); +var g = foo((function (x) { return x; })); +var gResult = g("foo"); +var h = bar(function (x) { return x; }); +var hResult = h("foo"); +hResult = h("bar"); + + +//// [stringLiteralTypesAsTypeParameterConstraint01.d.ts] +declare function foo(f: (x: T) => T): (x: T) => T; +declare function bar(f: (x: T) => T): (x: T) => T; +declare let f: (x: "foo") => "foo"; +declare let fResult: "foo"; +declare let g: (x: "foo") => "foo"; +declare let gResult: "foo"; +declare let h: (x: "foo" | "bar") => "foo" | "bar"; +declare let hResult: "foo" | "bar"; + + +//// [DtsFileErrors] + + +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.d.ts(3,16): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.d.ts(5,16): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.d.ts (2 errors) ==== + declare function foo(f: (x: T) => T): (x: T) => T; + declare function bar(f: (x: T) => T): (x: T) => T; + declare let f: (x: "foo") => "foo"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + declare let fResult: "foo"; + declare let g: (x: "foo") => "foo"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + declare let gResult: "foo"; + declare let h: (x: "foo" | "bar") => "foo" | "bar"; + declare let hResult: "foo" | "bar"; + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.symbols b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.symbols new file mode 100644 index 00000000000..fd633b6e4d9 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts === + +function foo(f: (x: T) => T) { +>foo : Symbol(foo, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 0, 0)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 13)) +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 30)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 34)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 13)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 13)) + + return f; +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 1, 30)) +} + +function bar(f: (x: T) => T) { +>bar : Symbol(bar, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 3, 1)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 13)) +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 38)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 42)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 13)) +>T : Symbol(T, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 13)) + + return f; +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 5, 38)) +} + +let f = foo(x => x); +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 9, 3)) +>foo : Symbol(foo, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 0, 0)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 9, 12)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 9, 12)) + +let fResult = f("foo"); +>fResult : Symbol(fResult, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 10, 3)) +>f : Symbol(f, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 9, 3)) + +let g = foo((x => x)); +>g : Symbol(g, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 12, 3)) +>foo : Symbol(foo, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 0, 0)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 12, 13)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 12, 13)) + +let gResult = g("foo"); +>gResult : Symbol(gResult, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 13, 3)) +>g : Symbol(g, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 12, 3)) + +let h = bar(x => x); +>h : Symbol(h, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 15, 3)) +>bar : Symbol(bar, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 3, 1)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 15, 12)) +>x : Symbol(x, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 15, 12)) + +let hResult = h("foo"); +>hResult : Symbol(hResult, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 16, 3)) +>h : Symbol(h, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 15, 3)) + +hResult = h("bar"); +>hResult : Symbol(hResult, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 16, 3)) +>h : Symbol(h, Decl(stringLiteralTypesAsTypeParameterConstraint01.ts, 15, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types new file mode 100644 index 00000000000..fe9163fc819 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types @@ -0,0 +1,76 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts === + +function foo(f: (x: T) => T) { +>foo : (f: (x: T) => T) => (x: T) => T +>T : T +>f : (x: T) => T +>x : T +>T : T +>T : T + + return f; +>f : (x: T) => T +} + +function bar(f: (x: T) => T) { +>bar : (f: (x: T) => T) => (x: T) => T +>T : T +>f : (x: T) => T +>x : T +>T : T +>T : T + + return f; +>f : (x: T) => T +} + +let f = foo(x => x); +>f : (x: "foo") => "foo" +>foo(x => x) : (x: "foo") => "foo" +>foo : (f: (x: T) => T) => (x: T) => T +>x => x : (x: "foo") => "foo" +>x : "foo" +>x : "foo" + +let fResult = f("foo"); +>fResult : "foo" +>f("foo") : "foo" +>f : (x: "foo") => "foo" +>"foo" : "foo" + +let g = foo((x => x)); +>g : (x: "foo") => "foo" +>foo((x => x)) : (x: "foo") => "foo" +>foo : (f: (x: T) => T) => (x: T) => T +>(x => x) : (x: "foo") => "foo" +>x => x : (x: "foo") => "foo" +>x : "foo" +>x : "foo" + +let gResult = g("foo"); +>gResult : "foo" +>g("foo") : "foo" +>g : (x: "foo") => "foo" +>"foo" : "foo" + +let h = bar(x => x); +>h : (x: "foo" | "bar") => "foo" | "bar" +>bar(x => x) : (x: "foo" | "bar") => "foo" | "bar" +>bar : (f: (x: T) => T) => (x: T) => T +>x => x : (x: "foo" | "bar") => "foo" | "bar" +>x : "foo" | "bar" +>x : "foo" | "bar" + +let hResult = h("foo"); +>hResult : "foo" | "bar" +>h("foo") : "foo" | "bar" +>h : (x: "foo" | "bar") => "foo" | "bar" +>"foo" : "foo" + +hResult = h("bar"); +>hResult = h("bar") : "foo" | "bar" +>hResult : "foo" | "bar" +>h("bar") : "foo" | "bar" +>h : (x: "foo" | "bar") => "foo" | "bar" +>"bar" : "bar" + diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt new file mode 100644 index 00000000000..ed6450ad329 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts(6,13): error TS2345: Argument of type '(y: "foo" | "bar") => string' is not assignable to parameter of type '(x: "foo") => "foo"'. + Type 'string' is not assignable to type '"foo"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts (1 errors) ==== + + function foo(f: (x: T) => T) { + return f; + } + + let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(y: "foo" | "bar") => string' is not assignable to parameter of type '(x: "foo") => "foo"'. +!!! error TS2345: Type 'string' is not assignable to type '"foo"'. + let fResult = f("foo"); \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js new file mode 100644 index 00000000000..c024ac6bc43 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js @@ -0,0 +1,21 @@ +//// [stringLiteralTypesAsTypeParameterConstraint02.ts] + +function foo(f: (x: T) => T) { + return f; +} + +let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); +let fResult = f("foo"); + +//// [stringLiteralTypesAsTypeParameterConstraint02.js] +function foo(f) { + return f; +} +var f = foo(function (y) { return y === "foo" ? y : "foo"; }); +var fResult = f("foo"); + + +//// [stringLiteralTypesAsTypeParameterConstraint02.d.ts] +declare function foo(f: (x: T) => T): (x: T) => T; +declare let f: any; +declare let fResult: any; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.js b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.js new file mode 100644 index 00000000000..d970310d68e --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.js @@ -0,0 +1,44 @@ +//// [stringLiteralTypesInUnionTypes01.ts] + +type T = "foo" | "bar" | "baz"; + +var x: "foo" | "bar" | "baz" = "foo"; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; + +//// [stringLiteralTypesInUnionTypes01.js] +var x = "foo"; +var y = "bar"; +if (x === "foo") { + var a = x; +} +else if (x !== "bar") { + var b = x || y; +} +else { + var c = x; + var d = y; + var e = c || d; +} +x = y; +y = x; + + +//// [stringLiteralTypesInUnionTypes01.d.ts] +declare type T = "foo" | "bar" | "baz"; +declare var x: "foo" | "bar" | "baz"; +declare var y: T; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.symbols b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.symbols new file mode 100644 index 00000000000..c608929383e --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts === + +type T = "foo" | "bar" | "baz"; +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes01.ts, 0, 0)) + +var x: "foo" | "bar" | "baz" = "foo"; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) + +var y: T = "bar"; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes01.ts, 0, 0)) + +if (x === "foo") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) + + let a = x; +>a : Symbol(a, Decl(stringLiteralTypesInUnionTypes01.ts, 7, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) +} +else if (x !== "bar") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) + + let b = x || y; +>b : Symbol(b, Decl(stringLiteralTypesInUnionTypes01.ts, 10, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) +} +else { + let c = x; +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes01.ts, 13, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) + + let d = y; +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes01.ts, 14, 7)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) + + let e: (typeof x) | (typeof y) = c || d; +>e : Symbol(e, Decl(stringLiteralTypesInUnionTypes01.ts, 15, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes01.ts, 13, 7)) +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes01.ts, 14, 7)) +} + +x = y; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) + +y = x; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes01.ts, 4, 3)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes01.ts, 3, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types new file mode 100644 index 00000000000..e5ff509822b --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts === + +type T = "foo" | "bar" | "baz"; +>T : "foo" | "bar" | "baz" + +var x: "foo" | "bar" | "baz" = "foo"; +>x : "foo" | "bar" | "baz" +>"foo" : "foo" + +var y: T = "bar"; +>y : "foo" | "bar" | "baz" +>T : "foo" | "bar" | "baz" +>"bar" : "bar" + +if (x === "foo") { +>x === "foo" : boolean +>x : "foo" | "bar" | "baz" +>"foo" : string + + let a = x; +>a : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" +} +else if (x !== "bar") { +>x !== "bar" : boolean +>x : "foo" | "bar" | "baz" +>"bar" : string + + let b = x || y; +>b : "foo" | "bar" | "baz" +>x || y : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" +>y : "foo" | "bar" | "baz" +} +else { + let c = x; +>c : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" + + let d = y; +>d : "foo" | "bar" | "baz" +>y : "foo" | "bar" | "baz" + + let e: (typeof x) | (typeof y) = c || d; +>e : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" +>y : "foo" | "bar" | "baz" +>c || d : "foo" | "bar" | "baz" +>c : "foo" | "bar" | "baz" +>d : "foo" | "bar" | "baz" +} + +x = y; +>x = y : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" +>y : "foo" | "bar" | "baz" + +y = x; +>y = x : "foo" | "bar" | "baz" +>y : "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.js b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.js new file mode 100644 index 00000000000..19b9c837c9d --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.js @@ -0,0 +1,44 @@ +//// [stringLiteralTypesInUnionTypes02.ts] + +type T = string | "foo" | "bar" | "baz"; + +var x: "foo" | "bar" | "baz" | string = "foo"; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; + +//// [stringLiteralTypesInUnionTypes02.js] +var x = "foo"; +var y = "bar"; +if (x === "foo") { + var a = x; +} +else if (x !== "bar") { + var b = x || y; +} +else { + var c = x; + var d = y; + var e = c || d; +} +x = y; +y = x; + + +//// [stringLiteralTypesInUnionTypes02.d.ts] +declare type T = string | "foo" | "bar" | "baz"; +declare var x: "foo" | "bar" | "baz" | string; +declare var y: T; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.symbols b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.symbols new file mode 100644 index 00000000000..c9b31dc710a --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts === + +type T = string | "foo" | "bar" | "baz"; +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes02.ts, 0, 0)) + +var x: "foo" | "bar" | "baz" | string = "foo"; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) + +var y: T = "bar"; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes02.ts, 0, 0)) + +if (x === "foo") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) + + let a = x; +>a : Symbol(a, Decl(stringLiteralTypesInUnionTypes02.ts, 7, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) +} +else if (x !== "bar") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) + + let b = x || y; +>b : Symbol(b, Decl(stringLiteralTypesInUnionTypes02.ts, 10, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) +} +else { + let c = x; +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes02.ts, 13, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) + + let d = y; +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes02.ts, 14, 7)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) + + let e: (typeof x) | (typeof y) = c || d; +>e : Symbol(e, Decl(stringLiteralTypesInUnionTypes02.ts, 15, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes02.ts, 13, 7)) +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes02.ts, 14, 7)) +} + +x = y; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) + +y = x; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 4, 3)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types new file mode 100644 index 00000000000..b468c620376 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts === + +type T = string | "foo" | "bar" | "baz"; +>T : string | "foo" | "bar" | "baz" + +var x: "foo" | "bar" | "baz" | string = "foo"; +>x : "foo" | "bar" | "baz" | string +>"foo" : "foo" + +var y: T = "bar"; +>y : string | "foo" | "bar" | "baz" +>T : string | "foo" | "bar" | "baz" +>"bar" : "bar" + +if (x === "foo") { +>x === "foo" : boolean +>x : "foo" | "bar" | "baz" | string +>"foo" : string + + let a = x; +>a : "foo" | "bar" | "baz" | string +>x : "foo" | "bar" | "baz" | string +} +else if (x !== "bar") { +>x !== "bar" : boolean +>x : "foo" | "bar" | "baz" | string +>"bar" : string + + let b = x || y; +>b : string +>x || y : string +>x : "foo" | "bar" | "baz" | string +>y : string | "foo" | "bar" | "baz" +} +else { + let c = x; +>c : "foo" | "bar" | "baz" | string +>x : "foo" | "bar" | "baz" | string + + let d = y; +>d : string | "foo" | "bar" | "baz" +>y : string | "foo" | "bar" | "baz" + + let e: (typeof x) | (typeof y) = c || d; +>e : "foo" | "bar" | "baz" | string +>x : "foo" | "bar" | "baz" | string +>y : string | "foo" | "bar" | "baz" +>c || d : string +>c : "foo" | "bar" | "baz" | string +>d : string | "foo" | "bar" | "baz" +} + +x = y; +>x = y : string | "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" | string +>y : string | "foo" | "bar" | "baz" + +y = x; +>y = x : "foo" | "bar" | "baz" | string +>y : string | "foo" | "bar" | "baz" +>x : "foo" | "bar" | "baz" | string + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.js b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.js new file mode 100644 index 00000000000..f6728e0b2fb --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.js @@ -0,0 +1,44 @@ +//// [stringLiteralTypesInUnionTypes03.ts] + +type T = number | "foo" | "bar"; + +var x: "foo" | "bar" | number; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; + +//// [stringLiteralTypesInUnionTypes03.js] +var x; +var y = "bar"; +if (x === "foo") { + var a = x; +} +else if (x !== "bar") { + var b = x || y; +} +else { + var c = x; + var d = y; + var e = c || d; +} +x = y; +y = x; + + +//// [stringLiteralTypesInUnionTypes03.d.ts] +declare type T = number | "foo" | "bar"; +declare var x: "foo" | "bar" | number; +declare var y: T; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.symbols b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.symbols new file mode 100644 index 00000000000..df5498d9a59 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts === + +type T = number | "foo" | "bar"; +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes03.ts, 0, 0)) + +var x: "foo" | "bar" | number; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) + +var y: T = "bar"; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes03.ts, 0, 0)) + +if (x === "foo") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) + + let a = x; +>a : Symbol(a, Decl(stringLiteralTypesInUnionTypes03.ts, 7, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) +} +else if (x !== "bar") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) + + let b = x || y; +>b : Symbol(b, Decl(stringLiteralTypesInUnionTypes03.ts, 10, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) +} +else { + let c = x; +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes03.ts, 13, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) + + let d = y; +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes03.ts, 14, 7)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) + + let e: (typeof x) | (typeof y) = c || d; +>e : Symbol(e, Decl(stringLiteralTypesInUnionTypes03.ts, 15, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes03.ts, 13, 7)) +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes03.ts, 14, 7)) +} + +x = y; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) + +y = x; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes03.ts, 4, 3)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes03.ts, 3, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types new file mode 100644 index 00000000000..5fca6e69be9 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts === + +type T = number | "foo" | "bar"; +>T : number | "foo" | "bar" + +var x: "foo" | "bar" | number; +>x : "foo" | "bar" | number + +var y: T = "bar"; +>y : number | "foo" | "bar" +>T : number | "foo" | "bar" +>"bar" : "bar" + +if (x === "foo") { +>x === "foo" : boolean +>x : "foo" | "bar" | number +>"foo" : string + + let a = x; +>a : "foo" | "bar" | number +>x : "foo" | "bar" | number +} +else if (x !== "bar") { +>x !== "bar" : boolean +>x : "foo" | "bar" | number +>"bar" : string + + let b = x || y; +>b : "foo" | "bar" | number +>x || y : "foo" | "bar" | number +>x : "foo" | "bar" | number +>y : number | "foo" | "bar" +} +else { + let c = x; +>c : "foo" | "bar" | number +>x : "foo" | "bar" | number + + let d = y; +>d : number | "foo" | "bar" +>y : number | "foo" | "bar" + + let e: (typeof x) | (typeof y) = c || d; +>e : "foo" | "bar" | number +>x : "foo" | "bar" | number +>y : number | "foo" | "bar" +>c || d : "foo" | "bar" | number +>c : "foo" | "bar" | number +>d : number | "foo" | "bar" +} + +x = y; +>x = y : number | "foo" | "bar" +>x : "foo" | "bar" | number +>y : number | "foo" | "bar" + +y = x; +>y = x : "foo" | "bar" | number +>y : number | "foo" | "bar" +>x : "foo" | "bar" | number + diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.js b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.js new file mode 100644 index 00000000000..dc6cf51ad1e --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.js @@ -0,0 +1,72 @@ +//// [stringLiteralTypesInUnionTypes04.ts] + +type T = "" | "foo"; + +let x: T = ""; +let y: T = "foo"; + +if (x === "") { + let a = x; +} + +if (x !== "") { + let b = x; +} + +if (x == "") { + let c = x; +} + +if (x != "") { + let d = x; +} + +if (x) { + let e = x; +} + +if (!x) { + let f = x; +} + +if (!!x) { + let g = x; +} + +if (!!!x) { + let h = x; +} + +//// [stringLiteralTypesInUnionTypes04.js] +var x = ""; +var y = "foo"; +if (x === "") { + var a = x; +} +if (x !== "") { + var b = x; +} +if (x == "") { + var c = x; +} +if (x != "") { + var d = x; +} +if (x) { + var e = x; +} +if (!x) { + var f = x; +} +if (!!x) { + var g = x; +} +if (!!!x) { + var h = x; +} + + +//// [stringLiteralTypesInUnionTypes04.d.ts] +declare type T = "" | "foo"; +declare let x: T; +declare let y: T; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.symbols b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.symbols new file mode 100644 index 00000000000..ced93fcefc9 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts === + +type T = "" | "foo"; +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes04.ts, 0, 0)) + +let x: T = ""; +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes04.ts, 0, 0)) + +let y: T = "foo"; +>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes04.ts, 4, 3)) +>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes04.ts, 0, 0)) + +if (x === "") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let a = x; +>a : Symbol(a, Decl(stringLiteralTypesInUnionTypes04.ts, 7, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (x !== "") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let b = x; +>b : Symbol(b, Decl(stringLiteralTypesInUnionTypes04.ts, 11, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (x == "") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let c = x; +>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes04.ts, 15, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (x != "") { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let d = x; +>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes04.ts, 19, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (x) { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let e = x; +>e : Symbol(e, Decl(stringLiteralTypesInUnionTypes04.ts, 23, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (!x) { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let f = x; +>f : Symbol(f, Decl(stringLiteralTypesInUnionTypes04.ts, 27, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (!!x) { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let g = x; +>g : Symbol(g, Decl(stringLiteralTypesInUnionTypes04.ts, 31, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} + +if (!!!x) { +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) + + let h = x; +>h : Symbol(h, Decl(stringLiteralTypesInUnionTypes04.ts, 35, 7)) +>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes04.ts, 3, 3)) +} diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types new file mode 100644 index 00000000000..ad92dc360d0 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts === + +type T = "" | "foo"; +>T : "" | "foo" + +let x: T = ""; +>x : "" | "foo" +>T : "" | "foo" +>"" : "" + +let y: T = "foo"; +>y : "" | "foo" +>T : "" | "foo" +>"foo" : "foo" + +if (x === "") { +>x === "" : boolean +>x : "" | "foo" +>"" : string + + let a = x; +>a : "" | "foo" +>x : "" | "foo" +} + +if (x !== "") { +>x !== "" : boolean +>x : "" | "foo" +>"" : string + + let b = x; +>b : "" | "foo" +>x : "" | "foo" +} + +if (x == "") { +>x == "" : boolean +>x : "" | "foo" +>"" : string + + let c = x; +>c : "" | "foo" +>x : "" | "foo" +} + +if (x != "") { +>x != "" : boolean +>x : "" | "foo" +>"" : string + + let d = x; +>d : "" | "foo" +>x : "" | "foo" +} + +if (x) { +>x : "" | "foo" + + let e = x; +>e : "" | "foo" +>x : "" | "foo" +} + +if (!x) { +>!x : boolean +>x : "" | "foo" + + let f = x; +>f : "" | "foo" +>x : "" | "foo" +} + +if (!!x) { +>!!x : boolean +>!x : boolean +>x : "" | "foo" + + let g = x; +>g : "" | "foo" +>x : "" | "foo" +} + +if (!!!x) { +>!!!x : boolean +>!!x : boolean +>!x : boolean +>x : "" | "foo" + + let h = x; +>h : "" | "foo" +>x : "" | "foo" +} diff --git a/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.errors.txt b/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.errors.txt new file mode 100644 index 00000000000..1a639a1c222 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts(5,7): error TS1155: 'const' declarations must be initialized + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts (1 errors) ==== + + let a: ""; + var b: "foo"; + let c: "bar"; + const d: "baz"; + ~ +!!! error TS1155: 'const' declarations must be initialized + + a = ""; + b = "foo"; + c = "bar"; + + let e: "" = ""; + var f: "foo" = "foo"; + let g: "bar" = "bar"; + const h: "baz" = "baz"; + + e = ""; + f = "foo"; + g = "bar"; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.js b/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.js new file mode 100644 index 00000000000..15a4ca5d580 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInVariableDeclarations01.js @@ -0,0 +1,46 @@ +//// [stringLiteralTypesInVariableDeclarations01.ts] + +let a: ""; +var b: "foo"; +let c: "bar"; +const d: "baz"; + +a = ""; +b = "foo"; +c = "bar"; + +let e: "" = ""; +var f: "foo" = "foo"; +let g: "bar" = "bar"; +const h: "baz" = "baz"; + +e = ""; +f = "foo"; +g = "bar"; + +//// [stringLiteralTypesInVariableDeclarations01.js] +var a; +var b; +var c; +var d; +a = ""; +b = "foo"; +c = "bar"; +var e = ""; +var f = "foo"; +var g = "bar"; +var h = "baz"; +e = ""; +f = "foo"; +g = "bar"; + + +//// [stringLiteralTypesInVariableDeclarations01.d.ts] +declare let a: ""; +declare var b: "foo"; +declare let c: "bar"; +declare const d: "baz"; +declare let e: ""; +declare var f: "foo"; +declare let g: "bar"; +declare const h: "baz"; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloads01.errors.txt new file mode 100644 index 00000000000..1592427208b --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(11,10): error TS2354: No best common type exists among return expressions. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts (1 errors) ==== + + type PrimitiveName = 'string' | 'number' | 'boolean'; + + function getFalsyPrimitive(x: "string"): string; + function getFalsyPrimitive(x: "number"): number; + function getFalsyPrimitive(x: "boolean"): boolean; + function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; + function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; + function getFalsyPrimitive(x: "number" | "string"): number | string; + function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; + function getFalsyPrimitive(x: PrimitiveName) { + ~~~~~~~~~~~~~~~~~ +!!! error TS2354: No best common type exists among return expressions. + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; + } + + namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); + } + + const string: "string" = "string" + const number: "number" = "number" + const boolean: "boolean" = "boolean" + + const stringOrNumber = string || number; + const stringOrBoolean = string || boolean; + const booleanOrNumber = number || boolean; + const stringOrBooleanOrNumber = stringOrBoolean || number; + + namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.js b/tests/baselines/reference/stringLiteralTypesOverloads01.js new file mode 100644 index 00000000000..73dabd26fab --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.js @@ -0,0 +1,114 @@ +//// [stringLiteralTypesOverloads01.ts] + +type PrimitiveName = 'string' | 'number' | 'boolean'; + +function getFalsyPrimitive(x: "string"): string; +function getFalsyPrimitive(x: "number"): number; +function getFalsyPrimitive(x: "boolean"): boolean; +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +function getFalsyPrimitive(x: "number" | "string"): number | string; +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +function getFalsyPrimitive(x: PrimitiveName) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); +} + +const string: "string" = "string" +const number: "number" = "number" +const boolean: "boolean" = "boolean" + +const stringOrNumber = string || number; +const stringOrBoolean = string || boolean; +const booleanOrNumber = number || boolean; +const stringOrBooleanOrNumber = stringOrBoolean || number; + +namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +} + + + + +//// [stringLiteralTypesOverloads01.js] +function getFalsyPrimitive(x) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + // Should be unreachable. + throw "Invalid value"; +} +var Consts1; +(function (Consts1) { + var EMPTY_STRING = getFalsyPrimitive("string"); + var ZERO = getFalsyPrimitive('number'); + var FALSE = getFalsyPrimitive("boolean"); +})(Consts1 || (Consts1 = {})); +var string = "string"; +var number = "number"; +var boolean = "boolean"; +var stringOrNumber = string || number; +var stringOrBoolean = string || boolean; +var booleanOrNumber = number || boolean; +var stringOrBooleanOrNumber = stringOrBoolean || number; +var Consts2; +(function (Consts2) { + var EMPTY_STRING = getFalsyPrimitive(string); + var ZERO = getFalsyPrimitive(number); + var FALSE = getFalsyPrimitive(boolean); + var a = getFalsyPrimitive(stringOrNumber); + var b = getFalsyPrimitive(stringOrBoolean); + var c = getFalsyPrimitive(booleanOrNumber); + var d = getFalsyPrimitive(stringOrBooleanOrNumber); +})(Consts2 || (Consts2 = {})); + + +//// [stringLiteralTypesOverloads01.d.ts] +declare type PrimitiveName = 'string' | 'number' | 'boolean'; +declare function getFalsyPrimitive(x: "string"): string; +declare function getFalsyPrimitive(x: "number"): number; +declare function getFalsyPrimitive(x: "boolean"): boolean; +declare function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +declare function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +declare function getFalsyPrimitive(x: "number" | "string"): number | string; +declare function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +declare namespace Consts1 { +} +declare const string: "string"; +declare const number: "number"; +declare const boolean: "boolean"; +declare const stringOrNumber: "string" | "number"; +declare const stringOrBoolean: "string" | "boolean"; +declare const booleanOrNumber: "number" | "boolean"; +declare const stringOrBooleanOrNumber: "string" | "boolean" | "number"; +declare namespace Consts2 { +} diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt new file mode 100644 index 00000000000..995cf687b70 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts(9,10): error TS2354: No best common type exists among return expressions. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts (1 errors) ==== + + function getFalsyPrimitive(x: "string"): string; + function getFalsyPrimitive(x: "number"): number; + function getFalsyPrimitive(x: "boolean"): boolean; + function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; + function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; + function getFalsyPrimitive(x: "number" | "string"): number | string; + function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; + function getFalsyPrimitive(x: string) { + ~~~~~~~~~~~~~~~~~ +!!! error TS2354: No best common type exists among return expressions. + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; + } + + namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); + } + + const string: "string" = "string" + const number: "number" = "number" + const boolean: "boolean" = "boolean" + + const stringOrNumber = string || number; + const stringOrBoolean = string || boolean; + const booleanOrNumber = number || boolean; + const stringOrBooleanOrNumber = stringOrBoolean || number; + + namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.js b/tests/baselines/reference/stringLiteralTypesOverloads02.js new file mode 100644 index 00000000000..3c53f9380a8 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.js @@ -0,0 +1,111 @@ +//// [stringLiteralTypesOverloads02.ts] + +function getFalsyPrimitive(x: "string"): string; +function getFalsyPrimitive(x: "number"): number; +function getFalsyPrimitive(x: "boolean"): boolean; +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +function getFalsyPrimitive(x: "number" | "string"): number | string; +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +function getFalsyPrimitive(x: string) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); +} + +const string: "string" = "string" +const number: "number" = "number" +const boolean: "boolean" = "boolean" + +const stringOrNumber = string || number; +const stringOrBoolean = string || boolean; +const booleanOrNumber = number || boolean; +const stringOrBooleanOrNumber = stringOrBoolean || number; + +namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +} + + + + +//// [stringLiteralTypesOverloads02.js] +function getFalsyPrimitive(x) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + // Should be unreachable. + throw "Invalid value"; +} +var Consts1; +(function (Consts1) { + var EMPTY_STRING = getFalsyPrimitive("string"); + var ZERO = getFalsyPrimitive('number'); + var FALSE = getFalsyPrimitive("boolean"); +})(Consts1 || (Consts1 = {})); +var string = "string"; +var number = "number"; +var boolean = "boolean"; +var stringOrNumber = string || number; +var stringOrBoolean = string || boolean; +var booleanOrNumber = number || boolean; +var stringOrBooleanOrNumber = stringOrBoolean || number; +var Consts2; +(function (Consts2) { + var EMPTY_STRING = getFalsyPrimitive(string); + var ZERO = getFalsyPrimitive(number); + var FALSE = getFalsyPrimitive(boolean); + var a = getFalsyPrimitive(stringOrNumber); + var b = getFalsyPrimitive(stringOrBoolean); + var c = getFalsyPrimitive(booleanOrNumber); + var d = getFalsyPrimitive(stringOrBooleanOrNumber); +})(Consts2 || (Consts2 = {})); + + +//// [stringLiteralTypesOverloads02.d.ts] +declare function getFalsyPrimitive(x: "string"): string; +declare function getFalsyPrimitive(x: "number"): number; +declare function getFalsyPrimitive(x: "boolean"): boolean; +declare function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +declare function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +declare function getFalsyPrimitive(x: "number" | "string"): number | string; +declare function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +declare namespace Consts1 { +} +declare const string: "string"; +declare const number: "number"; +declare const boolean: "boolean"; +declare const stringOrNumber: "string" | "number"; +declare const stringOrBoolean: "string" | "boolean"; +declare const booleanOrNumber: "number" | "boolean"; +declare const stringOrBooleanOrNumber: "string" | "boolean" | "number"; +declare namespace Consts2 { +} diff --git a/tests/baselines/reference/stringLiteralTypesOverloads03.js b/tests/baselines/reference/stringLiteralTypesOverloads03.js new file mode 100644 index 00000000000..c1e79160880 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads03.js @@ -0,0 +1,104 @@ +//// [stringLiteralTypesOverloads03.ts] + +interface Base { + x: string; + y: number; +} + +interface HelloOrWorld extends Base { + p1: boolean; +} + +interface JustHello extends Base { + p2: boolean; +} + +interface JustWorld extends Base { + p3: boolean; +} + +let hello: "hello"; +let world: "world"; +let helloOrWorld: "hello" | "world"; + +function f(p: "hello"): JustHello; +function f(p: "hello" | "world"): HelloOrWorld; +function f(p: "world"): JustWorld; +function f(p: string): Base; +function f(...args: any[]): any { + return undefined; +} + +let fResult1 = f(hello); +let fResult2 = f(world); +let fResult3 = f(helloOrWorld); + +function g(p: string): Base; +function g(p: "hello"): JustHello; +function g(p: "hello" | "world"): HelloOrWorld; +function g(p: "world"): JustWorld; +function g(...args: any[]): any { + return undefined; +} + +let gResult1 = g(hello); +let gResult2 = g(world); +let gResult3 = g(helloOrWorld); + +//// [stringLiteralTypesOverloads03.js] +var hello; +var world; +var helloOrWorld; +function f() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return undefined; +} +var fResult1 = f(hello); +var fResult2 = f(world); +var fResult3 = f(helloOrWorld); +function g() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return undefined; +} +var gResult1 = g(hello); +var gResult2 = g(world); +var gResult3 = g(helloOrWorld); + + +//// [stringLiteralTypesOverloads03.d.ts] +interface Base { + x: string; + y: number; +} +interface HelloOrWorld extends Base { + p1: boolean; +} +interface JustHello extends Base { + p2: boolean; +} +interface JustWorld extends Base { + p3: boolean; +} +declare let hello: "hello"; +declare let world: "world"; +declare let helloOrWorld: "hello" | "world"; +declare function f(p: "hello"): JustHello; +declare function f(p: "hello" | "world"): HelloOrWorld; +declare function f(p: "world"): JustWorld; +declare function f(p: string): Base; +declare let fResult1: JustHello; +declare let fResult2: JustWorld; +declare let fResult3: HelloOrWorld; +declare function g(p: string): Base; +declare function g(p: "hello"): JustHello; +declare function g(p: "hello" | "world"): HelloOrWorld; +declare function g(p: "world"): JustWorld; +declare let gResult1: JustHello; +declare let gResult2: JustWorld; +declare let gResult3: Base; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads03.symbols b/tests/baselines/reference/stringLiteralTypesOverloads03.symbols new file mode 100644 index 00000000000..a0a48de790f --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads03.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads03.ts === + +interface Base { +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(stringLiteralTypesOverloads03.ts, 1, 16)) + + y: number; +>y : Symbol(y, Decl(stringLiteralTypesOverloads03.ts, 2, 14)) +} + +interface HelloOrWorld extends Base { +>HelloOrWorld : Symbol(HelloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 4, 1)) +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + + p1: boolean; +>p1 : Symbol(p1, Decl(stringLiteralTypesOverloads03.ts, 6, 37)) +} + +interface JustHello extends Base { +>JustHello : Symbol(JustHello, Decl(stringLiteralTypesOverloads03.ts, 8, 1)) +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + + p2: boolean; +>p2 : Symbol(p2, Decl(stringLiteralTypesOverloads03.ts, 10, 34)) +} + +interface JustWorld extends Base { +>JustWorld : Symbol(JustWorld, Decl(stringLiteralTypesOverloads03.ts, 12, 1)) +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + + p3: boolean; +>p3 : Symbol(p3, Decl(stringLiteralTypesOverloads03.ts, 14, 34)) +} + +let hello: "hello"; +>hello : Symbol(hello, Decl(stringLiteralTypesOverloads03.ts, 18, 3)) + +let world: "world"; +>world : Symbol(world, Decl(stringLiteralTypesOverloads03.ts, 19, 3)) + +let helloOrWorld: "hello" | "world"; +>helloOrWorld : Symbol(helloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 20, 3)) + +function f(p: "hello"): JustHello; +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 22, 11)) +>JustHello : Symbol(JustHello, Decl(stringLiteralTypesOverloads03.ts, 8, 1)) + +function f(p: "hello" | "world"): HelloOrWorld; +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 23, 11)) +>HelloOrWorld : Symbol(HelloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 4, 1)) + +function f(p: "world"): JustWorld; +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 24, 11)) +>JustWorld : Symbol(JustWorld, Decl(stringLiteralTypesOverloads03.ts, 12, 1)) + +function f(p: string): Base; +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 25, 11)) +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + +function f(...args: any[]): any { +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>args : Symbol(args, Decl(stringLiteralTypesOverloads03.ts, 26, 11)) + + return undefined; +>undefined : Symbol(undefined) +} + +let fResult1 = f(hello); +>fResult1 : Symbol(fResult1, Decl(stringLiteralTypesOverloads03.ts, 30, 3)) +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>hello : Symbol(hello, Decl(stringLiteralTypesOverloads03.ts, 18, 3)) + +let fResult2 = f(world); +>fResult2 : Symbol(fResult2, Decl(stringLiteralTypesOverloads03.ts, 31, 3)) +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>world : Symbol(world, Decl(stringLiteralTypesOverloads03.ts, 19, 3)) + +let fResult3 = f(helloOrWorld); +>fResult3 : Symbol(fResult3, Decl(stringLiteralTypesOverloads03.ts, 32, 3)) +>f : Symbol(f, Decl(stringLiteralTypesOverloads03.ts, 20, 36), Decl(stringLiteralTypesOverloads03.ts, 22, 34), Decl(stringLiteralTypesOverloads03.ts, 23, 47), Decl(stringLiteralTypesOverloads03.ts, 24, 34), Decl(stringLiteralTypesOverloads03.ts, 25, 28)) +>helloOrWorld : Symbol(helloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 20, 3)) + +function g(p: string): Base; +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 34, 11)) +>Base : Symbol(Base, Decl(stringLiteralTypesOverloads03.ts, 0, 0)) + +function g(p: "hello"): JustHello; +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 35, 11)) +>JustHello : Symbol(JustHello, Decl(stringLiteralTypesOverloads03.ts, 8, 1)) + +function g(p: "hello" | "world"): HelloOrWorld; +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 36, 11)) +>HelloOrWorld : Symbol(HelloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 4, 1)) + +function g(p: "world"): JustWorld; +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads03.ts, 37, 11)) +>JustWorld : Symbol(JustWorld, Decl(stringLiteralTypesOverloads03.ts, 12, 1)) + +function g(...args: any[]): any { +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>args : Symbol(args, Decl(stringLiteralTypesOverloads03.ts, 38, 11)) + + return undefined; +>undefined : Symbol(undefined) +} + +let gResult1 = g(hello); +>gResult1 : Symbol(gResult1, Decl(stringLiteralTypesOverloads03.ts, 42, 3)) +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>hello : Symbol(hello, Decl(stringLiteralTypesOverloads03.ts, 18, 3)) + +let gResult2 = g(world); +>gResult2 : Symbol(gResult2, Decl(stringLiteralTypesOverloads03.ts, 43, 3)) +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>world : Symbol(world, Decl(stringLiteralTypesOverloads03.ts, 19, 3)) + +let gResult3 = g(helloOrWorld); +>gResult3 : Symbol(gResult3, Decl(stringLiteralTypesOverloads03.ts, 44, 3)) +>g : Symbol(g, Decl(stringLiteralTypesOverloads03.ts, 32, 31), Decl(stringLiteralTypesOverloads03.ts, 34, 28), Decl(stringLiteralTypesOverloads03.ts, 35, 34), Decl(stringLiteralTypesOverloads03.ts, 36, 47), Decl(stringLiteralTypesOverloads03.ts, 37, 34)) +>helloOrWorld : Symbol(helloOrWorld, Decl(stringLiteralTypesOverloads03.ts, 20, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads03.types b/tests/baselines/reference/stringLiteralTypesOverloads03.types new file mode 100644 index 00000000000..643979ee987 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads03.types @@ -0,0 +1,137 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads03.ts === + +interface Base { +>Base : Base + + x: string; +>x : string + + y: number; +>y : number +} + +interface HelloOrWorld extends Base { +>HelloOrWorld : HelloOrWorld +>Base : Base + + p1: boolean; +>p1 : boolean +} + +interface JustHello extends Base { +>JustHello : JustHello +>Base : Base + + p2: boolean; +>p2 : boolean +} + +interface JustWorld extends Base { +>JustWorld : JustWorld +>Base : Base + + p3: boolean; +>p3 : boolean +} + +let hello: "hello"; +>hello : "hello" + +let world: "world"; +>world : "world" + +let helloOrWorld: "hello" | "world"; +>helloOrWorld : "hello" | "world" + +function f(p: "hello"): JustHello; +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>p : "hello" +>JustHello : JustHello + +function f(p: "hello" | "world"): HelloOrWorld; +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>p : "hello" | "world" +>HelloOrWorld : HelloOrWorld + +function f(p: "world"): JustWorld; +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>p : "world" +>JustWorld : JustWorld + +function f(p: string): Base; +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>p : string +>Base : Base + +function f(...args: any[]): any { +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>args : any[] + + return undefined; +>undefined : undefined +} + +let fResult1 = f(hello); +>fResult1 : JustHello +>f(hello) : JustHello +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>hello : "hello" + +let fResult2 = f(world); +>fResult2 : JustWorld +>f(world) : JustWorld +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>world : "world" + +let fResult3 = f(helloOrWorld); +>fResult3 : HelloOrWorld +>f(helloOrWorld) : HelloOrWorld +>f : { (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; (p: string): Base; } +>helloOrWorld : "hello" | "world" + +function g(p: string): Base; +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>p : string +>Base : Base + +function g(p: "hello"): JustHello; +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>p : "hello" +>JustHello : JustHello + +function g(p: "hello" | "world"): HelloOrWorld; +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>p : "hello" | "world" +>HelloOrWorld : HelloOrWorld + +function g(p: "world"): JustWorld; +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>p : "world" +>JustWorld : JustWorld + +function g(...args: any[]): any { +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>args : any[] + + return undefined; +>undefined : undefined +} + +let gResult1 = g(hello); +>gResult1 : JustHello +>g(hello) : JustHello +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>hello : "hello" + +let gResult2 = g(world); +>gResult2 : JustWorld +>g(world) : JustWorld +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>world : "world" + +let gResult3 = g(helloOrWorld); +>gResult3 : Base +>g(helloOrWorld) : Base +>g : { (p: string): Base; (p: "hello"): JustHello; (p: "hello" | "world"): HelloOrWorld; (p: "world"): JustWorld; } +>helloOrWorld : "hello" | "world" + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.js b/tests/baselines/reference/stringLiteralTypesOverloads04.js new file mode 100644 index 00000000000..fd10ac986a9 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.js @@ -0,0 +1,18 @@ +//// [stringLiteralTypesOverloads04.ts] + +declare function f(x: (p: "foo" | "bar") => "foo"); + +f(y => { + let z = y = "foo"; + return z; +}) + +//// [stringLiteralTypesOverloads04.js] +f(function (y) { + var z = y = "foo"; + return z; +}); + + +//// [stringLiteralTypesOverloads04.d.ts] +declare function f(x: (p: "foo" | "bar") => "foo"): any; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.symbols b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols new file mode 100644 index 00000000000..9f468b8bd95 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads04.ts === + +declare function f(x: (p: "foo" | "bar") => "foo"); +>f : Symbol(f, Decl(stringLiteralTypesOverloads04.ts, 0, 0)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads04.ts, 1, 19)) +>p : Symbol(p, Decl(stringLiteralTypesOverloads04.ts, 1, 23)) + +f(y => { +>f : Symbol(f, Decl(stringLiteralTypesOverloads04.ts, 0, 0)) +>y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) + + let z = y = "foo"; +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) +>y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) + + return z; +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) + +}) diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.types b/tests/baselines/reference/stringLiteralTypesOverloads04.types new file mode 100644 index 00000000000..32d316494ca --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads04.ts === + +declare function f(x: (p: "foo" | "bar") => "foo"); +>f : (x: (p: "foo" | "bar") => "foo") => any +>x : (p: "foo" | "bar") => "foo" +>p : "foo" | "bar" + +f(y => { +>f(y => { let z = y = "foo"; return z;}) : any +>f : (x: (p: "foo" | "bar") => "foo") => any +>y => { let z = y = "foo"; return z;} : (y: "foo" | "bar") => "foo" +>y : "foo" | "bar" + + let z = y = "foo"; +>z : "foo" +>y = "foo" : "foo" +>y : "foo" | "bar" +>"foo" : "foo" + + return z; +>z : "foo" + +}) diff --git a/tests/baselines/reference/stringLiteralTypesTypePredicates01.errors.txt b/tests/baselines/reference/stringLiteralTypesTypePredicates01.errors.txt new file mode 100644 index 00000000000..b888c3ca77e --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesTypePredicates01.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts(4,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts(5,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts (2 errors) ==== + + type Kind = "A" | "B" + + function kindIs(kind: Kind, is: "A"): kind is "A"; + ~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function kindIs(kind: Kind, is: "B"): kind is "B"; + ~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function kindIs(kind: Kind, is: Kind): boolean { + return kind === is; + } + + var x: Kind = "A"; + + if (kindIs(x, "A")) { + let a = x; + } + else { + let b = x; + } + + if (!kindIs(x, "B")) { + let c = x; + } + else { + let d = x; + } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesTypePredicates01.js b/tests/baselines/reference/stringLiteralTypesTypePredicates01.js new file mode 100644 index 00000000000..fd4129d272d --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesTypePredicates01.js @@ -0,0 +1,50 @@ +//// [stringLiteralTypesTypePredicates01.ts] + +type Kind = "A" | "B" + +function kindIs(kind: Kind, is: "A"): kind is "A"; +function kindIs(kind: Kind, is: "B"): kind is "B"; +function kindIs(kind: Kind, is: Kind): boolean { + return kind === is; +} + +var x: Kind = "A"; + +if (kindIs(x, "A")) { + let a = x; +} +else { + let b = x; +} + +if (!kindIs(x, "B")) { + let c = x; +} +else { + let d = x; +} + +//// [stringLiteralTypesTypePredicates01.js] +function kindIs(kind, is) { + return kind === is; +} +var x = "A"; +if (kindIs(x, "A")) { + var a = x; +} +else { + var b = x; +} +if (!kindIs(x, "B")) { + var c = x; +} +else { + var d = x; +} + + +//// [stringLiteralTypesTypePredicates01.d.ts] +declare type Kind = "A" | "B"; +declare function kindIs(kind: Kind, is: "A"): kind is "A"; +declare function kindIs(kind: Kind, is: "B"): kind is "B"; +declare var x: Kind; diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt new file mode 100644 index 00000000000..3851a0b10ef --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(2,5): error TS2322: Type 'string' is not assignable to type '"ABC"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(3,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(6,5): error TS2322: Type 'string' is not assignable to type '"JK`L"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts (3 errors) ==== + + let ABC: "ABC" = `ABC`; + ~~~ +!!! error TS2322: Type 'string' is not assignable to type '"ABC"'. + let DE_NEWLINE_F: "DE\nF" = `DE + ~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'. + F`; + let G_QUOTE_HI: 'G"HI'; + let JK_BACKTICK_L: "JK`L" = `JK\`L`; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"JK`L"'. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.js b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.js new file mode 100644 index 00000000000..8f548afc7bf --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.js @@ -0,0 +1,20 @@ +//// [stringLiteralTypesWithTemplateStrings01.ts] + +let ABC: "ABC" = `ABC`; +let DE_NEWLINE_F: "DE\nF" = `DE +F`; +let G_QUOTE_HI: 'G"HI'; +let JK_BACKTICK_L: "JK`L" = `JK\`L`; + +//// [stringLiteralTypesWithTemplateStrings01.js] +var ABC = "ABC"; +var DE_NEWLINE_F = "DE\nF"; +var G_QUOTE_HI; +var JK_BACKTICK_L = "JK`L"; + + +//// [stringLiteralTypesWithTemplateStrings01.d.ts] +declare let ABC: "ABC"; +declare let DE_NEWLINE_F: "DE\nF"; +declare let G_QUOTE_HI: 'G"HI'; +declare let JK_BACKTICK_L: "JK`L"; diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt new file mode 100644 index 00000000000..803e4f5cb24 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(2,5): error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(4,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (2 errors) ==== + + let abc: "AB\r\nC" = `AB + ~~~ +!!! error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'. + C`; + let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; + ~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js new file mode 100644 index 00000000000..f5d9045921a --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js @@ -0,0 +1,14 @@ +//// [stringLiteralTypesWithTemplateStrings02.ts] + +let abc: "AB\r\nC" = `AB +C`; +let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; + +//// [stringLiteralTypesWithTemplateStrings02.js] +var abc = "AB\nC"; +var de_NEWLINE_f = "DE" + "\n" + "F"; + + +//// [stringLiteralTypesWithTemplateStrings02.d.ts] +declare let abc: "AB\r\nC"; +declare let de_NEWLINE_f: "DE\nF"; diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.js b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.js new file mode 100644 index 00000000000..1576540e244 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.js @@ -0,0 +1,86 @@ +//// [stringLiteralTypesWithVariousOperators01.ts] + +let abc: "ABC" = "ABC"; +let xyz: "XYZ" = "XYZ"; +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; + +let a = "" + abc; +let b = abc + ""; +let c = 10 + abc; +let d = abc + 10; +let e = xyz + abc; +let f = abc + xyz; +let g = true + abc; +let h = abc + true; +let i = abc + abcOrXyz + xyz; +let j = abcOrXyz + abcOrXyz; +let k = +abcOrXyz; +let l = -abcOrXyz; +let m = abcOrXyzOrNumber + ""; +let n = "" + abcOrXyzOrNumber; +let o = abcOrXyzOrNumber + abcOrXyz; +let p = abcOrXyz + abcOrXyzOrNumber; +let q = !abcOrXyzOrNumber; +let r = ~abcOrXyzOrNumber; +let s = abcOrXyzOrNumber < abcOrXyzOrNumber; +let t = abcOrXyzOrNumber >= abcOrXyz; +let u = abc === abcOrXyz; +let v = abcOrXyz === abcOrXyzOrNumber; + +//// [stringLiteralTypesWithVariousOperators01.js] +var abc = "ABC"; +var xyz = "XYZ"; +var abcOrXyz = abc || xyz; +var abcOrXyzOrNumber = abcOrXyz || 100; +var a = "" + abc; +var b = abc + ""; +var c = 10 + abc; +var d = abc + 10; +var e = xyz + abc; +var f = abc + xyz; +var g = true + abc; +var h = abc + true; +var i = abc + abcOrXyz + xyz; +var j = abcOrXyz + abcOrXyz; +var k = +abcOrXyz; +var l = -abcOrXyz; +var m = abcOrXyzOrNumber + ""; +var n = "" + abcOrXyzOrNumber; +var o = abcOrXyzOrNumber + abcOrXyz; +var p = abcOrXyz + abcOrXyzOrNumber; +var q = !abcOrXyzOrNumber; +var r = ~abcOrXyzOrNumber; +var s = abcOrXyzOrNumber < abcOrXyzOrNumber; +var t = abcOrXyzOrNumber >= abcOrXyz; +var u = abc === abcOrXyz; +var v = abcOrXyz === abcOrXyzOrNumber; + + +//// [stringLiteralTypesWithVariousOperators01.d.ts] +declare let abc: "ABC"; +declare let xyz: "XYZ"; +declare let abcOrXyz: "ABC" | "XYZ"; +declare let abcOrXyzOrNumber: "ABC" | "XYZ" | number; +declare let a: string; +declare let b: string; +declare let c: string; +declare let d: string; +declare let e: string; +declare let f: string; +declare let g: string; +declare let h: string; +declare let i: string; +declare let j: string; +declare let k: number; +declare let l: number; +declare let m: string; +declare let n: string; +declare let o: string; +declare let p: string; +declare let q: boolean; +declare let r: number; +declare let s: boolean; +declare let t: boolean; +declare let u: boolean; +declare let v: boolean; diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.symbols b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.symbols new file mode 100644 index 00000000000..cc9c3aa842b --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators01.ts === + +let abc: "ABC" = "ABC"; +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let xyz: "XYZ" = "XYZ"; +>xyz : Symbol(xyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 2, 3)) + +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) +>xyz : Symbol(xyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 2, 3)) + +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let a = "" + abc; +>a : Symbol(a, Decl(stringLiteralTypesWithVariousOperators01.ts, 6, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let b = abc + ""; +>b : Symbol(b, Decl(stringLiteralTypesWithVariousOperators01.ts, 7, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let c = 10 + abc; +>c : Symbol(c, Decl(stringLiteralTypesWithVariousOperators01.ts, 8, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let d = abc + 10; +>d : Symbol(d, Decl(stringLiteralTypesWithVariousOperators01.ts, 9, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let e = xyz + abc; +>e : Symbol(e, Decl(stringLiteralTypesWithVariousOperators01.ts, 10, 3)) +>xyz : Symbol(xyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 2, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let f = abc + xyz; +>f : Symbol(f, Decl(stringLiteralTypesWithVariousOperators01.ts, 11, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) +>xyz : Symbol(xyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 2, 3)) + +let g = true + abc; +>g : Symbol(g, Decl(stringLiteralTypesWithVariousOperators01.ts, 12, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let h = abc + true; +>h : Symbol(h, Decl(stringLiteralTypesWithVariousOperators01.ts, 13, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) + +let i = abc + abcOrXyz + xyz; +>i : Symbol(i, Decl(stringLiteralTypesWithVariousOperators01.ts, 14, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) +>xyz : Symbol(xyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 2, 3)) + +let j = abcOrXyz + abcOrXyz; +>j : Symbol(j, Decl(stringLiteralTypesWithVariousOperators01.ts, 15, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let k = +abcOrXyz; +>k : Symbol(k, Decl(stringLiteralTypesWithVariousOperators01.ts, 16, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let l = -abcOrXyz; +>l : Symbol(l, Decl(stringLiteralTypesWithVariousOperators01.ts, 17, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let m = abcOrXyzOrNumber + ""; +>m : Symbol(m, Decl(stringLiteralTypesWithVariousOperators01.ts, 18, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let n = "" + abcOrXyzOrNumber; +>n : Symbol(n, Decl(stringLiteralTypesWithVariousOperators01.ts, 19, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let o = abcOrXyzOrNumber + abcOrXyz; +>o : Symbol(o, Decl(stringLiteralTypesWithVariousOperators01.ts, 20, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let p = abcOrXyz + abcOrXyzOrNumber; +>p : Symbol(p, Decl(stringLiteralTypesWithVariousOperators01.ts, 21, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let q = !abcOrXyzOrNumber; +>q : Symbol(q, Decl(stringLiteralTypesWithVariousOperators01.ts, 22, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let r = ~abcOrXyzOrNumber; +>r : Symbol(r, Decl(stringLiteralTypesWithVariousOperators01.ts, 23, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let s = abcOrXyzOrNumber < abcOrXyzOrNumber; +>s : Symbol(s, Decl(stringLiteralTypesWithVariousOperators01.ts, 24, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + +let t = abcOrXyzOrNumber >= abcOrXyz; +>t : Symbol(t, Decl(stringLiteralTypesWithVariousOperators01.ts, 25, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let u = abc === abcOrXyz; +>u : Symbol(u, Decl(stringLiteralTypesWithVariousOperators01.ts, 26, 3)) +>abc : Symbol(abc, Decl(stringLiteralTypesWithVariousOperators01.ts, 1, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) + +let v = abcOrXyz === abcOrXyzOrNumber; +>v : Symbol(v, Decl(stringLiteralTypesWithVariousOperators01.ts, 27, 3)) +>abcOrXyz : Symbol(abcOrXyz, Decl(stringLiteralTypesWithVariousOperators01.ts, 3, 3)) +>abcOrXyzOrNumber : Symbol(abcOrXyzOrNumber, Decl(stringLiteralTypesWithVariousOperators01.ts, 4, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types new file mode 100644 index 00000000000..90cb538b800 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types @@ -0,0 +1,152 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators01.ts === + +let abc: "ABC" = "ABC"; +>abc : "ABC" +>"ABC" : "ABC" + +let xyz: "XYZ" = "XYZ"; +>xyz : "XYZ" +>"XYZ" : "XYZ" + +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +>abcOrXyz : "ABC" | "XYZ" +>abc || xyz : "ABC" | "XYZ" +>abc : "ABC" +>xyz : "XYZ" + +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; +>abcOrXyzOrNumber : "ABC" | "XYZ" | number +>abcOrXyz || 100 : "ABC" | "XYZ" | number +>abcOrXyz : "ABC" | "XYZ" +>100 : number + +let a = "" + abc; +>a : string +>"" + abc : string +>"" : string +>abc : "ABC" + +let b = abc + ""; +>b : string +>abc + "" : string +>abc : "ABC" +>"" : string + +let c = 10 + abc; +>c : string +>10 + abc : string +>10 : number +>abc : "ABC" + +let d = abc + 10; +>d : string +>abc + 10 : string +>abc : "ABC" +>10 : number + +let e = xyz + abc; +>e : string +>xyz + abc : string +>xyz : "XYZ" +>abc : "ABC" + +let f = abc + xyz; +>f : string +>abc + xyz : string +>abc : "ABC" +>xyz : "XYZ" + +let g = true + abc; +>g : string +>true + abc : string +>true : boolean +>abc : "ABC" + +let h = abc + true; +>h : string +>abc + true : string +>abc : "ABC" +>true : boolean + +let i = abc + abcOrXyz + xyz; +>i : string +>abc + abcOrXyz + xyz : string +>abc + abcOrXyz : string +>abc : "ABC" +>abcOrXyz : "ABC" | "XYZ" +>xyz : "XYZ" + +let j = abcOrXyz + abcOrXyz; +>j : string +>abcOrXyz + abcOrXyz : string +>abcOrXyz : "ABC" | "XYZ" +>abcOrXyz : "ABC" | "XYZ" + +let k = +abcOrXyz; +>k : number +>+abcOrXyz : number +>abcOrXyz : "ABC" | "XYZ" + +let l = -abcOrXyz; +>l : number +>-abcOrXyz : number +>abcOrXyz : "ABC" | "XYZ" + +let m = abcOrXyzOrNumber + ""; +>m : string +>abcOrXyzOrNumber + "" : string +>abcOrXyzOrNumber : "ABC" | "XYZ" | number +>"" : string + +let n = "" + abcOrXyzOrNumber; +>n : string +>"" + abcOrXyzOrNumber : string +>"" : string +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + +let o = abcOrXyzOrNumber + abcOrXyz; +>o : string +>abcOrXyzOrNumber + abcOrXyz : string +>abcOrXyzOrNumber : "ABC" | "XYZ" | number +>abcOrXyz : "ABC" | "XYZ" + +let p = abcOrXyz + abcOrXyzOrNumber; +>p : string +>abcOrXyz + abcOrXyzOrNumber : string +>abcOrXyz : "ABC" | "XYZ" +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + +let q = !abcOrXyzOrNumber; +>q : boolean +>!abcOrXyzOrNumber : boolean +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + +let r = ~abcOrXyzOrNumber; +>r : number +>~abcOrXyzOrNumber : number +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + +let s = abcOrXyzOrNumber < abcOrXyzOrNumber; +>s : boolean +>abcOrXyzOrNumber < abcOrXyzOrNumber : boolean +>abcOrXyzOrNumber : "ABC" | "XYZ" | number +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + +let t = abcOrXyzOrNumber >= abcOrXyz; +>t : boolean +>abcOrXyzOrNumber >= abcOrXyz : boolean +>abcOrXyzOrNumber : "ABC" | "XYZ" | number +>abcOrXyz : "ABC" | "XYZ" + +let u = abc === abcOrXyz; +>u : boolean +>abc === abcOrXyz : boolean +>abc : "ABC" +>abcOrXyz : "ABC" | "XYZ" + +let v = abcOrXyz === abcOrXyzOrNumber; +>v : boolean +>abcOrXyz === abcOrXyzOrNumber : boolean +>abcOrXyz : "ABC" | "XYZ" +>abcOrXyzOrNumber : "ABC" | "XYZ" | number + diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt new file mode 100644 index 00000000000..69dd6c2f6a9 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt @@ -0,0 +1,48 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(7,9): error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and 'number'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(8,9): error TS2365: Operator '+' cannot be applied to types 'number' and '"ABC" | "XYZ" | number'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(9,9): error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and '"ABC" | "XYZ" | number'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(10,9): error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and 'boolean'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(11,9): error TS2365: Operator '+' cannot be applied to types 'boolean' and '"ABC" | "XYZ" | number'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(12,9): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(13,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(14,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(15,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts (9 errors) ==== + + let abc: "ABC" = "ABC"; + let xyz: "XYZ" = "XYZ"; + let abcOrXyz: "ABC" | "XYZ" = abc || xyz; + let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; + + let a = abcOrXyzOrNumber + 100; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and 'number'. + let b = 100 + abcOrXyzOrNumber; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and '"ABC" | "XYZ" | number'. + let c = abcOrXyzOrNumber + abcOrXyzOrNumber; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and '"ABC" | "XYZ" | number'. + let d = abcOrXyzOrNumber + true; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '"ABC" | "XYZ" | number' and 'boolean'. + let e = false + abcOrXyzOrNumber; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and '"ABC" | "XYZ" | number'. + let f = abcOrXyzOrNumber++; + ~~~~~~~~~~~~~~~~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + let g = --abcOrXyzOrNumber; + ~~~~~~~~~~~~~~~~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + let h = abcOrXyzOrNumber ^ 10; + ~~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + let i = abcOrXyzOrNumber | 10; + ~~~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + let j = abc < xyz; + let k = abc === xyz; + let l = abc != xyz; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.js b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.js new file mode 100644 index 00000000000..4914ecf3d17 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.js @@ -0,0 +1,56 @@ +//// [stringLiteralTypesWithVariousOperators02.ts] + +let abc: "ABC" = "ABC"; +let xyz: "XYZ" = "XYZ"; +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; + +let a = abcOrXyzOrNumber + 100; +let b = 100 + abcOrXyzOrNumber; +let c = abcOrXyzOrNumber + abcOrXyzOrNumber; +let d = abcOrXyzOrNumber + true; +let e = false + abcOrXyzOrNumber; +let f = abcOrXyzOrNumber++; +let g = --abcOrXyzOrNumber; +let h = abcOrXyzOrNumber ^ 10; +let i = abcOrXyzOrNumber | 10; +let j = abc < xyz; +let k = abc === xyz; +let l = abc != xyz; + +//// [stringLiteralTypesWithVariousOperators02.js] +var abc = "ABC"; +var xyz = "XYZ"; +var abcOrXyz = abc || xyz; +var abcOrXyzOrNumber = abcOrXyz || 100; +var a = abcOrXyzOrNumber + 100; +var b = 100 + abcOrXyzOrNumber; +var c = abcOrXyzOrNumber + abcOrXyzOrNumber; +var d = abcOrXyzOrNumber + true; +var e = false + abcOrXyzOrNumber; +var f = abcOrXyzOrNumber++; +var g = --abcOrXyzOrNumber; +var h = abcOrXyzOrNumber ^ 10; +var i = abcOrXyzOrNumber | 10; +var j = abc < xyz; +var k = abc === xyz; +var l = abc != xyz; + + +//// [stringLiteralTypesWithVariousOperators02.d.ts] +declare let abc: "ABC"; +declare let xyz: "XYZ"; +declare let abcOrXyz: "ABC" | "XYZ"; +declare let abcOrXyzOrNumber: "ABC" | "XYZ" | number; +declare let a: any; +declare let b: any; +declare let c: any; +declare let d: any; +declare let e: any; +declare let f: number; +declare let g: number; +declare let h: number; +declare let i: number; +declare let j: boolean; +declare let k: boolean; +declare let l: boolean; diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt index d3c399477d6..da742fcd69c 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. - Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. + Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -78,7 +78,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW ~~ !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. -!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. +!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'. !!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: string) => string; // error because base returns non-void; diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt index 03cc6de0ca4..8a885a2455f 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. - Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. + Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -78,7 +78,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW ~~ !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. -!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. +!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'. !!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: string) => string; // error because base returns non-void; diff --git a/tests/baselines/reference/symbolProperty41.types b/tests/baselines/reference/symbolProperty41.types index 61b71dfe246..f312481ac04 100644 --- a/tests/baselines/reference/symbolProperty41.types +++ b/tests/baselines/reference/symbolProperty41.types @@ -49,5 +49,5 @@ c[Symbol.iterator]("hello"); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/symbolType18.types b/tests/baselines/reference/symbolType18.types index db4fb30378f..68c43215136 100644 --- a/tests/baselines/reference/symbolType18.types +++ b/tests/baselines/reference/symbolType18.types @@ -21,5 +21,5 @@ if (typeof x === "object") { } else { x; ->x : symbol | Foo +>x : symbol } diff --git a/tests/baselines/reference/thisTypeInClasses.symbols b/tests/baselines/reference/thisTypeInClasses.symbols index 0915d6e5e6b..5ae45b923af 100644 --- a/tests/baselines/reference/thisTypeInClasses.symbols +++ b/tests/baselines/reference/thisTypeInClasses.symbols @@ -92,7 +92,6 @@ class C5 { let f1 = (x: this): this => this; >f1 : Symbol(f1, Decl(thisTypeInClasses.ts, 34, 11)) >x : Symbol(x, Decl(thisTypeInClasses.ts, 34, 18)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) >this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) let f2 = (x: this) => this; diff --git a/tests/baselines/reference/thisTypeInClasses.types b/tests/baselines/reference/thisTypeInClasses.types index 512359decd9..69d0f0b1f8f 100644 --- a/tests/baselines/reference/thisTypeInClasses.types +++ b/tests/baselines/reference/thisTypeInClasses.types @@ -93,7 +93,6 @@ class C5 { >f1 : (x: this) => this >(x: this): this => this : (x: this) => this >x : this ->this : this >this : this let f2 = (x: this) => this; diff --git a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt index 90d0d003c28..0607a01a11c 100644 --- a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt +++ b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,8): error TS1003: Identifier expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,10): error TS1005: ';' expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,10): error TS2304: Cannot find name 'data'. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,15): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,18): error TS1005: ':' expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,21): error TS1109: Expression expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(10,22): error TS1109: Expression expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(11,8): error TS1003: Identifier expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(11,9): error TS2304: Cannot find name 'data'. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(11,13): error TS1005: ';' expected. -tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx(11,20): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/jsx/file.tsx(10,8): error TS1003: Identifier expected. +tests/cases/conformance/jsx/file.tsx(10,10): error TS1005: ';' expected. +tests/cases/conformance/jsx/file.tsx(10,10): error TS2304: Cannot find name 'data'. +tests/cases/conformance/jsx/file.tsx(10,15): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/jsx/file.tsx(10,18): error TS1005: ':' expected. +tests/cases/conformance/jsx/file.tsx(10,21): error TS1109: Expression expected. +tests/cases/conformance/jsx/file.tsx(10,22): error TS1109: Expression expected. +tests/cases/conformance/jsx/file.tsx(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/jsx/file.tsx(11,8): error TS1003: Identifier expected. +tests/cases/conformance/jsx/file.tsx(11,9): error TS2304: Cannot find name 'data'. +tests/cases/conformance/jsx/file.tsx(11,13): error TS1005: ';' expected. +tests/cases/conformance/jsx/file.tsx(11,20): error TS1161: Unterminated regular expression literal. -==== tests/cases/conformance/jsx/tsxAttributeInvalidNames.tsx (12 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (12 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeInvalidNames.js b/tests/baselines/reference/tsxAttributeInvalidNames.js index af1de76995c..f734eb92ed5 100644 --- a/tests/baselines/reference/tsxAttributeInvalidNames.js +++ b/tests/baselines/reference/tsxAttributeInvalidNames.js @@ -1,4 +1,4 @@ -//// [tsxAttributeInvalidNames.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -11,7 +11,7 @@ declare module JSX { ; ; -//// [tsxAttributeInvalidNames.jsx] +//// [file.jsx] // Invalid names ; 32; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 7503c5f5969..49bb504604e 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. -tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. +tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. -==== tests/cases/conformance/jsx/tsxAttributeResolution1.tsx (7 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (7 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution1.js b/tests/baselines/reference/tsxAttributeResolution1.js index 1e1efb7ea22..3bf94909c70 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.js +++ b/tests/baselines/reference/tsxAttributeResolution1.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution1.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -34,7 +34,7 @@ interface Attribs1 { ; -//// [tsxAttributeResolution1.jsx] +//// [file.jsx] // OK ; // OK ; // OK diff --git a/tests/baselines/reference/tsxAttributeResolution2.errors.txt b/tests/baselines/reference/tsxAttributeResolution2.errors.txt index d213ccaf54e..84fe8fb20f2 100644 --- a/tests/baselines/reference/tsxAttributeResolution2.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxAttributeResolution2.tsx(17,21): error TS2339: Property 'leng' does not exist on type 'string'. +tests/cases/conformance/jsx/file.tsx(17,21): error TS2339: Property 'leng' does not exist on type 'string'. -==== tests/cases/conformance/jsx/tsxAttributeResolution2.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution2.js b/tests/baselines/reference/tsxAttributeResolution2.js index 564767e6169..f91f268f385 100644 --- a/tests/baselines/reference/tsxAttributeResolution2.js +++ b/tests/baselines/reference/tsxAttributeResolution2.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -18,7 +18,7 @@ interface Attribs1 { x.leng} />; // Error, no leng on 'string' -//// [tsxAttributeResolution2.jsx] +//// [file.jsx] // OK ; // OK ; // OK diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt index c797362e8d7..6513b9879dc 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/jsx/tsxAttributeResolution3.tsx(19,8): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. +tests/cases/conformance/jsx/file.tsx(19,8): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeResolution3.tsx(23,1): error TS2324: Property 'x' is missing in type 'Attribs1'. -tests/cases/conformance/jsx/tsxAttributeResolution3.tsx(31,15): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. +tests/cases/conformance/jsx/file.tsx(23,1): error TS2324: Property 'x' is missing in type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(31,15): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeResolution3.tsx(39,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type 'number' is not assignable to type 'string'. -==== tests/cases/conformance/jsx/tsxAttributeResolution3.tsx (4 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution3.js b/tests/baselines/reference/tsxAttributeResolution3.js index 8cf853820e1..2898a6bc251 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.js +++ b/tests/baselines/reference/tsxAttributeResolution3.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution3.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -40,7 +40,7 @@ var obj7 = { x: 'foo' }; -//// [tsxAttributeResolution3.jsx] +//// [file.jsx] // OK var obj1 = { x: 'foo' }; ; diff --git a/tests/baselines/reference/tsxAttributeResolution4.errors.txt b/tests/baselines/reference/tsxAttributeResolution4.errors.txt index 211a349b304..0a54dc32c46 100644 --- a/tests/baselines/reference/tsxAttributeResolution4.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxAttributeResolution4.tsx(15,26): error TS2339: Property 'len' does not exist on type 'string'. +tests/cases/conformance/jsx/file.tsx(15,26): error TS2339: Property 'len' does not exist on type 'string'. -==== tests/cases/conformance/jsx/tsxAttributeResolution4.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution4.js b/tests/baselines/reference/tsxAttributeResolution4.js index d56cb4cc2e8..ccd1ba8157c 100644 --- a/tests/baselines/reference/tsxAttributeResolution4.js +++ b/tests/baselines/reference/tsxAttributeResolution4.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution4.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -16,7 +16,7 @@ interface Attribs1 { n.len} } />; -//// [tsxAttributeResolution4.jsx] +//// [file.jsx] // OK ; // Error, no member 'len' on 'string' diff --git a/tests/baselines/reference/tsxAttributeResolution5.errors.txt b/tests/baselines/reference/tsxAttributeResolution5.errors.txt index 1b42dd01465..d7aa46bc05a 100644 --- a/tests/baselines/reference/tsxAttributeResolution5.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution5.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsx/tsxAttributeResolution5.tsx(21,16): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. +tests/cases/conformance/jsx/file.tsx(21,16): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeResolution5.tsx(25,9): error TS2324: Property 'x' is missing in type 'Attribs1'. -tests/cases/conformance/jsx/tsxAttributeResolution5.tsx(29,1): error TS2324: Property 'x' is missing in type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(25,9): error TS2324: Property 'x' is missing in type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'x' is missing in type 'Attribs1'. -==== tests/cases/conformance/jsx/tsxAttributeResolution5.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution5.js b/tests/baselines/reference/tsxAttributeResolution5.js index 34fe9a3bfb6..abfb54e000c 100644 --- a/tests/baselines/reference/tsxAttributeResolution5.js +++ b/tests/baselines/reference/tsxAttributeResolution5.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution5.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -31,7 +31,7 @@ function make3 (obj: T) { ; // OK -//// [tsxAttributeResolution5.jsx] +//// [file.jsx] function make1(obj) { return ; // OK } diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index 4f1960358a5..732ac9500a9 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/jsx/tsxAttributeResolution6.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeResolution6.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/tsxAttributeResolution6.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: boolean; }'. +tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: boolean; }'. -==== tests/cases/conformance/jsx/tsxAttributeResolution6.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution6.js b/tests/baselines/reference/tsxAttributeResolution6.js index 5d6ad1e20c6..946b46da95b 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.js +++ b/tests/baselines/reference/tsxAttributeResolution6.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution6.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -18,7 +18,7 @@ declare module JSX { ; -//// [tsxAttributeResolution6.jsx] +//// [file.jsx] // Error ; ; diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index 4d05254ace8..acbd7f407de 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxAttributeResolution7.tsx(9,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not assignable to type 'string'. -==== tests/cases/conformance/jsx/tsxAttributeResolution7.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxAttributeResolution7.js b/tests/baselines/reference/tsxAttributeResolution7.js index 7ebd2e8f4db..d474e48b21b 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.js +++ b/tests/baselines/reference/tsxAttributeResolution7.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution7.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -15,7 +15,7 @@ declare module JSX { ; -//// [tsxAttributeResolution7.jsx] +//// [file.jsx] // Error ; // OK diff --git a/tests/baselines/reference/tsxAttributeResolution8.js b/tests/baselines/reference/tsxAttributeResolution8.js index 50fff6c80fd..e1b00c6b573 100644 --- a/tests/baselines/reference/tsxAttributeResolution8.js +++ b/tests/baselines/reference/tsxAttributeResolution8.js @@ -1,4 +1,4 @@ -//// [tsxAttributeResolution8.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -10,7 +10,7 @@ var x: any; // Should be OK -//// [tsxAttributeResolution8.jsx] +//// [file.jsx] var x; // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution8.symbols b/tests/baselines/reference/tsxAttributeResolution8.symbols index 85db1985cc2..58629c15b6f 100644 --- a/tests/baselines/reference/tsxAttributeResolution8.symbols +++ b/tests/baselines/reference/tsxAttributeResolution8.symbols @@ -1,24 +1,24 @@ -=== tests/cases/conformance/jsx/tsxAttributeResolution8.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxAttributeResolution8.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxAttributeResolution8.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxAttributeResolution8.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) test1: {x: string}; ->test1 : Symbol(test1, Decl(tsxAttributeResolution8.tsx, 2, 30)) ->x : Symbol(x, Decl(tsxAttributeResolution8.tsx, 3, 10)) +>test1 : Symbol(test1, Decl(file.tsx, 2, 30)) +>x : Symbol(x, Decl(file.tsx, 3, 10)) } } var x: any; ->x : Symbol(x, Decl(tsxAttributeResolution8.tsx, 7, 3)) +>x : Symbol(x, Decl(file.tsx, 7, 3)) // Should be OK ->test1 : Symbol(JSX.IntrinsicElements.test1, Decl(tsxAttributeResolution8.tsx, 2, 30)) ->x : Symbol(x, Decl(tsxAttributeResolution8.tsx, 7, 3)) +>test1 : Symbol(JSX.IntrinsicElements.test1, Decl(file.tsx, 2, 30)) +>x : Symbol(x, Decl(file.tsx, 7, 3)) diff --git a/tests/baselines/reference/tsxAttributeResolution8.types b/tests/baselines/reference/tsxAttributeResolution8.types index db89d6678b6..99a60c24ce2 100644 --- a/tests/baselines/reference/tsxAttributeResolution8.types +++ b/tests/baselines/reference/tsxAttributeResolution8.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxAttributeResolution8.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxElementResolution1.errors.txt b/tests/baselines/reference/tsxElementResolution1.errors.txt index b54430bd106..0042c5b052c 100644 --- a/tests/baselines/reference/tsxElementResolution1.errors.txt +++ b/tests/baselines/reference/tsxElementResolution1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxElementResolution1.tsx(12,1): error TS2339: Property 'span' does not exist on type 'JSX.IntrinsicElements'. +tests/cases/conformance/jsx/file.tsx(12,1): error TS2339: Property 'span' does not exist on type 'JSX.IntrinsicElements'. -==== tests/cases/conformance/jsx/tsxElementResolution1.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxElementResolution1.js b/tests/baselines/reference/tsxElementResolution1.js index c7e0536bde2..47c60fba1b3 100644 --- a/tests/baselines/reference/tsxElementResolution1.js +++ b/tests/baselines/reference/tsxElementResolution1.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution1.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -12,7 +12,7 @@ declare module JSX { // Fail ; -//// [tsxElementResolution1.jsx] +//// [file.jsx] // OK
; // Fail diff --git a/tests/baselines/reference/tsxElementResolution10.errors.txt b/tests/baselines/reference/tsxElementResolution10.errors.txt index 6dcee7d18fa..9214ffe7dbb 100644 --- a/tests/baselines/reference/tsxElementResolution10.errors.txt +++ b/tests/baselines/reference/tsxElementResolution10.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution10.tsx(13,1): error TS2605: JSX element type '{ x: number; }' is not a constructor function for JSX elements. +tests/cases/conformance/jsx/file.tsx(13,1): error TS2605: JSX element type '{ x: number; }' is not a constructor function for JSX elements. Property 'render' is missing in type '{ x: number; }'. -==== tests/cases/conformance/jsx/tsxElementResolution10.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface ElementClass { diff --git a/tests/baselines/reference/tsxElementResolution10.js b/tests/baselines/reference/tsxElementResolution10.js index 84c8619ab96..72cd1cb9f00 100644 --- a/tests/baselines/reference/tsxElementResolution10.js +++ b/tests/baselines/reference/tsxElementResolution10.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution10.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface ElementClass { @@ -20,7 +20,7 @@ var Obj2: Obj2type; ; // OK -//// [tsxElementResolution10.jsx] +//// [file.jsx] var Obj1; ; // Error, no render member var Obj2; diff --git a/tests/baselines/reference/tsxElementResolution11.errors.txt b/tests/baselines/reference/tsxElementResolution11.errors.txt index 4f3ee00d82f..f6a4913e558 100644 --- a/tests/baselines/reference/tsxElementResolution11.errors.txt +++ b/tests/baselines/reference/tsxElementResolution11.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxElementResolution11.tsx(17,7): error TS2339: Property 'x' does not exist on type '{ q?: number; }'. +tests/cases/conformance/jsx/file.tsx(17,7): error TS2339: Property 'x' does not exist on type '{ q?: number; }'. -==== tests/cases/conformance/jsx/tsxElementResolution11.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface ElementAttributesProperty { } diff --git a/tests/baselines/reference/tsxElementResolution11.js b/tests/baselines/reference/tsxElementResolution11.js index fb8572116b1..dfed67210ed 100644 --- a/tests/baselines/reference/tsxElementResolution11.js +++ b/tests/baselines/reference/tsxElementResolution11.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution11.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface ElementAttributesProperty { } @@ -24,7 +24,7 @@ var Obj3: Obj3type; ; // OK -//// [tsxElementResolution11.jsx] +//// [file.jsx] var Obj1; ; // OK var Obj2; diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 71a22b502aa..4a15005f6fb 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/jsx/tsxElementResolution12.tsx(17,2): error TS2304: Cannot find name 'Obj2'. -tests/cases/conformance/jsx/tsxElementResolution12.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property -tests/cases/conformance/jsx/tsxElementResolution12.tsx(30,7): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(17,2): error TS2304: Cannot find name 'Obj2'. +tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property +tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/jsx/tsxElementResolution12.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== declare module JSX { interface Element { } interface ElementAttributesProperty { pr: any; } diff --git a/tests/baselines/reference/tsxElementResolution12.js b/tests/baselines/reference/tsxElementResolution12.js index 12973efdda7..b4dd94ef0eb 100644 --- a/tests/baselines/reference/tsxElementResolution12.js +++ b/tests/baselines/reference/tsxElementResolution12.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution12.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface ElementAttributesProperty { pr: any; } @@ -31,7 +31,7 @@ var Obj4: Obj4type; ; // Error -//// [tsxElementResolution12.jsx] +//// [file.jsx] var Obj1; ; // OK var obj2; diff --git a/tests/baselines/reference/tsxElementResolution13.js b/tests/baselines/reference/tsxElementResolution13.js index f8631bdec0c..461c494bc58 100644 --- a/tests/baselines/reference/tsxElementResolution13.js +++ b/tests/baselines/reference/tsxElementResolution13.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution13.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface ElementAttributesProperty { pr1: any; pr2: any; } @@ -11,6 +11,6 @@ var obj1: Obj1; ; // Error -//// [tsxElementResolution13.jsx] +//// [file.jsx] var obj1; ; // Error diff --git a/tests/baselines/reference/tsxElementResolution13.symbols b/tests/baselines/reference/tsxElementResolution13.symbols index 4022602e53a..94758b291ac 100644 --- a/tests/baselines/reference/tsxElementResolution13.symbols +++ b/tests/baselines/reference/tsxElementResolution13.symbols @@ -1,25 +1,25 @@ -=== tests/cases/conformance/jsx/tsxElementResolution13.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxElementResolution13.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxElementResolution13.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface ElementAttributesProperty { pr1: any; pr2: any; } ->ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(tsxElementResolution13.tsx, 1, 22)) ->pr1 : Symbol(pr1, Decl(tsxElementResolution13.tsx, 2, 38)) ->pr2 : Symbol(pr2, Decl(tsxElementResolution13.tsx, 2, 48)) +>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(file.tsx, 1, 22)) +>pr1 : Symbol(pr1, Decl(file.tsx, 2, 38)) +>pr2 : Symbol(pr2, Decl(file.tsx, 2, 48)) } interface Obj1 { ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution13.tsx, 3, 1)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1)) new(n: string): any; ->n : Symbol(n, Decl(tsxElementResolution13.tsx, 6, 5)) +>n : Symbol(n, Decl(file.tsx, 6, 5)) } var obj1: Obj1; ->obj1 : Symbol(obj1, Decl(tsxElementResolution13.tsx, 8, 3)) ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution13.tsx, 3, 1)) +>obj1 : Symbol(obj1, Decl(file.tsx, 8, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1)) ; // Error >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution13.types b/tests/baselines/reference/tsxElementResolution13.types index 613835f3211..57884f86b56 100644 --- a/tests/baselines/reference/tsxElementResolution13.types +++ b/tests/baselines/reference/tsxElementResolution13.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxElementResolution13.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxElementResolution14.js b/tests/baselines/reference/tsxElementResolution14.js index e1e440db5f3..d594aba237b 100644 --- a/tests/baselines/reference/tsxElementResolution14.js +++ b/tests/baselines/reference/tsxElementResolution14.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution14.tsx] +//// [file.tsx] declare module JSX { interface Element { } } @@ -10,6 +10,6 @@ var obj1: Obj1; ; // OK -//// [tsxElementResolution14.jsx] +//// [file.jsx] var obj1; ; // OK diff --git a/tests/baselines/reference/tsxElementResolution14.symbols b/tests/baselines/reference/tsxElementResolution14.symbols index 58236a4e462..2400ef620eb 100644 --- a/tests/baselines/reference/tsxElementResolution14.symbols +++ b/tests/baselines/reference/tsxElementResolution14.symbols @@ -1,20 +1,20 @@ -=== tests/cases/conformance/jsx/tsxElementResolution14.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxElementResolution14.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxElementResolution14.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) } interface Obj1 { ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution14.tsx, 2, 1)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 2, 1)) new(n: string): {}; ->n : Symbol(n, Decl(tsxElementResolution14.tsx, 5, 5)) +>n : Symbol(n, Decl(file.tsx, 5, 5)) } var obj1: Obj1; ->obj1 : Symbol(obj1, Decl(tsxElementResolution14.tsx, 7, 3)) ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution14.tsx, 2, 1)) +>obj1 : Symbol(obj1, Decl(file.tsx, 7, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 2, 1)) ; // OK >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution14.types b/tests/baselines/reference/tsxElementResolution14.types index 80f9555030f..2768a6c531d 100644 --- a/tests/baselines/reference/tsxElementResolution14.types +++ b/tests/baselines/reference/tsxElementResolution14.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxElementResolution14.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxElementResolution15.errors.txt b/tests/baselines/reference/tsxElementResolution15.errors.txt index 24480ab7f2b..79cbd1a37af 100644 --- a/tests/baselines/reference/tsxElementResolution15.errors.txt +++ b/tests/baselines/reference/tsxElementResolution15.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxElementResolution15.tsx(3,12): error TS2608: The global type 'JSX.ElementAttributesProperty' may not have more than one property +tests/cases/conformance/jsx/file.tsx(3,12): error TS2608: The global type 'JSX.ElementAttributesProperty' may not have more than one property -==== tests/cases/conformance/jsx/tsxElementResolution15.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface ElementAttributesProperty { pr1: any; pr2: any; } diff --git a/tests/baselines/reference/tsxElementResolution15.js b/tests/baselines/reference/tsxElementResolution15.js index 831b3a54b41..6c8560f225d 100644 --- a/tests/baselines/reference/tsxElementResolution15.js +++ b/tests/baselines/reference/tsxElementResolution15.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution15.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface ElementAttributesProperty { pr1: any; pr2: any; } @@ -12,6 +12,6 @@ var Obj1: Obj1type; ; // Error -//// [tsxElementResolution15.jsx] +//// [file.jsx] var Obj1; ; // Error diff --git a/tests/baselines/reference/tsxElementResolution16.errors.txt b/tests/baselines/reference/tsxElementResolution16.errors.txt index 0e30cad9673..1a887c39995 100644 --- a/tests/baselines/reference/tsxElementResolution16.errors.txt +++ b/tests/baselines/reference/tsxElementResolution16.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution16.tsx(8,1): error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist. -tests/cases/conformance/jsx/tsxElementResolution16.tsx(8,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists +tests/cases/conformance/jsx/file.tsx(8,1): error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist. +tests/cases/conformance/jsx/file.tsx(8,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists -==== tests/cases/conformance/jsx/tsxElementResolution16.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== declare module JSX { } diff --git a/tests/baselines/reference/tsxElementResolution16.js b/tests/baselines/reference/tsxElementResolution16.js index 1961215fa05..a5abea6717f 100644 --- a/tests/baselines/reference/tsxElementResolution16.js +++ b/tests/baselines/reference/tsxElementResolution16.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution16.tsx] +//// [file.tsx] declare module JSX { } @@ -9,6 +9,6 @@ var obj1: Obj1; ; // Error (JSX.Element is implicit any) -//// [tsxElementResolution16.jsx] +//// [file.jsx] var obj1; ; // Error (JSX.Element is implicit any) diff --git a/tests/baselines/reference/tsxElementResolution18.errors.txt b/tests/baselines/reference/tsxElementResolution18.errors.txt index a4728b2f749..5b8468696c0 100644 --- a/tests/baselines/reference/tsxElementResolution18.errors.txt +++ b/tests/baselines/reference/tsxElementResolution18.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxElementResolution18.tsx(6,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists +tests/cases/conformance/jsx/file1.tsx(6,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists -==== tests/cases/conformance/jsx/tsxElementResolution18.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file1.tsx (1 errors) ==== declare module JSX { interface Element { } } diff --git a/tests/baselines/reference/tsxElementResolution18.js b/tests/baselines/reference/tsxElementResolution18.js index 0b5138b7b49..4481b9033f4 100644 --- a/tests/baselines/reference/tsxElementResolution18.js +++ b/tests/baselines/reference/tsxElementResolution18.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution18.tsx] +//// [file1.tsx] declare module JSX { interface Element { } } @@ -7,6 +7,6 @@ declare module JSX {
; -//// [tsxElementResolution18.jsx] +//// [file1.jsx] // Error under implicit any
; diff --git a/tests/baselines/reference/tsxElementResolution2.js b/tests/baselines/reference/tsxElementResolution2.js index 1d06656d529..c6934e9df89 100644 --- a/tests/baselines/reference/tsxElementResolution2.js +++ b/tests/baselines/reference/tsxElementResolution2.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -12,7 +12,7 @@ declare module JSX { // OK ; -//// [tsxElementResolution2.jsx] +//// [file.jsx] // OK
; // OK diff --git a/tests/baselines/reference/tsxElementResolution2.symbols b/tests/baselines/reference/tsxElementResolution2.symbols index 2935bcd4f63..efb1d9ae5dc 100644 --- a/tests/baselines/reference/tsxElementResolution2.symbols +++ b/tests/baselines/reference/tsxElementResolution2.symbols @@ -1,23 +1,23 @@ -=== tests/cases/conformance/jsx/tsxElementResolution2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxElementResolution2.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxElementResolution2.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxElementResolution2.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [x: string]: any; ->x : Symbol(x, Decl(tsxElementResolution2.tsx, 3, 6)) +>x : Symbol(x, Decl(file.tsx, 3, 6)) } } // OK
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxElementResolution2.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // OK ; ->span : Symbol(JSX.IntrinsicElements, Decl(tsxElementResolution2.tsx, 1, 22)) +>span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxElementResolution2.types b/tests/baselines/reference/tsxElementResolution2.types index 56ea5158253..4fd87304a72 100644 --- a/tests/baselines/reference/tsxElementResolution2.types +++ b/tests/baselines/reference/tsxElementResolution2.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxElementResolution2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxElementResolution3.errors.txt b/tests/baselines/reference/tsxElementResolution3.errors.txt index bc3c7c5ebfc..1b8b6c5834c 100644 --- a/tests/baselines/reference/tsxElementResolution3.errors.txt +++ b/tests/baselines/reference/tsxElementResolution3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution3.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: string; }'. -tests/cases/conformance/jsx/tsxElementResolution3.tsx(12,7): error TS2339: Property 'w' does not exist on type '{ n: string; }'. +tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: string; }'. +tests/cases/conformance/jsx/file.tsx(12,7): error TS2339: Property 'w' does not exist on type '{ n: string; }'. -==== tests/cases/conformance/jsx/tsxElementResolution3.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxElementResolution3.js b/tests/baselines/reference/tsxElementResolution3.js index 607d1c5ec66..75b23db761e 100644 --- a/tests/baselines/reference/tsxElementResolution3.js +++ b/tests/baselines/reference/tsxElementResolution3.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution3.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -12,7 +12,7 @@ declare module JSX { // Error ; -//// [tsxElementResolution3.jsx] +//// [file.jsx] // OK
; // Error diff --git a/tests/baselines/reference/tsxElementResolution4.errors.txt b/tests/baselines/reference/tsxElementResolution4.errors.txt index 0e383af5e7b..e6dd599defc 100644 --- a/tests/baselines/reference/tsxElementResolution4.errors.txt +++ b/tests/baselines/reference/tsxElementResolution4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution4.tsx(16,1): error TS2324: Property 'm' is missing in type '{ m: string; }'. -tests/cases/conformance/jsx/tsxElementResolution4.tsx(16,7): error TS2339: Property 'q' does not exist on type '{ m: string; }'. +tests/cases/conformance/jsx/file.tsx(16,1): error TS2324: Property 'm' is missing in type '{ m: string; }'. +tests/cases/conformance/jsx/file.tsx(16,7): error TS2339: Property 'q' does not exist on type '{ m: string; }'. -==== tests/cases/conformance/jsx/tsxElementResolution4.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxElementResolution4.js b/tests/baselines/reference/tsxElementResolution4.js index ea395cb5077..40d86816f76 100644 --- a/tests/baselines/reference/tsxElementResolution4.js +++ b/tests/baselines/reference/tsxElementResolution4.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution4.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -17,7 +17,7 @@ declare module JSX { ; -//// [tsxElementResolution4.jsx] +//// [file.jsx] // OK
; // OK diff --git a/tests/baselines/reference/tsxElementResolution5.js b/tests/baselines/reference/tsxElementResolution5.js index 8aadfec0f78..4dcd644e471 100644 --- a/tests/baselines/reference/tsxElementResolution5.js +++ b/tests/baselines/reference/tsxElementResolution5.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution5.tsx] +//// [file1.tsx] declare module JSX { interface Element { } } @@ -7,6 +7,6 @@ declare module JSX {
; -//// [tsxElementResolution5.jsx] +//// [file1.jsx] // OK, but implicit any
; diff --git a/tests/baselines/reference/tsxElementResolution5.symbols b/tests/baselines/reference/tsxElementResolution5.symbols index 8bbbfaaeb68..461ffd78aaa 100644 --- a/tests/baselines/reference/tsxElementResolution5.symbols +++ b/tests/baselines/reference/tsxElementResolution5.symbols @@ -1,9 +1,9 @@ -=== tests/cases/conformance/jsx/tsxElementResolution5.tsx === +=== tests/cases/conformance/jsx/file1.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxElementResolution5.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file1.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxElementResolution5.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file1.tsx, 0, 20)) } // OK, but implicit any diff --git a/tests/baselines/reference/tsxElementResolution5.types b/tests/baselines/reference/tsxElementResolution5.types index ba3509f4fa1..cdfb91c7067 100644 --- a/tests/baselines/reference/tsxElementResolution5.types +++ b/tests/baselines/reference/tsxElementResolution5.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxElementResolution5.tsx === +=== tests/cases/conformance/jsx/file1.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxElementResolution6.errors.txt b/tests/baselines/reference/tsxElementResolution6.errors.txt index 1336cc6df0c..66269efee9f 100644 --- a/tests/baselines/reference/tsxElementResolution6.errors.txt +++ b/tests/baselines/reference/tsxElementResolution6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxElementResolution6.tsx(8,1): error TS2339: Property 'div' does not exist on type 'JSX.IntrinsicElements'. +tests/cases/conformance/jsx/file.tsx(8,1): error TS2339: Property 'div' does not exist on type 'JSX.IntrinsicElements'. -==== tests/cases/conformance/jsx/tsxElementResolution6.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxElementResolution6.js b/tests/baselines/reference/tsxElementResolution6.js index 1b6d174fea8..43d0512c893 100644 --- a/tests/baselines/reference/tsxElementResolution6.js +++ b/tests/baselines/reference/tsxElementResolution6.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution6.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { } @@ -9,7 +9,7 @@ var div: any;
; -//// [tsxElementResolution6.jsx] +//// [file.jsx] var div; // Still an error
; diff --git a/tests/baselines/reference/tsxElementResolution7.errors.txt b/tests/baselines/reference/tsxElementResolution7.errors.txt index b8549e19535..20b5b730d4c 100644 --- a/tests/baselines/reference/tsxElementResolution7.errors.txt +++ b/tests/baselines/reference/tsxElementResolution7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution7.tsx(12,5): error TS2339: Property 'other' does not exist on type 'typeof my'. -tests/cases/conformance/jsx/tsxElementResolution7.tsx(19,11): error TS2339: Property 'non' does not exist on type 'typeof my'. +tests/cases/conformance/jsx/file.tsx(12,5): error TS2339: Property 'other' does not exist on type 'typeof my'. +tests/cases/conformance/jsx/file.tsx(19,11): error TS2339: Property 'non' does not exist on type 'typeof my'. -==== tests/cases/conformance/jsx/tsxElementResolution7.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxElementResolution7.js b/tests/baselines/reference/tsxElementResolution7.js index 7df44b052a2..06daf11ceac 100644 --- a/tests/baselines/reference/tsxElementResolution7.js +++ b/tests/baselines/reference/tsxElementResolution7.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution7.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { } @@ -21,7 +21,7 @@ module q { } -//// [tsxElementResolution7.jsx] +//// [file.jsx] var my; (function (my) { })(my || (my = {})); diff --git a/tests/baselines/reference/tsxElementResolution8.errors.txt b/tests/baselines/reference/tsxElementResolution8.errors.txt index 92ff05d1aed..5f54bc23cd0 100644 --- a/tests/baselines/reference/tsxElementResolution8.errors.txt +++ b/tests/baselines/reference/tsxElementResolution8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/tsxElementResolution8.tsx(8,2): error TS2604: JSX element type 'Div' does not have any construct or call signatures. -tests/cases/conformance/jsx/tsxElementResolution8.tsx(34,2): error TS2604: JSX element type 'Obj3' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(8,2): error TS2604: JSX element type 'Div' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(34,2): error TS2604: JSX element type 'Obj3' does not have any construct or call signatures. -==== tests/cases/conformance/jsx/tsxElementResolution8.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxElementResolution8.js b/tests/baselines/reference/tsxElementResolution8.js index 4217761c402..d82f26ee8b5 100644 --- a/tests/baselines/reference/tsxElementResolution8.js +++ b/tests/baselines/reference/tsxElementResolution8.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution8.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { } @@ -35,7 +35,7 @@ var Obj3: Obj3; ; // Error -//// [tsxElementResolution8.jsx] +//// [file.jsx] // Error var Div = 3;
; diff --git a/tests/baselines/reference/tsxElementResolution9.js b/tests/baselines/reference/tsxElementResolution9.js index c897a51eaeb..bc65bb0bb02 100644 --- a/tests/baselines/reference/tsxElementResolution9.js +++ b/tests/baselines/reference/tsxElementResolution9.js @@ -1,4 +1,4 @@ -//// [tsxElementResolution9.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { } @@ -26,7 +26,7 @@ var Obj3: Obj3; ; // OK -//// [tsxElementResolution9.jsx] +//// [file.jsx] var Obj1; ; // Error, return type is not an object type var Obj2; diff --git a/tests/baselines/reference/tsxElementResolution9.symbols b/tests/baselines/reference/tsxElementResolution9.symbols index bfa04219ef9..e38c64d0847 100644 --- a/tests/baselines/reference/tsxElementResolution9.symbols +++ b/tests/baselines/reference/tsxElementResolution9.symbols @@ -1,67 +1,67 @@ -=== tests/cases/conformance/jsx/tsxElementResolution9.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxElementResolution9.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxElementResolution9.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { } ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxElementResolution9.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) } interface Obj1 { ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1), Decl(file.tsx, 9, 3)) new(n: string): { x: number }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 6, 5)) ->x : Symbol(x, Decl(tsxElementResolution9.tsx, 6, 18)) +>n : Symbol(n, Decl(file.tsx, 6, 5)) +>x : Symbol(x, Decl(file.tsx, 6, 18)) new(n: number): { y: string }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 7, 5)) ->y : Symbol(y, Decl(tsxElementResolution9.tsx, 7, 18)) +>n : Symbol(n, Decl(file.tsx, 7, 5)) +>y : Symbol(y, Decl(file.tsx, 7, 18)) } var Obj1: Obj1; ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3)) ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1), Decl(file.tsx, 9, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1), Decl(file.tsx, 9, 3)) ; // Error, return type is not an object type ->Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3)) +>Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1), Decl(file.tsx, 9, 3)) interface Obj2 { ->Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3)) +>Obj2 : Symbol(Obj2, Decl(file.tsx, 10, 9), Decl(file.tsx, 16, 3)) (n: string): { x: number }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 13, 2)) ->x : Symbol(x, Decl(tsxElementResolution9.tsx, 13, 15)) +>n : Symbol(n, Decl(file.tsx, 13, 2)) +>x : Symbol(x, Decl(file.tsx, 13, 15)) (n: number): { y: string }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 14, 2)) ->y : Symbol(y, Decl(tsxElementResolution9.tsx, 14, 15)) +>n : Symbol(n, Decl(file.tsx, 14, 2)) +>y : Symbol(y, Decl(file.tsx, 14, 15)) } var Obj2: Obj2; ->Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3)) ->Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3)) +>Obj2 : Symbol(Obj2, Decl(file.tsx, 10, 9), Decl(file.tsx, 16, 3)) +>Obj2 : Symbol(Obj2, Decl(file.tsx, 10, 9), Decl(file.tsx, 16, 3)) ; // Error, return type is not an object type ->Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3)) +>Obj2 : Symbol(Obj2, Decl(file.tsx, 10, 9), Decl(file.tsx, 16, 3)) interface Obj3 { ->Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3)) +>Obj3 : Symbol(Obj3, Decl(file.tsx, 17, 9), Decl(file.tsx, 23, 3)) (n: string): { x: number }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 20, 2)) ->x : Symbol(x, Decl(tsxElementResolution9.tsx, 20, 15)) +>n : Symbol(n, Decl(file.tsx, 20, 2)) +>x : Symbol(x, Decl(file.tsx, 20, 15)) (n: number): { x: number; y: string }; ->n : Symbol(n, Decl(tsxElementResolution9.tsx, 21, 2)) ->x : Symbol(x, Decl(tsxElementResolution9.tsx, 21, 15)) ->y : Symbol(y, Decl(tsxElementResolution9.tsx, 21, 26)) +>n : Symbol(n, Decl(file.tsx, 21, 2)) +>x : Symbol(x, Decl(file.tsx, 21, 15)) +>y : Symbol(y, Decl(file.tsx, 21, 26)) } var Obj3: Obj3; ->Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3)) ->Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3)) +>Obj3 : Symbol(Obj3, Decl(file.tsx, 17, 9), Decl(file.tsx, 23, 3)) +>Obj3 : Symbol(Obj3, Decl(file.tsx, 17, 9), Decl(file.tsx, 23, 3)) ; // OK ->Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3)) +>Obj3 : Symbol(Obj3, Decl(file.tsx, 17, 9), Decl(file.tsx, 23, 3)) >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution9.types b/tests/baselines/reference/tsxElementResolution9.types index 6725bd216bd..dd84e6f07b5 100644 --- a/tests/baselines/reference/tsxElementResolution9.types +++ b/tests/baselines/reference/tsxElementResolution9.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxElementResolution9.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxEmit1.js b/tests/baselines/reference/tsxEmit1.js index baa75526dd7..bfa78a3e96c 100644 --- a/tests/baselines/reference/tsxEmit1.js +++ b/tests/baselines/reference/tsxEmit1.js @@ -1,4 +1,4 @@ -//// [tsxEmit1.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -40,7 +40,7 @@ var whitespace3 =
; -//// [tsxEmit1.jsx] +//// [file.jsx] var p; var selfClosed1 =
; var selfClosed2 =
; diff --git a/tests/baselines/reference/tsxEmit1.symbols b/tests/baselines/reference/tsxEmit1.symbols index aaca98ae9db..9d373bc62be 100644 --- a/tests/baselines/reference/tsxEmit1.symbols +++ b/tests/baselines/reference/tsxEmit1.symbols @@ -1,163 +1,163 @@ -=== tests/cases/conformance/jsx/tsxEmit1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxEmit1.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxEmit1.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxEmit1.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } var p; ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) var selfClosed1 =
; ->selfClosed1 : Symbol(selfClosed1, Decl(tsxEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed1 : Symbol(selfClosed1, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var selfClosed2 =
; ->selfClosed2 : Symbol(selfClosed2, Decl(tsxEmit1.tsx, 9, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed2 : Symbol(selfClosed2, Decl(file.tsx, 9, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) var selfClosed3 =
; ->selfClosed3 : Symbol(selfClosed3, Decl(tsxEmit1.tsx, 10, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed3 : Symbol(selfClosed3, Decl(file.tsx, 10, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) var selfClosed4 =
; ->selfClosed4 : Symbol(selfClosed4, Decl(tsxEmit1.tsx, 11, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed4 : Symbol(selfClosed4, Decl(file.tsx, 11, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed5 =
; ->selfClosed5 : Symbol(selfClosed5, Decl(tsxEmit1.tsx, 12, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed5 : Symbol(selfClosed5, Decl(file.tsx, 12, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed6 =
; ->selfClosed6 : Symbol(selfClosed6, Decl(tsxEmit1.tsx, 13, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed6 : Symbol(selfClosed6, Decl(file.tsx, 13, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed7 =
; ->selfClosed7 : Symbol(selfClosed7, Decl(tsxEmit1.tsx, 14, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>selfClosed7 : Symbol(selfClosed7, Decl(file.tsx, 14, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) >y : Symbol(unknown) var openClosed1 =
; ->openClosed1 : Symbol(openClosed1, Decl(tsxEmit1.tsx, 16, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>openClosed1 : Symbol(openClosed1, Decl(file.tsx, 16, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed2 =
foo
; ->openClosed2 : Symbol(openClosed2, Decl(tsxEmit1.tsx, 17, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>openClosed2 : Symbol(openClosed2, Decl(file.tsx, 17, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed3 =
{p}
; ->openClosed3 : Symbol(openClosed3, Decl(tsxEmit1.tsx, 18, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>openClosed3 : Symbol(openClosed3, Decl(file.tsx, 18, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed4 =
{p < p}
; ->openClosed4 : Symbol(openClosed4, Decl(tsxEmit1.tsx, 19, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>openClosed4 : Symbol(openClosed4, Decl(file.tsx, 19, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed5 =
{p > p}
; ->openClosed5 : Symbol(openClosed5, Decl(tsxEmit1.tsx, 20, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>openClosed5 : Symbol(openClosed5, Decl(file.tsx, 20, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) class SomeClass { ->SomeClass : Symbol(SomeClass, Decl(tsxEmit1.tsx, 20, 43)) +>SomeClass : Symbol(SomeClass, Decl(file.tsx, 20, 43)) f() { ->f : Symbol(f, Decl(tsxEmit1.tsx, 22, 17)) +>f : Symbol(f, Decl(file.tsx, 22, 17)) var rewrites1 =
{() => this}
; ->rewrites1 : Symbol(rewrites1, Decl(tsxEmit1.tsx, 24, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->this : Symbol(SomeClass, Decl(tsxEmit1.tsx, 20, 43)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites1 : Symbol(rewrites1, Decl(file.tsx, 24, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>this : Symbol(SomeClass, Decl(file.tsx, 20, 43)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites2 =
{[p, ...p, p]}
; ->rewrites2 : Symbol(rewrites2, Decl(tsxEmit1.tsx, 25, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites2 : Symbol(rewrites2, Decl(file.tsx, 25, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites3 =
{{p}}
; ->rewrites3 : Symbol(rewrites3, Decl(tsxEmit1.tsx, 26, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 26, 25)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites3 : Symbol(rewrites3, Decl(file.tsx, 26, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 26, 25)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites4 =
this}>
; ->rewrites4 : Symbol(rewrites4, Decl(tsxEmit1.tsx, 28, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites4 : Symbol(rewrites4, Decl(file.tsx, 28, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->this : Symbol(SomeClass, Decl(tsxEmit1.tsx, 20, 43)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>this : Symbol(SomeClass, Decl(file.tsx, 20, 43)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites5 =
; ->rewrites5 : Symbol(rewrites5, Decl(tsxEmit1.tsx, 29, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites5 : Symbol(rewrites5, Decl(file.tsx, 29, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites6 =
; ->rewrites6 : Symbol(rewrites6, Decl(tsxEmit1.tsx, 30, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>rewrites6 : Symbol(rewrites6, Decl(file.tsx, 30, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->p : Symbol(p, Decl(tsxEmit1.tsx, 30, 27)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 30, 27)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) } } var whitespace1 =
; ->whitespace1 : Symbol(whitespace1, Decl(tsxEmit1.tsx, 34, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>whitespace1 : Symbol(whitespace1, Decl(file.tsx, 34, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var whitespace2 =
{p}
; ->whitespace2 : Symbol(whitespace2, Decl(tsxEmit1.tsx, 35, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>whitespace2 : Symbol(whitespace2, Decl(file.tsx, 35, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 7, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var whitespace3 =
->whitespace3 : Symbol(whitespace3, Decl(tsxEmit1.tsx, 36, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>whitespace3 : Symbol(whitespace3, Decl(file.tsx, 36, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) {p} ->p : Symbol(p, Decl(tsxEmit1.tsx, 7, 3)) +>p : Symbol(p, Decl(file.tsx, 7, 3))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit1.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxEmit1.types b/tests/baselines/reference/tsxEmit1.types index c34896b08ad..e6f92bebd1e 100644 --- a/tests/baselines/reference/tsxEmit1.types +++ b/tests/baselines/reference/tsxEmit1.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxEmit1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxEmit2.js b/tests/baselines/reference/tsxEmit2.js index 1101df49a1c..66b1494e825 100644 --- a/tests/baselines/reference/tsxEmit2.js +++ b/tests/baselines/reference/tsxEmit2.js @@ -1,4 +1,4 @@ -//// [tsxEmit2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -14,7 +14,7 @@ var spreads4 =
{p2}
; var spreads5 =
{p2}
; -//// [tsxEmit2.jsx] +//// [file.jsx] var p1, p2, p3; var spreads1 =
{p2}
; var spreads2 =
{p2}
; diff --git a/tests/baselines/reference/tsxEmit2.symbols b/tests/baselines/reference/tsxEmit2.symbols index 5da1b16ae44..13e45e454f1 100644 --- a/tests/baselines/reference/tsxEmit2.symbols +++ b/tests/baselines/reference/tsxEmit2.symbols @@ -1,63 +1,63 @@ -=== tests/cases/conformance/jsx/tsxEmit2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxEmit2.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxEmit2.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxEmit2.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } var p1, p2, p3; ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>p3 : Symbol(p3, Decl(file.tsx, 7, 11)) var spreads1 =
{p2}
; ->spreads1 : Symbol(spreads1, Decl(tsxEmit2.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>spreads1 : Symbol(spreads1, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads2 =
{p2}
; ->spreads2 : Symbol(spreads2, Decl(tsxEmit2.tsx, 9, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>spreads2 : Symbol(spreads2, Decl(file.tsx, 9, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads3 =
{p2}
; ->spreads3 : Symbol(spreads3, Decl(tsxEmit2.tsx, 10, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>spreads3 : Symbol(spreads3, Decl(file.tsx, 10, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11)) ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 7, 11)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads4 =
{p2}
; ->spreads4 : Symbol(spreads4, Decl(tsxEmit2.tsx, 11, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) +>spreads4 : Symbol(spreads4, Decl(file.tsx, 11, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) >x : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 7, 11)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads5 =
{p2}
; ->spreads5 : Symbol(spreads5, Decl(tsxEmit2.tsx, 12, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>spreads5 : Symbol(spreads5, Decl(file.tsx, 12, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>p1 : Symbol(p1, Decl(file.tsx, 7, 3)) >y : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11)) ->p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 7, 11)) +>p2 : Symbol(p2, Decl(file.tsx, 7, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxEmit2.types b/tests/baselines/reference/tsxEmit2.types index f5633b739e3..5b267d8b802 100644 --- a/tests/baselines/reference/tsxEmit2.types +++ b/tests/baselines/reference/tsxEmit2.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxEmit2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxEmit3.js b/tests/baselines/reference/tsxEmit3.js index aa958a0c79b..ccb9041e931 100644 --- a/tests/baselines/reference/tsxEmit3.js +++ b/tests/baselines/reference/tsxEmit3.js @@ -1,4 +1,4 @@ -//// [tsxEmit3.tsx] +//// [file.tsx] declare module JSX { interface Element { } @@ -41,7 +41,7 @@ module M { } -//// [tsxEmit3.jsx] +//// [file.jsx] var M; (function (M) { var Foo = (function () { @@ -83,4 +83,4 @@ var M; // Emit M_1.Foo M_1.Foo, ; })(M || (M = {})); -//# sourceMappingURL=tsxEmit3.jsx.map \ No newline at end of file +//# sourceMappingURL=file.jsx.map \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.js.map b/tests/baselines/reference/tsxEmit3.js.map index 1f1ba0926a0..b53526b5d11 100644 --- a/tests/baselines/reference/tsxEmit3.js.map +++ b/tests/baselines/reference/tsxEmit3.js.map @@ -1,2 +1,2 @@ -//// [tsxEmit3.jsx.map] -{"version":3,"file":"tsxEmit3.jsx","sourceRoot":"","sources":["tsxEmit3.tsx"],"names":["M","M.Foo","M.Foo.constructor","M.S","M.S.Bar","M.S.Bar.constructor"],"mappings":"AAMA,IAAO,CAAC,CAQP;AARD,WAAO,CAAC,EAAC,CAAC;IACTA;QAAmBC;QAAgBC,CAACA;QAACD,UAACA;IAADA,CAACA,AAAtCD,IAAsCA;IAAzBA,KAAGA,MAAsBA,CAAAA;IACtCA,IAAcA,CAACA,CAKdA;IALDA,WAAcA,CAACA,EAACA,CAACA;QAChBG;YAAAC;YAAmBC,CAACA;YAADD,UAACA;QAADA,CAACA,AAApBD,IAAoBA;QAAPA,KAAGA,MAAIA,CAAAA;IAIrBA,CAACA,EALaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAKdA;AACFA,CAACA,EARM,CAAC,KAAD,CAAC,QAQP;AAED,IAAO,CAAC,CAYP;AAZD,WAAO,CAAC,EAAC,CAAC;IACTA,aAAaA;IACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IAEbA,IAAcA,CAACA,CAMdA;IANDA,WAAcA,CAACA,EAACA,CAACA;QAChBG,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;QAEbA,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IACdA,CAACA,EANaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAMdA;AAEFA,CAACA,EAZM,CAAC,KAAD,CAAC,QAYP;AAED,IAAO,CAAC,CAGP;AAHD,WAAO,CAAC,EAAC,CAAC;IACTA,eAAeA;IACfA,GAACA,CAACA,GAAGA,EAAEA,CAACA,GAACA,CAACA,GAAGA,GAAGA,CAACA;AAClBA,CAACA,EAHM,CAAC,KAAD,CAAC,QAGP;AAED,IAAO,CAAC,CAIP;AAJD,WAAO,GAAC,EAAC,CAAC;IACTA,IAAIA,CAACA,GAAGA,GAAGA,CAACA;IACZA,eAAeA;IACfA,OAAGA,EAAEA,CAACA,OAAGA,GAAGA,CAACA;AACdA,CAACA,EAJM,CAAC,KAAD,CAAC,QAIP"} \ No newline at end of file +//// [file.jsx.map] +{"version":3,"file":"file.jsx","sourceRoot":"","sources":["file.tsx"],"names":["M","M.Foo","M.Foo.constructor","M.S","M.S.Bar","M.S.Bar.constructor"],"mappings":"AAMA,IAAO,CAAC,CAQP;AARD,WAAO,CAAC,EAAC,CAAC;IACTA;QAAmBC;QAAgBC,CAACA;QAACD,UAACA;IAADA,CAACA,AAAtCD,IAAsCA;IAAzBA,KAAGA,MAAsBA,CAAAA;IACtCA,IAAcA,CAACA,CAKdA;IALDA,WAAcA,CAACA,EAACA,CAACA;QAChBG;YAAAC;YAAmBC,CAACA;YAADD,UAACA;QAADA,CAACA,AAApBD,IAAoBA;QAAPA,KAAGA,MAAIA,CAAAA;IAIrBA,CAACA,EALaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAKdA;AACFA,CAACA,EARM,CAAC,KAAD,CAAC,QAQP;AAED,IAAO,CAAC,CAYP;AAZD,WAAO,CAAC,EAAC,CAAC;IACTA,aAAaA;IACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IAEbA,IAAcA,CAACA,CAMdA;IANDA,WAAcA,CAACA,EAACA,CAACA;QAChBG,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;QAEbA,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IACdA,CAACA,EANaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAMdA;AAEFA,CAACA,EAZM,CAAC,KAAD,CAAC,QAYP;AAED,IAAO,CAAC,CAGP;AAHD,WAAO,CAAC,EAAC,CAAC;IACTA,eAAeA;IACfA,GAACA,CAACA,GAAGA,EAAEA,CAACA,GAACA,CAACA,GAAGA,GAAGA,CAACA;AAClBA,CAACA,EAHM,CAAC,KAAD,CAAC,QAGP;AAED,IAAO,CAAC,CAIP;AAJD,WAAO,GAAC,EAAC,CAAC;IACTA,IAAIA,CAACA,GAAGA,GAAGA,CAACA;IACZA,eAAeA;IACfA,OAAGA,EAAEA,CAACA,OAAGA,GAAGA,CAACA;AACdA,CAACA,EAJM,CAAC,KAAD,CAAC,QAIP"} \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.sourcemap.txt b/tests/baselines/reference/tsxEmit3.sourcemap.txt index 514be1e532d..770221ebcb5 100644 --- a/tests/baselines/reference/tsxEmit3.sourcemap.txt +++ b/tests/baselines/reference/tsxEmit3.sourcemap.txt @@ -1,12 +1,12 @@ =================================================================== -JsFile: tsxEmit3.jsx -mapUrl: tsxEmit3.jsx.map +JsFile: file.jsx +mapUrl: file.jsx.map sourceRoot: -sources: tsxEmit3.tsx +sources: file.tsx =================================================================== ------------------------------------------------------------------- -emittedFile:tests/cases/conformance/jsx/tsxEmit3.jsx -sourceFile:tsxEmit3.tsx +emittedFile:tests/cases/conformance/jsx/file.jsx +sourceFile:file.tsx ------------------------------------------------------------------- >>>var M; 1 > @@ -761,7 +761,7 @@ sourceFile:tsxEmit3.tsx 5 > ^^^^^ 6 > ^ 7 > ^^^^^^^^ -8 > ^^^^^^^^^^^^^^^^^^-> +8 > ^^^^^^^^^^^^^^-> 1 > > 2 >} @@ -782,4 +782,4 @@ sourceFile:tsxEmit3.tsx 6 >Emitted(41, 11) Source(36, 9) + SourceIndex(0) 7 >Emitted(41, 19) Source(40, 2) + SourceIndex(0) --- ->>>//# sourceMappingURL=tsxEmit3.jsx.map \ No newline at end of file +>>>//# sourceMappingURL=file.jsx.map \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.symbols b/tests/baselines/reference/tsxEmit3.symbols index 64542d125b9..3b88d4e0371 100644 --- a/tests/baselines/reference/tsxEmit3.symbols +++ b/tests/baselines/reference/tsxEmit3.symbols @@ -1,26 +1,26 @@ -=== tests/cases/conformance/jsx/tsxEmit3.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxEmit3.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxEmit3.tsx, 1, 20)) +>Element : Symbol(Element, Decl(file.tsx, 1, 20)) interface IntrinsicElements { } ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxEmit3.tsx, 2, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22)) } module M { ->M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1)) +>M : Symbol(M, Decl(file.tsx, 4, 1), Decl(file.tsx, 14, 1), Decl(file.tsx, 28, 1), Decl(file.tsx, 33, 1)) export class Foo { constructor() { } } ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) export module S { ->S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14)) +>S : Symbol(S, Decl(file.tsx, 7, 39), Decl(file.tsx, 18, 14)) export class Bar { } ->Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18)) +>Bar : Symbol(Bar, Decl(file.tsx, 8, 18)) // Emit Foo // Foo, ; @@ -28,49 +28,49 @@ module M { } module M { ->M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1)) +>M : Symbol(M, Decl(file.tsx, 4, 1), Decl(file.tsx, 14, 1), Decl(file.tsx, 28, 1), Decl(file.tsx, 33, 1)) // Emit M.Foo Foo, ; ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) export module S { ->S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14)) +>S : Symbol(S, Decl(file.tsx, 7, 39), Decl(file.tsx, 18, 14)) // Emit M.Foo Foo, ; ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) // Emit S.Bar Bar, ; ->Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18)) ->Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18)) +>Bar : Symbol(Bar, Decl(file.tsx, 8, 18)) +>Bar : Symbol(Bar, Decl(file.tsx, 8, 18)) } } module M { ->M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1)) +>M : Symbol(M, Decl(file.tsx, 4, 1), Decl(file.tsx, 14, 1), Decl(file.tsx, 28, 1), Decl(file.tsx, 33, 1)) // Emit M.S.Bar S.Bar, ; ->S.Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18)) ->S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14)) ->Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18)) ->Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18)) +>S.Bar : Symbol(S.Bar, Decl(file.tsx, 8, 18)) +>S : Symbol(S, Decl(file.tsx, 7, 39), Decl(file.tsx, 18, 14)) +>Bar : Symbol(S.Bar, Decl(file.tsx, 8, 18)) +>Bar : Symbol(S.Bar, Decl(file.tsx, 8, 18)) } module M { ->M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1)) +>M : Symbol(M, Decl(file.tsx, 4, 1), Decl(file.tsx, 14, 1), Decl(file.tsx, 28, 1), Decl(file.tsx, 33, 1)) var M = 100; ->M : Symbol(M, Decl(tsxEmit3.tsx, 36, 4)) +>M : Symbol(M, Decl(file.tsx, 36, 4)) // Emit M_1.Foo Foo, ; ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) ->Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) +>Foo : Symbol(Foo, Decl(file.tsx, 6, 10)) } diff --git a/tests/baselines/reference/tsxEmit3.types b/tests/baselines/reference/tsxEmit3.types index f4db9a3f36f..49a5cf8a51b 100644 --- a/tests/baselines/reference/tsxEmit3.types +++ b/tests/baselines/reference/tsxEmit3.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxEmit3.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxErrorRecovery1.errors.txt b/tests/baselines/reference/tsxErrorRecovery1.errors.txt index 7aea986526b..0937b0d37ac 100644 --- a/tests/baselines/reference/tsxErrorRecovery1.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsx/tsxErrorRecovery1.tsx(5,19): error TS1109: Expression expected. -tests/cases/conformance/jsx/tsxErrorRecovery1.tsx(8,11): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/tsxErrorRecovery1.tsx(8,12): error TS1005: '}' expected. -tests/cases/conformance/jsx/tsxErrorRecovery1.tsx(9,1): error TS17002: Expected corresponding JSX closing tag for 'div'. +tests/cases/conformance/jsx/file.tsx(5,19): error TS1109: Expression expected. +tests/cases/conformance/jsx/file.tsx(8,11): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/file.tsx(8,12): error TS1005: '}' expected. +tests/cases/conformance/jsx/file.tsx(9,1): error TS17002: Expected corresponding JSX closing tag for 'div'. -==== tests/cases/conformance/jsx/tsxErrorRecovery1.tsx (4 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== declare namespace JSX { interface Element { } } diff --git a/tests/baselines/reference/tsxErrorRecovery1.js b/tests/baselines/reference/tsxErrorRecovery1.js index 62db6b0f012..6b9d2d5de47 100644 --- a/tests/baselines/reference/tsxErrorRecovery1.js +++ b/tests/baselines/reference/tsxErrorRecovery1.js @@ -1,4 +1,4 @@ -//// [tsxErrorRecovery1.tsx] +//// [file.tsx] declare namespace JSX { interface Element { } } @@ -9,7 +9,7 @@ function foo() { var y = { a: 1 }; -//// [tsxErrorRecovery1.jsx] +//// [file.jsx] function foo() { var x =
{}div> } diff --git a/tests/baselines/reference/tsxExternalModuleEmit2.js b/tests/baselines/reference/tsxExternalModuleEmit2.js index f8fe6096090..9968fa8d708 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit2.js +++ b/tests/baselines/reference/tsxExternalModuleEmit2.js @@ -20,6 +20,6 @@ declare var Foo, React; //// [app.js] var mod_1 = require('mod'); // Should see mod_1['default'] in emit here -React.createElement(Foo, {"handler": mod_1["default"]}); +React.createElement(Foo, {handler: mod_1["default"]}); // Should see mod_1['default'] in emit here React.createElement(Foo, React.__spread({}, mod_1["default"])); diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.js b/tests/baselines/reference/tsxGenericArrowFunctionParsing.js index ece48831f8e..e77e832cb0a 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.js +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.js @@ -1,4 +1,4 @@ -//// [tsxGenericArrowFunctionParsing.tsx] +//// [file.tsx] declare module JSX { interface Element { isElement; } } @@ -27,7 +27,7 @@ x5.isElement; -//// [tsxGenericArrowFunctionParsing.jsx] +//// [file.jsx] var T, T1, T2; // This is an element var x1 = () => ; diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols b/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols index 3bfd5505e76..85dec56b2f8 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols @@ -1,67 +1,67 @@ -=== tests/cases/conformance/jsx/tsxGenericArrowFunctionParsing.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxGenericArrowFunctionParsing.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { isElement; } ->Element : Symbol(Element, Decl(tsxGenericArrowFunctionParsing.tsx, 0, 20)) ->isElement : Symbol(isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) +>isElement : Symbol(isElement, Decl(file.tsx, 1, 20)) } var T, T1, T2; ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) ->T1 : Symbol(T1, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 6)) ->T2 : Symbol(T2, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 10)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) +>T1 : Symbol(T1, Decl(file.tsx, 4, 6)) +>T2 : Symbol(T2, Decl(file.tsx, 4, 10)) // This is an element var x1 = () => {}; ->x1 : Symbol(x1, Decl(tsxGenericArrowFunctionParsing.tsx, 7, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) +>x1 : Symbol(x1, Decl(file.tsx, 7, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) x1.isElement; ->x1.isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) ->x1 : Symbol(x1, Decl(tsxGenericArrowFunctionParsing.tsx, 7, 3)) ->isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) +>x1.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) +>x1 : Symbol(x1, Decl(file.tsx, 7, 3)) +>isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) // This is a generic function var x2 = () => {}; ->x2 : Symbol(x2, Decl(tsxGenericArrowFunctionParsing.tsx, 11, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 11, 10)) +>x2 : Symbol(x2, Decl(file.tsx, 11, 3)) +>T : Symbol(T, Decl(file.tsx, 11, 10)) x2(); ->x2 : Symbol(x2, Decl(tsxGenericArrowFunctionParsing.tsx, 11, 3)) +>x2 : Symbol(x2, Decl(file.tsx, 11, 3)) // This is a generic function var x3 = () => {}; ->x3 : Symbol(x3, Decl(tsxGenericArrowFunctionParsing.tsx, 15, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 15, 10)) ->T1 : Symbol(T1, Decl(tsxGenericArrowFunctionParsing.tsx, 15, 12)) +>x3 : Symbol(x3, Decl(file.tsx, 15, 3)) +>T : Symbol(T, Decl(file.tsx, 15, 10)) +>T1 : Symbol(T1, Decl(file.tsx, 15, 12)) x3(); ->x3 : Symbol(x3, Decl(tsxGenericArrowFunctionParsing.tsx, 15, 3)) +>x3 : Symbol(x3, Decl(file.tsx, 15, 3)) // This is an element var x4 = () => {}; ->x4 : Symbol(x4, Decl(tsxGenericArrowFunctionParsing.tsx, 19, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) +>x4 : Symbol(x4, Decl(file.tsx, 19, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) >extends : Symbol(unknown) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) x4.isElement; ->x4.isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) ->x4 : Symbol(x4, Decl(tsxGenericArrowFunctionParsing.tsx, 19, 3)) ->isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) +>x4.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) +>x4 : Symbol(x4, Decl(file.tsx, 19, 3)) +>isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) // This is an element var x5 = () => {}; ->x5 : Symbol(x5, Decl(tsxGenericArrowFunctionParsing.tsx, 23, 3)) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) +>x5 : Symbol(x5, Decl(file.tsx, 23, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) >extends : Symbol(unknown) ->T : Symbol(T, Decl(tsxGenericArrowFunctionParsing.tsx, 4, 3)) +>T : Symbol(T, Decl(file.tsx, 4, 3)) x5.isElement; ->x5.isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) ->x5 : Symbol(x5, Decl(tsxGenericArrowFunctionParsing.tsx, 23, 3)) ->isElement : Symbol(JSX.Element.isElement, Decl(tsxGenericArrowFunctionParsing.tsx, 1, 20)) +>x5.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) +>x5 : Symbol(x5, Decl(file.tsx, 23, 3)) +>isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20)) diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types index a7d98d35b64..d5a9436872a 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxGenericArrowFunctionParsing.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxOpeningClosingNames.js b/tests/baselines/reference/tsxOpeningClosingNames.js index 80adad0f406..d704d43b5ba 100644 --- a/tests/baselines/reference/tsxOpeningClosingNames.js +++ b/tests/baselines/reference/tsxOpeningClosingNames.js @@ -1,4 +1,4 @@ -//// [tsxOpeningClosingNames.tsx] +//// [file.tsx] declare module JSX { interface Element { } } @@ -10,5 +10,5 @@ declare module A.B.C { foo -//// [tsxOpeningClosingNames.jsx] +//// [file.jsx] foo; diff --git a/tests/baselines/reference/tsxOpeningClosingNames.symbols b/tests/baselines/reference/tsxOpeningClosingNames.symbols index e9734fb5ee1..08da0bf05fb 100644 --- a/tests/baselines/reference/tsxOpeningClosingNames.symbols +++ b/tests/baselines/reference/tsxOpeningClosingNames.symbols @@ -1,18 +1,18 @@ -=== tests/cases/conformance/jsx/tsxOpeningClosingNames.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxOpeningClosingNames.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxOpeningClosingNames.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) } declare module A.B.C { ->A : Symbol(A, Decl(tsxOpeningClosingNames.tsx, 2, 1)) ->B : Symbol(B, Decl(tsxOpeningClosingNames.tsx, 4, 17)) ->C : Symbol(C, Decl(tsxOpeningClosingNames.tsx, 4, 19)) +>A : Symbol(A, Decl(file.tsx, 2, 1)) +>B : Symbol(B, Decl(file.tsx, 4, 17)) +>C : Symbol(C, Decl(file.tsx, 4, 19)) var D: any; ->D : Symbol(D, Decl(tsxOpeningClosingNames.tsx, 5, 5)) +>D : Symbol(D, Decl(file.tsx, 5, 5)) } foo diff --git a/tests/baselines/reference/tsxOpeningClosingNames.types b/tests/baselines/reference/tsxOpeningClosingNames.types index b02564ae104..ac36205029e 100644 --- a/tests/baselines/reference/tsxOpeningClosingNames.types +++ b/tests/baselines/reference/tsxOpeningClosingNames.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxOpeningClosingNames.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxParseTests1.js b/tests/baselines/reference/tsxParseTests1.js index 7ab98cab314..c427a49cb0c 100644 --- a/tests/baselines/reference/tsxParseTests1.js +++ b/tests/baselines/reference/tsxParseTests1.js @@ -1,4 +1,4 @@ -//// [tsxParseTests1.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { div; span; } @@ -7,5 +7,5 @@ declare module JSX { var x =
; -//// [tsxParseTests1.jsx] +//// [file.jsx] var x =
; diff --git a/tests/baselines/reference/tsxParseTests1.symbols b/tests/baselines/reference/tsxParseTests1.symbols index f7b179f254f..0ee595a9a3d 100644 --- a/tests/baselines/reference/tsxParseTests1.symbols +++ b/tests/baselines/reference/tsxParseTests1.symbols @@ -1,24 +1,24 @@ -=== tests/cases/conformance/jsx/tsxParseTests1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxParseTests1.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxParseTests1.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { div; span; } ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxParseTests1.tsx, 1, 22)) ->div : Symbol(div, Decl(tsxParseTests1.tsx, 2, 30)) ->span : Symbol(span, Decl(tsxParseTests1.tsx, 2, 35)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(div, Decl(file.tsx, 2, 30)) +>span : Symbol(span, Decl(file.tsx, 2, 35)) } var x =
; ->x : Symbol(x, Decl(tsxParseTests1.tsx, 5, 3)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) ->span : Symbol(JSX.IntrinsicElements.span, Decl(tsxParseTests1.tsx, 2, 35)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) ->span : Symbol(JSX.IntrinsicElements.span, Decl(tsxParseTests1.tsx, 2, 35)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests1.tsx, 2, 30)) +>x : Symbol(x, Decl(file.tsx, 5, 3)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>span : Symbol(JSX.IntrinsicElements.span, Decl(file.tsx, 2, 35)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>span : Symbol(JSX.IntrinsicElements.span, Decl(file.tsx, 2, 35)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) diff --git a/tests/baselines/reference/tsxParseTests1.types b/tests/baselines/reference/tsxParseTests1.types index 78e49a227e2..375791fe4bb 100644 --- a/tests/baselines/reference/tsxParseTests1.types +++ b/tests/baselines/reference/tsxParseTests1.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxParseTests1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxParseTests2.js b/tests/baselines/reference/tsxParseTests2.js index c179d75776a..b0cf54f8d1f 100644 --- a/tests/baselines/reference/tsxParseTests2.js +++ b/tests/baselines/reference/tsxParseTests2.js @@ -1,4 +1,4 @@ -//// [tsxParseTests2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { div; span; } @@ -7,5 +7,5 @@ declare module JSX { var x =
; -//// [tsxParseTests2.jsx] +//// [file.jsx] var x =
; diff --git a/tests/baselines/reference/tsxParseTests2.symbols b/tests/baselines/reference/tsxParseTests2.symbols index 17b612df786..690bc183ddd 100644 --- a/tests/baselines/reference/tsxParseTests2.symbols +++ b/tests/baselines/reference/tsxParseTests2.symbols @@ -1,18 +1,18 @@ -=== tests/cases/conformance/jsx/tsxParseTests2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxParseTests2.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxParseTests2.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { div; span; } ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxParseTests2.tsx, 1, 22)) ->div : Symbol(div, Decl(tsxParseTests2.tsx, 2, 30)) ->span : Symbol(span, Decl(tsxParseTests2.tsx, 2, 35)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(div, Decl(file.tsx, 2, 30)) +>span : Symbol(span, Decl(file.tsx, 2, 35)) } var x =
; ->x : Symbol(x, Decl(tsxParseTests2.tsx, 5, 3)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests2.tsx, 2, 30)) ->div : Symbol(JSX.IntrinsicElements.div, Decl(tsxParseTests2.tsx, 2, 30)) +>x : Symbol(x, Decl(file.tsx, 5, 3)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 2, 30)) diff --git a/tests/baselines/reference/tsxParseTests2.types b/tests/baselines/reference/tsxParseTests2.types index 5714a4d3483..16a70a55f6a 100644 --- a/tests/baselines/reference/tsxParseTests2.types +++ b/tests/baselines/reference/tsxParseTests2.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxParseTests2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxReactEmit1.js b/tests/baselines/reference/tsxReactEmit1.js index 260bd9cd228..5b13c463bd6 100644 --- a/tests/baselines/reference/tsxReactEmit1.js +++ b/tests/baselines/reference/tsxReactEmit1.js @@ -1,4 +1,4 @@ -//// [tsxReactEmit1.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -41,7 +41,7 @@ var whitespace3 =
; -//// [tsxReactEmit1.js] +//// [file.js] var p; var selfClosed1 = React.createElement("div", null); var selfClosed2 = React.createElement("div", {x: "1"}); diff --git a/tests/baselines/reference/tsxReactEmit1.symbols b/tests/baselines/reference/tsxReactEmit1.symbols index 4149142dd82..640f666c0d8 100644 --- a/tests/baselines/reference/tsxReactEmit1.symbols +++ b/tests/baselines/reference/tsxReactEmit1.symbols @@ -1,167 +1,167 @@ -=== tests/cases/conformance/jsx/tsxReactEmit1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxReactEmit1.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxReactEmit1.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxReactEmit1.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } declare var React: any; ->React : Symbol(React, Decl(tsxReactEmit1.tsx, 6, 11)) +>React : Symbol(React, Decl(file.tsx, 6, 11)) var p; ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) var selfClosed1 =
; ->selfClosed1 : Symbol(selfClosed1, Decl(tsxReactEmit1.tsx, 9, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed1 : Symbol(selfClosed1, Decl(file.tsx, 9, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var selfClosed2 =
; ->selfClosed2 : Symbol(selfClosed2, Decl(tsxReactEmit1.tsx, 10, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed2 : Symbol(selfClosed2, Decl(file.tsx, 10, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) var selfClosed3 =
; ->selfClosed3 : Symbol(selfClosed3, Decl(tsxReactEmit1.tsx, 11, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed3 : Symbol(selfClosed3, Decl(file.tsx, 11, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) var selfClosed4 =
; ->selfClosed4 : Symbol(selfClosed4, Decl(tsxReactEmit1.tsx, 12, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed4 : Symbol(selfClosed4, Decl(file.tsx, 12, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed5 =
; ->selfClosed5 : Symbol(selfClosed5, Decl(tsxReactEmit1.tsx, 13, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed5 : Symbol(selfClosed5, Decl(file.tsx, 13, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed6 =
; ->selfClosed6 : Symbol(selfClosed6, Decl(tsxReactEmit1.tsx, 14, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed6 : Symbol(selfClosed6, Decl(file.tsx, 14, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) >y : Symbol(unknown) var selfClosed7 =
; ->selfClosed7 : Symbol(selfClosed7, Decl(tsxReactEmit1.tsx, 15, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>selfClosed7 : Symbol(selfClosed7, Decl(file.tsx, 15, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) >y : Symbol(unknown) >b : Symbol(unknown) var openClosed1 =
; ->openClosed1 : Symbol(openClosed1, Decl(tsxReactEmit1.tsx, 17, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>openClosed1 : Symbol(openClosed1, Decl(file.tsx, 17, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed2 =
foo
; ->openClosed2 : Symbol(openClosed2, Decl(tsxReactEmit1.tsx, 18, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>openClosed2 : Symbol(openClosed2, Decl(file.tsx, 18, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed3 =
{p}
; ->openClosed3 : Symbol(openClosed3, Decl(tsxReactEmit1.tsx, 19, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>openClosed3 : Symbol(openClosed3, Decl(file.tsx, 19, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed4 =
{p < p}
; ->openClosed4 : Symbol(openClosed4, Decl(tsxReactEmit1.tsx, 20, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>openClosed4 : Symbol(openClosed4, Decl(file.tsx, 20, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var openClosed5 =
{p > p}
; ->openClosed5 : Symbol(openClosed5, Decl(tsxReactEmit1.tsx, 21, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>openClosed5 : Symbol(openClosed5, Decl(file.tsx, 21, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >n : Symbol(unknown) >b : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) class SomeClass { ->SomeClass : Symbol(SomeClass, Decl(tsxReactEmit1.tsx, 21, 45)) +>SomeClass : Symbol(SomeClass, Decl(file.tsx, 21, 45)) f() { ->f : Symbol(f, Decl(tsxReactEmit1.tsx, 23, 17)) +>f : Symbol(f, Decl(file.tsx, 23, 17)) var rewrites1 =
{() => this}
; ->rewrites1 : Symbol(rewrites1, Decl(tsxReactEmit1.tsx, 25, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->this : Symbol(SomeClass, Decl(tsxReactEmit1.tsx, 21, 45)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites1 : Symbol(rewrites1, Decl(file.tsx, 25, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>this : Symbol(SomeClass, Decl(file.tsx, 21, 45)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites2 =
{[p, ...p, p]}
; ->rewrites2 : Symbol(rewrites2, Decl(tsxReactEmit1.tsx, 26, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites2 : Symbol(rewrites2, Decl(file.tsx, 26, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites3 =
{{p}}
; ->rewrites3 : Symbol(rewrites3, Decl(tsxReactEmit1.tsx, 27, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 27, 25)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites3 : Symbol(rewrites3, Decl(file.tsx, 27, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 27, 25)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites4 =
this}>
; ->rewrites4 : Symbol(rewrites4, Decl(tsxReactEmit1.tsx, 29, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites4 : Symbol(rewrites4, Decl(file.tsx, 29, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->this : Symbol(SomeClass, Decl(tsxReactEmit1.tsx, 21, 45)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>this : Symbol(SomeClass, Decl(file.tsx, 21, 45)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites5 =
; ->rewrites5 : Symbol(rewrites5, Decl(tsxReactEmit1.tsx, 30, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites5 : Symbol(rewrites5, Decl(file.tsx, 30, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var rewrites6 =
; ->rewrites6 : Symbol(rewrites6, Decl(tsxReactEmit1.tsx, 31, 5)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>rewrites6 : Symbol(rewrites6, Decl(file.tsx, 31, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >a : Symbol(unknown) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 31, 27)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 31, 27)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) } } var whitespace1 =
; ->whitespace1 : Symbol(whitespace1, Decl(tsxReactEmit1.tsx, 35, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>whitespace1 : Symbol(whitespace1, Decl(file.tsx, 35, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var whitespace2 =
{p}
; ->whitespace2 : Symbol(whitespace2, Decl(tsxReactEmit1.tsx, 36, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>whitespace2 : Symbol(whitespace2, Decl(file.tsx, 36, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 8, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var whitespace3 =
->whitespace3 : Symbol(whitespace3, Decl(tsxReactEmit1.tsx, 37, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>whitespace3 : Symbol(whitespace3, Decl(file.tsx, 37, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) {p} ->p : Symbol(p, Decl(tsxReactEmit1.tsx, 8, 3)) +>p : Symbol(p, Decl(file.tsx, 8, 3))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit1.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxReactEmit1.types b/tests/baselines/reference/tsxReactEmit1.types index 4afe4be01dc..d837eb007bf 100644 --- a/tests/baselines/reference/tsxReactEmit1.types +++ b/tests/baselines/reference/tsxReactEmit1.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmit1.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxReactEmit2.js b/tests/baselines/reference/tsxReactEmit2.js index 4b2b4695561..fd7fff16976 100644 --- a/tests/baselines/reference/tsxReactEmit2.js +++ b/tests/baselines/reference/tsxReactEmit2.js @@ -1,4 +1,4 @@ -//// [tsxReactEmit2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -15,7 +15,7 @@ var spreads4 =
{p2}
; var spreads5 =
{p2}
; -//// [tsxReactEmit2.js] +//// [file.js] var p1, p2, p3; var spreads1 = React.createElement("div", React.__spread({}, p1), p2); var spreads2 = React.createElement("div", React.__spread({}, p1), p2); diff --git a/tests/baselines/reference/tsxReactEmit2.symbols b/tests/baselines/reference/tsxReactEmit2.symbols index 051f7588f25..68f33a11f09 100644 --- a/tests/baselines/reference/tsxReactEmit2.symbols +++ b/tests/baselines/reference/tsxReactEmit2.symbols @@ -1,65 +1,65 @@ -=== tests/cases/conformance/jsx/tsxReactEmit2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxReactEmit2.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxReactEmit2.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxReactEmit2.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } declare var React: any; ->React : Symbol(React, Decl(tsxReactEmit2.tsx, 6, 11)) +>React : Symbol(React, Decl(file.tsx, 6, 11)) var p1, p2, p3; ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->p3 : Symbol(p3, Decl(tsxReactEmit2.tsx, 8, 11)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>p3 : Symbol(p3, Decl(file.tsx, 8, 11)) var spreads1 =
{p2}
; ->spreads1 : Symbol(spreads1, Decl(tsxReactEmit2.tsx, 9, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>spreads1 : Symbol(spreads1, Decl(file.tsx, 9, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads2 =
{p2}
; ->spreads2 : Symbol(spreads2, Decl(tsxReactEmit2.tsx, 10, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>spreads2 : Symbol(spreads2, Decl(file.tsx, 10, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads3 =
{p2}
; ->spreads3 : Symbol(spreads3, Decl(tsxReactEmit2.tsx, 11, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>spreads3 : Symbol(spreads3, Decl(file.tsx, 11, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxReactEmit2.tsx, 8, 11)) ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 8, 11)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads4 =
{p2}
; ->spreads4 : Symbol(spreads4, Decl(tsxReactEmit2.tsx, 12, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) +>spreads4 : Symbol(spreads4, Decl(file.tsx, 12, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) >x : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxReactEmit2.tsx, 8, 11)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 8, 11)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) var spreads5 =
{p2}
; ->spreads5 : Symbol(spreads5, Decl(tsxReactEmit2.tsx, 13, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>spreads5 : Symbol(spreads5, Decl(file.tsx, 13, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >x : Symbol(unknown) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->p1 : Symbol(p1, Decl(tsxReactEmit2.tsx, 8, 3)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>p1 : Symbol(p1, Decl(file.tsx, 8, 3)) >y : Symbol(unknown) ->p3 : Symbol(p3, Decl(tsxReactEmit2.tsx, 8, 11)) ->p2 : Symbol(p2, Decl(tsxReactEmit2.tsx, 8, 7)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmit2.tsx, 1, 22)) +>p3 : Symbol(p3, Decl(file.tsx, 8, 11)) +>p2 : Symbol(p2, Decl(file.tsx, 8, 7)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxReactEmit2.types b/tests/baselines/reference/tsxReactEmit2.types index e28910b62c7..928eeecadfa 100644 --- a/tests/baselines/reference/tsxReactEmit2.types +++ b/tests/baselines/reference/tsxReactEmit2.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmit2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxReactEmit3.js b/tests/baselines/reference/tsxReactEmit3.js index 23910548534..bd42177e187 100644 --- a/tests/baselines/reference/tsxReactEmit3.js +++ b/tests/baselines/reference/tsxReactEmit3.js @@ -1,4 +1,4 @@ -//// [tsxReactEmit3.tsx] +//// [test.tsx] declare module JSX { interface Element { } } declare var React: any; @@ -7,5 +7,5 @@ declare var Foo, Bar, baz; q s ; -//// [tsxReactEmit3.js] +//// [test.js] React.createElement(Foo, null, " ", React.createElement(Bar, null, " q "), " ", React.createElement(Bar, null), " s ", React.createElement(Bar, null), React.createElement(Bar, null)); diff --git a/tests/baselines/reference/tsxReactEmit3.symbols b/tests/baselines/reference/tsxReactEmit3.symbols index 042488cf04c..cec45805c1e 100644 --- a/tests/baselines/reference/tsxReactEmit3.symbols +++ b/tests/baselines/reference/tsxReactEmit3.symbols @@ -1,23 +1,23 @@ -=== tests/cases/conformance/jsx/tsxReactEmit3.tsx === +=== tests/cases/conformance/jsx/test.tsx === declare module JSX { interface Element { } } ->JSX : Symbol(JSX, Decl(tsxReactEmit3.tsx, 0, 0)) ->Element : Symbol(Element, Decl(tsxReactEmit3.tsx, 1, 20)) +>JSX : Symbol(JSX, Decl(test.tsx, 0, 0)) +>Element : Symbol(Element, Decl(test.tsx, 1, 20)) declare var React: any; ->React : Symbol(React, Decl(tsxReactEmit3.tsx, 2, 11)) +>React : Symbol(React, Decl(test.tsx, 2, 11)) declare var Foo, Bar, baz; ->Foo : Symbol(Foo, Decl(tsxReactEmit3.tsx, 4, 11)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->baz : Symbol(baz, Decl(tsxReactEmit3.tsx, 4, 21)) +>Foo : Symbol(Foo, Decl(test.tsx, 4, 11)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>baz : Symbol(baz, Decl(test.tsx, 4, 21)) q s ; ->Foo : Symbol(Foo, Decl(tsxReactEmit3.tsx, 4, 11)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->Bar : Symbol(Bar, Decl(tsxReactEmit3.tsx, 4, 16)) ->Foo : Symbol(Foo, Decl(tsxReactEmit3.tsx, 4, 11)) +>Foo : Symbol(Foo, Decl(test.tsx, 4, 11)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>Bar : Symbol(Bar, Decl(test.tsx, 4, 16)) +>Foo : Symbol(Foo, Decl(test.tsx, 4, 11)) diff --git a/tests/baselines/reference/tsxReactEmit3.types b/tests/baselines/reference/tsxReactEmit3.types index 8babe724fa1..8416ec015b2 100644 --- a/tests/baselines/reference/tsxReactEmit3.types +++ b/tests/baselines/reference/tsxReactEmit3.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmit3.tsx === +=== tests/cases/conformance/jsx/test.tsx === declare module JSX { interface Element { } } >JSX : any diff --git a/tests/baselines/reference/tsxReactEmit4.errors.txt b/tests/baselines/reference/tsxReactEmit4.errors.txt index fca2b028237..23578d4ed91 100644 --- a/tests/baselines/reference/tsxReactEmit4.errors.txt +++ b/tests/baselines/reference/tsxReactEmit4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/tsxReactEmit4.tsx(12,5): error TS2304: Cannot find name 'blah'. +tests/cases/conformance/jsx/file.tsx(12,5): error TS2304: Cannot find name 'blah'. -==== tests/cases/conformance/jsx/tsxReactEmit4.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { diff --git a/tests/baselines/reference/tsxReactEmit4.js b/tests/baselines/reference/tsxReactEmit4.js index dcbfafcef2f..d61cea24d2c 100644 --- a/tests/baselines/reference/tsxReactEmit4.js +++ b/tests/baselines/reference/tsxReactEmit4.js @@ -1,4 +1,4 @@ -//// [tsxReactEmit4.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -17,7 +17,7 @@ var openClosed1 =
// Should emit React.__spread({}, p, {x: 0}) var spread1 =
; -//// [tsxReactEmit4.js] +//// [file.js] var p; var openClosed1 = React.createElement("div", null, blah); // Should emit React.__spread({}, p, {x: 0}) diff --git a/tests/baselines/reference/tsxReactEmit7.errors.txt b/tests/baselines/reference/tsxReactEmit7.errors.txt new file mode 100644 index 00000000000..d151c2e349c --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit7.errors.txt @@ -0,0 +1,50 @@ +tests/cases/conformance/jsx/file.tsx(9,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(10,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(11,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(12,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(15,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(16,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(17,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(18,10): error TS2304: Cannot find name 'React'. +tests/cases/conformance/jsx/file.tsx(19,10): error TS2304: Cannot find name 'React'. + + +==== tests/cases/conformance/jsx/file.tsx (9 errors) ==== + + declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + + var m =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var n =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var o =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var p =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + + // Investigation + var a =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var b =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var c =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var d =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + var e =
; + ~~~ +!!! error TS2304: Cannot find name 'React'. + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit7.js b/tests/baselines/reference/tsxReactEmit7.js new file mode 100644 index 00000000000..44d28c2dd9c --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit7.js @@ -0,0 +1,33 @@ +//// [file.tsx] + +declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } +} + +var m =
; +var n =
; +var o =
; +var p =
; + +// Investigation +var a =
; +var b =
; +var c =
; +var d =
; +var e =
; + + +//// [file.js] +var m = React.createElement("div", {"x-y": "val"}); +var n = React.createElement("div", {"xx-y": "val"}); +var o = React.createElement("div", {"x-yy": "val"}); +var p = React.createElement("div", {"xx-yy": "val"}); +// Investigation +var a = React.createElement("div", {x: "val"}); +var b = React.createElement("div", {xx: "val"}); +var c = React.createElement("div", {xxx: "val"}); +var d = React.createElement("div", {xxxx: "val"}); +var e = React.createElement("div", {xxxxx: "val"}); diff --git a/tests/baselines/reference/tsxReactEmitEntities.js b/tests/baselines/reference/tsxReactEmitEntities.js index 7517c85fc73..c1fba50fd8f 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.js +++ b/tests/baselines/reference/tsxReactEmitEntities.js @@ -1,4 +1,4 @@ -//// [tsxReactEmitEntities.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -10,5 +10,5 @@ declare var React: any;
Dot goes here: · ¬AnEntity;
; -//// [tsxReactEmitEntities.js] +//// [file.js] React.createElement("div", null, "Dot goes here: · ¬AnEntity; "); diff --git a/tests/baselines/reference/tsxReactEmitEntities.symbols b/tests/baselines/reference/tsxReactEmitEntities.symbols index 7de35241a3a..b633f57ec13 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.symbols +++ b/tests/baselines/reference/tsxReactEmitEntities.symbols @@ -1,21 +1,21 @@ -=== tests/cases/conformance/jsx/tsxReactEmitEntities.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxReactEmitEntities.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxReactEmitEntities.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxReactEmitEntities.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxReactEmitEntities.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } declare var React: any; ->React : Symbol(React, Decl(tsxReactEmitEntities.tsx, 6, 11)) +>React : Symbol(React, Decl(file.tsx, 6, 11))
Dot goes here: · ¬AnEntity;
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitEntities.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitEntities.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types index e1c9cb6e6bf..d6d6c285d79 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.types +++ b/tests/baselines/reference/tsxReactEmitEntities.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmitEntities.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.js b/tests/baselines/reference/tsxReactEmitWhitespace.js index a1b5894106f..9614cbf2f2c 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.js +++ b/tests/baselines/reference/tsxReactEmitWhitespace.js @@ -1,4 +1,4 @@ -//// [tsxReactEmitWhitespace.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -52,7 +52,7 @@ var p = 0; -//// [tsxReactEmitWhitespace.js] +//// [file.js] // THIS FILE HAS TEST-SIGNIFICANT LEADING/TRAILING // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT var p = 0; diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.symbols b/tests/baselines/reference/tsxReactEmitWhitespace.symbols index 3aa3f0d0f8a..a0d8266faa0 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.symbols +++ b/tests/baselines/reference/tsxReactEmitWhitespace.symbols @@ -1,93 +1,93 @@ -=== tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxReactEmitWhitespace.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxReactEmitWhitespace.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxReactEmitWhitespace.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } declare var React: any; ->React : Symbol(React, Decl(tsxReactEmitWhitespace.tsx, 6, 11)) +>React : Symbol(React, Decl(file.tsx, 6, 11)) // THIS FILE HAS TEST-SIGNIFICANT LEADING/TRAILING // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT var p = 0; ->p : Symbol(p, Decl(tsxReactEmitWhitespace.tsx, 11, 3)) +>p : Symbol(p, Decl(file.tsx, 11, 3)) // Emit " "
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit " ", p, " "
{p}
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) ->p : Symbol(p, Decl(tsxReactEmitWhitespace.tsx, 11, 3)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>p : Symbol(p, Decl(file.tsx, 11, 3)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit only p
->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) {p} ->p : Symbol(p, Decl(tsxReactEmitWhitespace.tsx, 11, 3)) +>p : Symbol(p, Decl(file.tsx, 11, 3))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit only p
->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) {p} ->p : Symbol(p, Decl(tsxReactEmitWhitespace.tsx, 11, 3)) +>p : Symbol(p, Decl(file.tsx, 11, 3))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit " 3"
3 ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit " 3 "
3
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit "3"
->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) 3
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit no args
->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Emit "foo" + ' ' + "bar"
->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) foo bar
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.types b/tests/baselines/reference/tsxReactEmitWhitespace.types index 4622aef1991..824aa5cfdae 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/tsxReactEmitWhitespace2.js b/tests/baselines/reference/tsxReactEmitWhitespace2.js index 091a193cdc5..f649ca43ebd 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace2.js +++ b/tests/baselines/reference/tsxReactEmitWhitespace2.js @@ -1,4 +1,4 @@ -//// [tsxReactEmitWhitespace2.tsx] +//// [file.tsx] declare module JSX { interface Element { } interface IntrinsicElements { @@ -16,7 +16,7 @@ declare var React: any; -//// [tsxReactEmitWhitespace2.js] +//// [file.js] // Emit ' word' in the last string React.createElement("div", null, "word ", React.createElement("code", null, "code"), " word"); // Same here diff --git a/tests/baselines/reference/tsxReactEmitWhitespace2.symbols b/tests/baselines/reference/tsxReactEmitWhitespace2.symbols index 44ff4cba292..a79445c28af 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace2.symbols +++ b/tests/baselines/reference/tsxReactEmitWhitespace2.symbols @@ -1,38 +1,38 @@ -=== tests/cases/conformance/jsx/tsxReactEmitWhitespace2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : Symbol(JSX, Decl(tsxReactEmitWhitespace2.tsx, 0, 0)) +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) interface Element { } ->Element : Symbol(Element, Decl(tsxReactEmitWhitespace2.tsx, 0, 20)) +>Element : Symbol(Element, Decl(file.tsx, 0, 20)) interface IntrinsicElements { ->IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) [s: string]: any; ->s : Symbol(s, Decl(tsxReactEmitWhitespace2.tsx, 3, 3)) +>s : Symbol(s, Decl(file.tsx, 3, 3)) } } declare var React: any; ->React : Symbol(React, Decl(tsxReactEmitWhitespace2.tsx, 6, 11)) +>React : Symbol(React, Decl(file.tsx, 6, 11)) // Emit ' word' in the last string
word code word
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->code : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->code : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>code : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>code : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // Same here
code word
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->code : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->code : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>code : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>code : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) // And here
word
; ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->code : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) ->div : Symbol(JSX.IntrinsicElements, Decl(tsxReactEmitWhitespace2.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>code : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) diff --git a/tests/baselines/reference/tsxReactEmitWhitespace2.types b/tests/baselines/reference/tsxReactEmitWhitespace2.types index 7287e59b9b1..73c65f50aca 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace2.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace2.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/tsxReactEmitWhitespace2.tsx === +=== tests/cases/conformance/jsx/file.tsx === declare module JSX { >JSX : any diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt new file mode 100644 index 00000000000..49f17e7891d --- /dev/null +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt @@ -0,0 +1,212 @@ +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(4,18): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(37,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(38,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(39,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(40,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(41,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(44,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(45,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(46,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(47,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(48,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(55,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(57,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(58,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(61,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(63,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(87,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(88,43): error TS2345: Argument of type '"Hello"' is not assignable to parameter of type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(89,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(93,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(97,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. + Type 'string' is not assignable to type '"World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(104,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. + + +==== tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts (25 errors) ==== + + declare function randBool(): boolean; + declare function takeReturnString(str: string): string; + declare function takeReturnHello(str: "Hello"): "Hello"; + ~~~~~~~~~~~~~~~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + declare function takeReturnHelloWorld(str: "Hello" | "World"): "Hello" | "World"; + + function fun1(x: T, y: T) { + return randBool() ? x : y; + } + + function fun2(x: T, y: U) { + return randBool() ? x : y; + } + + function fun3(...args: T[]): T { + return args[+randBool()]; + } + + namespace n1 { + // The following should all come back as strings. + // They should be assignable to/from something of a type 'string'. + // They should not be assignable to either "Hello" or "World". + export let a = fun1("Hello", "World"); + export let b = fun1("Hello", "Hello"); + export let c = fun2("Hello", "World"); + export let d = fun2("Hello", "Hello"); + export let e = fun3("Hello", "Hello", "World", "Foo"); + + // Should be valid + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. + b = takeReturnHello(b); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. + c = takeReturnHello(c); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. + d = takeReturnHello(d); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. + e = takeReturnHello(e); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. + + // Passing these as arguments should cause an error. + a = takeReturnHelloWorld(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +!!! error TS2345: Type 'string' is not assignable to type '"World"'. + b = takeReturnHelloWorld(b); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +!!! error TS2345: Type 'string' is not assignable to type '"World"'. + c = takeReturnHelloWorld(c); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +!!! error TS2345: Type 'string' is not assignable to type '"World"'. + d = takeReturnHelloWorld(d); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +!!! error TS2345: Type 'string' is not assignable to type '"World"'. + e = takeReturnHelloWorld(e); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +!!! error TS2345: Type 'string' is not assignable to type '"World"'. + } + + namespace n2 { + // The following (regardless of errors) should come back typed + // as "Hello" (or "Hello" | "Hello"). + export let a = fun1<"Hello">("Hello", "Hello"); + export let b = fun1<"Hello">("Hello", "World"); + ~~~~~~~ +!!! error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. + export let c = fun2<"Hello", "Hello">("Hello", "Hello"); + export let d = fun2<"Hello", "Hello">("Hello", "World"); + ~~~~~~~ +!!! error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. + export let e = fun3<"Hello">("Hello", "World"); + ~~~~~~~ +!!! error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. + b = takeReturnString(b); + c = takeReturnString(c); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. + d = takeReturnString(d); + e = takeReturnString(e); + + // Should be valid + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Assignment from the returned value should cause an error. + a = takeReturnHelloWorld(a); + ~ +!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. +!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + ~ +!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. +!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); + } + + + namespace n3 { + // The following (regardless of errors) should come back typed + // as "Hello" | "World" (or "World" | "Hello"). + export let a = fun2<"Hello", "World">("Hello", "World"); + export let b = fun2<"Hello", "World">("World", "Hello"); + ~~~~~~~ +!!! error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. + export let c = fun2<"World", "Hello">("Hello", "Hello"); + ~~~~~~~ +!!! error TS2345: Argument of type '"Hello"' is not assignable to parameter of type '"World"'. + export let d = fun2<"World", "Hello">("World", "World"); + ~~~~~~~ +!!! error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. + export let e = fun3<"Hello" | "World">("Hello", "World"); + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. +!!! error TS2322: Type 'string' is not assignable to type '"World"'. + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. +!!! error TS2322: Type 'string' is not assignable to type '"World"'. + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + ~ +!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. +!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + ~ +!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. +!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. + + // Both should be valid. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); + } \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js new file mode 100644 index 00000000000..c07dd225396 --- /dev/null +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js @@ -0,0 +1,244 @@ +//// [typeArgumentsWithStringLiteralTypes01.ts] + +declare function randBool(): boolean; +declare function takeReturnString(str: string): string; +declare function takeReturnHello(str: "Hello"): "Hello"; +declare function takeReturnHelloWorld(str: "Hello" | "World"): "Hello" | "World"; + +function fun1(x: T, y: T) { + return randBool() ? x : y; +} + +function fun2(x: T, y: U) { + return randBool() ? x : y; +} + +function fun3(...args: T[]): T { + return args[+randBool()]; +} + +namespace n1 { + // The following should all come back as strings. + // They should be assignable to/from something of a type 'string'. + // They should not be assignable to either "Hello" or "World". + export let a = fun1("Hello", "World"); + export let b = fun1("Hello", "Hello"); + export let c = fun2("Hello", "World"); + export let d = fun2("Hello", "Hello"); + export let e = fun3("Hello", "Hello", "World", "Foo"); + + // Should be valid + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Passing these as arguments should cause an error. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} + +namespace n2 { + // The following (regardless of errors) should come back typed + // as "Hello" (or "Hello" | "Hello"). + export let a = fun1<"Hello">("Hello", "Hello"); + export let b = fun1<"Hello">("Hello", "World"); + export let c = fun2<"Hello", "Hello">("Hello", "Hello"); + export let d = fun2<"Hello", "Hello">("Hello", "World"); + export let e = fun3<"Hello">("Hello", "World"); + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Should be valid + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Assignment from the returned value should cause an error. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} + + +namespace n3 { + // The following (regardless of errors) should come back typed + // as "Hello" | "World" (or "World" | "Hello"). + export let a = fun2<"Hello", "World">("Hello", "World"); + export let b = fun2<"Hello", "World">("World", "Hello"); + export let c = fun2<"World", "Hello">("Hello", "Hello"); + export let d = fun2<"World", "Hello">("World", "World"); + export let e = fun3<"Hello" | "World">("Hello", "World"); + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Both should be valid. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} + +//// [typeArgumentsWithStringLiteralTypes01.js] +function fun1(x, y) { + return randBool() ? x : y; +} +function fun2(x, y) { + return randBool() ? x : y; +} +function fun3() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return args[+randBool()]; +} +var n1; +(function (n1) { + // The following should all come back as strings. + // They should be assignable to/from something of a type 'string'. + // They should not be assignable to either "Hello" or "World". + n1.a = fun1("Hello", "World"); + n1.b = fun1("Hello", "Hello"); + n1.c = fun2("Hello", "World"); + n1.d = fun2("Hello", "Hello"); + n1.e = fun3("Hello", "Hello", "World", "Foo"); + // Should be valid + n1.a = takeReturnString(n1.a); + n1.b = takeReturnString(n1.b); + n1.c = takeReturnString(n1.c); + n1.d = takeReturnString(n1.d); + n1.e = takeReturnString(n1.e); + // Passing these as arguments should cause an error. + n1.a = takeReturnHello(n1.a); + n1.b = takeReturnHello(n1.b); + n1.c = takeReturnHello(n1.c); + n1.d = takeReturnHello(n1.d); + n1.e = takeReturnHello(n1.e); + // Passing these as arguments should cause an error. + n1.a = takeReturnHelloWorld(n1.a); + n1.b = takeReturnHelloWorld(n1.b); + n1.c = takeReturnHelloWorld(n1.c); + n1.d = takeReturnHelloWorld(n1.d); + n1.e = takeReturnHelloWorld(n1.e); +})(n1 || (n1 = {})); +var n2; +(function (n2) { + // The following (regardless of errors) should come back typed + // as "Hello" (or "Hello" | "Hello"). + n2.a = fun1("Hello", "Hello"); + n2.b = fun1("Hello", "World"); + n2.c = fun2("Hello", "Hello"); + n2.d = fun2("Hello", "World"); + n2.e = fun3("Hello", "World"); + // Assignment from the returned value should cause an error. + n2.a = takeReturnString(n2.a); + n2.b = takeReturnString(n2.b); + n2.c = takeReturnString(n2.c); + n2.d = takeReturnString(n2.d); + n2.e = takeReturnString(n2.e); + // Should be valid + n2.a = takeReturnHello(n2.a); + n2.b = takeReturnHello(n2.b); + n2.c = takeReturnHello(n2.c); + n2.d = takeReturnHello(n2.d); + n2.e = takeReturnHello(n2.e); + // Assignment from the returned value should cause an error. + n2.a = takeReturnHelloWorld(n2.a); + n2.b = takeReturnHelloWorld(n2.b); + n2.c = takeReturnHelloWorld(n2.c); + n2.d = takeReturnHelloWorld(n2.d); + n2.e = takeReturnHelloWorld(n2.e); +})(n2 || (n2 = {})); +var n3; +(function (n3) { + // The following (regardless of errors) should come back typed + // as "Hello" | "World" (or "World" | "Hello"). + n3.a = fun2("Hello", "World"); + n3.b = fun2("World", "Hello"); + n3.c = fun2("Hello", "Hello"); + n3.d = fun2("World", "World"); + n3.e = fun3("Hello", "World"); + // Assignment from the returned value should cause an error. + n3.a = takeReturnString(n3.a); + n3.b = takeReturnString(n3.b); + n3.c = takeReturnString(n3.c); + n3.d = takeReturnString(n3.d); + n3.e = takeReturnString(n3.e); + // Passing these as arguments should cause an error. + n3.a = takeReturnHello(n3.a); + n3.b = takeReturnHello(n3.b); + n3.c = takeReturnHello(n3.c); + n3.d = takeReturnHello(n3.d); + n3.e = takeReturnHello(n3.e); + // Both should be valid. + n3.a = takeReturnHelloWorld(n3.a); + n3.b = takeReturnHelloWorld(n3.b); + n3.c = takeReturnHelloWorld(n3.c); + n3.d = takeReturnHelloWorld(n3.d); + n3.e = takeReturnHelloWorld(n3.e); +})(n3 || (n3 = {})); + + +//// [typeArgumentsWithStringLiteralTypes01.d.ts] +declare function randBool(): boolean; +declare function takeReturnString(str: string): string; +declare function takeReturnHello(str: "Hello"): "Hello"; +declare function takeReturnHelloWorld(str: "Hello" | "World"): "Hello" | "World"; +declare function fun1(x: T, y: T): T; +declare function fun2(x: T, y: U): T | U; +declare function fun3(...args: T[]): T; +declare namespace n1 { + let a: string; + let b: string; + let c: string; + let d: string; + let e: string; +} +declare namespace n2 { + let a: "Hello"; + let b: any; + let c: "Hello"; + let d: any; + let e: any; +} +declare namespace n3 { + let a: "Hello" | "World"; + let b: any; + let c: any; + let d: any; + let e: "Hello" | "World"; +} diff --git a/tests/baselines/reference/typeCheckTypeArgument.errors.txt b/tests/baselines/reference/typeCheckTypeArgument.errors.txt index bf3e8bfdb9b..1452a2d4deb 100644 --- a/tests/baselines/reference/typeCheckTypeArgument.errors.txt +++ b/tests/baselines/reference/typeCheckTypeArgument.errors.txt @@ -1,29 +1,12 @@ -error TS2318: Cannot find global type 'Array'. -error TS2318: Cannot find global type 'Boolean'. -error TS2318: Cannot find global type 'Function'. -error TS2318: Cannot find global type 'IArguments'. -error TS2318: Cannot find global type 'Number'. -error TS2318: Cannot find global type 'Object'. -error TS2318: Cannot find global type 'RegExp'. -error TS2318: Cannot find global type 'String'. -tests/cases/compiler/typeCheckTypeArgument.ts(3,19): error TS2304: Cannot find name 'UNKNOWN'. -tests/cases/compiler/typeCheckTypeArgument.ts(5,26): error TS2304: Cannot find name 'UNKNOWN'. -tests/cases/compiler/typeCheckTypeArgument.ts(7,21): error TS2304: Cannot find name 'UNKNOWN'. -tests/cases/compiler/typeCheckTypeArgument.ts(9,24): error TS2304: Cannot find name 'UNKNOWN'. -tests/cases/compiler/typeCheckTypeArgument.ts(12,22): error TS2304: Cannot find name 'UNKNOWN'. -tests/cases/compiler/typeCheckTypeArgument.ts(15,13): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(2,19): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(4,26): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(6,21): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(8,24): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(11,22): error TS2304: Cannot find name 'UNKNOWN'. +tests/cases/compiler/typeCheckTypeArgument.ts(14,13): error TS2304: Cannot find name 'UNKNOWN'. -!!! error TS2318: Cannot find global type 'Array'. -!!! error TS2318: Cannot find global type 'Boolean'. -!!! error TS2318: Cannot find global type 'Function'. -!!! error TS2318: Cannot find global type 'IArguments'. -!!! error TS2318: Cannot find global type 'Number'. -!!! error TS2318: Cannot find global type 'Object'. -!!! error TS2318: Cannot find global type 'RegExp'. -!!! error TS2318: Cannot find global type 'String'. ==== tests/cases/compiler/typeCheckTypeArgument.ts (6 errors) ==== - /// var f: () => void; ~~~~~~~ diff --git a/tests/baselines/reference/typeCheckTypeArgument.js b/tests/baselines/reference/typeCheckTypeArgument.js index bec33393f92..633eb75ed91 100644 --- a/tests/baselines/reference/typeCheckTypeArgument.js +++ b/tests/baselines/reference/typeCheckTypeArgument.js @@ -1,5 +1,4 @@ //// [typeCheckTypeArgument.ts] -/// var f: () => void; @@ -16,7 +15,6 @@ class Foo2 { ((a) => { }); //// [typeCheckTypeArgument.js] -/// var f; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/typeGuardEnums.js b/tests/baselines/reference/typeGuardEnums.js new file mode 100644 index 00000000000..1eb4b7552c4 --- /dev/null +++ b/tests/baselines/reference/typeGuardEnums.js @@ -0,0 +1,41 @@ +//// [typeGuardEnums.ts] +enum E {} +enum V {} + +let x: number|string|E|V; + +if (typeof x === "number") { + x; // number|E|V +} +else { + x; // string +} + +if (typeof x !== "number") { + x; // string +} +else { + x; // number|E|V +} + + +//// [typeGuardEnums.js] +var E; +(function (E) { +})(E || (E = {})); +var V; +(function (V) { +})(V || (V = {})); +var x; +if (typeof x === "number") { + x; // number|E|V +} +else { + x; // string +} +if (typeof x !== "number") { + x; // string +} +else { + x; // number|E|V +} diff --git a/tests/baselines/reference/typeGuardEnums.symbols b/tests/baselines/reference/typeGuardEnums.symbols new file mode 100644 index 00000000000..8f1a396c481 --- /dev/null +++ b/tests/baselines/reference/typeGuardEnums.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardEnums.ts === +enum E {} +>E : Symbol(E, Decl(typeGuardEnums.ts, 0, 0)) + +enum V {} +>V : Symbol(V, Decl(typeGuardEnums.ts, 0, 9)) + +let x: number|string|E|V; +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) +>E : Symbol(E, Decl(typeGuardEnums.ts, 0, 0)) +>V : Symbol(V, Decl(typeGuardEnums.ts, 0, 9)) + +if (typeof x === "number") { +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) + + x; // number|E|V +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) +} +else { + x; // string +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) +} + +if (typeof x !== "number") { +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) + + x; // string +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) +} +else { + x; // number|E|V +>x : Symbol(x, Decl(typeGuardEnums.ts, 3, 3)) +} + diff --git a/tests/baselines/reference/typeGuardEnums.types b/tests/baselines/reference/typeGuardEnums.types new file mode 100644 index 00000000000..1d39a81d78a --- /dev/null +++ b/tests/baselines/reference/typeGuardEnums.types @@ -0,0 +1,40 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardEnums.ts === +enum E {} +>E : E + +enum V {} +>V : V + +let x: number|string|E|V; +>x : number | string | E | V +>E : E +>V : V + +if (typeof x === "number") { +>typeof x === "number" : boolean +>typeof x : string +>x : number | string | E | V +>"number" : string + + x; // number|E|V +>x : number | E | V +} +else { + x; // string +>x : string +} + +if (typeof x !== "number") { +>typeof x !== "number" : boolean +>typeof x : string +>x : number | string | E | V +>"number" : string + + x; // string +>x : string +} +else { + x; // number|E|V +>x : number | E | V +} + diff --git a/tests/baselines/reference/typeGuardInClass.js b/tests/baselines/reference/typeGuardInClass.js new file mode 100644 index 00000000000..0ce25a7c11c --- /dev/null +++ b/tests/baselines/reference/typeGuardInClass.js @@ -0,0 +1,37 @@ +//// [typeGuardInClass.ts] +let x: string | number; + +if (typeof x === "string") { + let n = class { + constructor() { + let y: string = x; + } + } +} +else { + let m = class { + constructor() { + let y: number = x; + } + } +} + + +//// [typeGuardInClass.js] +var x; +if (typeof x === "string") { + var n = (function () { + function class_1() { + var y = x; + } + return class_1; + })(); +} +else { + var m = (function () { + function class_2() { + var y = x; + } + return class_2; + })(); +} diff --git a/tests/baselines/reference/typeGuardInClass.symbols b/tests/baselines/reference/typeGuardInClass.symbols new file mode 100644 index 00000000000..cc0e745e4de --- /dev/null +++ b/tests/baselines/reference/typeGuardInClass.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts === +let x: string | number; +>x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) + +if (typeof x === "string") { +>x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) + + let n = class { +>n : Symbol(n, Decl(typeGuardInClass.ts, 3, 7)) + + constructor() { + let y: string = x; +>y : Symbol(y, Decl(typeGuardInClass.ts, 5, 15)) +>x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) + } + } +} +else { + let m = class { +>m : Symbol(m, Decl(typeGuardInClass.ts, 10, 7)) + + constructor() { + let y: number = x; +>y : Symbol(y, Decl(typeGuardInClass.ts, 12, 15)) +>x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) + } + } +} + diff --git a/tests/baselines/reference/typeGuardInClass.types b/tests/baselines/reference/typeGuardInClass.types new file mode 100644 index 00000000000..93fe9f28c5e --- /dev/null +++ b/tests/baselines/reference/typeGuardInClass.types @@ -0,0 +1,34 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts === +let x: string | number; +>x : string | number + +if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>"string" : string + + let n = class { +>n : typeof (Anonymous class) +>class { constructor() { let y: string = x; } } : typeof (Anonymous class) + + constructor() { + let y: string = x; +>y : string +>x : string + } + } +} +else { + let m = class { +>m : typeof (Anonymous class) +>class { constructor() { let y: number = x; } } : typeof (Anonymous class) + + constructor() { + let y: number = x; +>y : number +>x : number + } + } +} + diff --git a/tests/baselines/reference/typeGuardNesting.js b/tests/baselines/reference/typeGuardNesting.js new file mode 100644 index 00000000000..364653d0273 --- /dev/null +++ b/tests/baselines/reference/typeGuardNesting.js @@ -0,0 +1,31 @@ +//// [typeGuardNesting.ts] +let strOrBool: string|boolean; +if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') { + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +} + +if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +} + + +//// [typeGuardNesting.js] +var strOrBool; +if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') { + var label = (typeof strOrBool === 'string') ? strOrBool : "string"; + var bool = (typeof strOrBool === 'boolean') ? strOrBool : false; + var label2 = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + var bool2 = (typeof strOrBool !== 'string') ? strOrBool : false; +} +if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { + var label = (typeof strOrBool === 'string') ? strOrBool : "string"; + var bool = (typeof strOrBool === 'boolean') ? strOrBool : false; + var label2 = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + var bool2 = (typeof strOrBool !== 'string') ? strOrBool : false; +} diff --git a/tests/baselines/reference/typeGuardNesting.symbols b/tests/baselines/reference/typeGuardNesting.symbols new file mode 100644 index 00000000000..427db81f3ed --- /dev/null +++ b/tests/baselines/reference/typeGuardNesting.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts === +let strOrBool: string|boolean; +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + +if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') { +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; +>label : Symbol(label, Decl(typeGuardNesting.ts, 2, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; +>bool : Symbol(bool, Decl(typeGuardNesting.ts, 3, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; +>label2 : Symbol(label2, Decl(typeGuardNesting.ts, 4, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +>bool2 : Symbol(bool2, Decl(typeGuardNesting.ts, 5, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +} + +if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; +>label : Symbol(label, Decl(typeGuardNesting.ts, 9, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; +>bool : Symbol(bool, Decl(typeGuardNesting.ts, 10, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; +>label2 : Symbol(label2, Decl(typeGuardNesting.ts, 11, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) + + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +>bool2 : Symbol(bool2, Decl(typeGuardNesting.ts, 12, 4)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3)) +} + diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types new file mode 100644 index 00000000000..255e96da89e --- /dev/null +++ b/tests/baselines/reference/typeGuardNesting.types @@ -0,0 +1,124 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts === +let strOrBool: string|boolean; +>strOrBool : string | boolean + +if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') { +>(typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string' : boolean +>(typeof strOrBool === 'boolean' && !strOrBool) : boolean +>typeof strOrBool === 'boolean' && !strOrBool : boolean +>typeof strOrBool === 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : string | boolean +>'boolean' : string +>!strOrBool : boolean +>strOrBool : boolean +>typeof strOrBool === 'string' : boolean +>typeof strOrBool : string +>strOrBool : string | boolean +>'string' : string + + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; +>label : string +>(typeof strOrBool === 'string') ? strOrBool : "string" : string +>(typeof strOrBool === 'string') : boolean +>typeof strOrBool === 'string' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'string' : string +>strOrBool : string +>"string" : string + + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; +>bool : boolean +>(typeof strOrBool === 'boolean') ? strOrBool : false : boolean +>(typeof strOrBool === 'boolean') : boolean +>typeof strOrBool === 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'boolean' : string +>strOrBool : boolean +>false : boolean + + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; +>label2 : string +>(typeof strOrBool !== 'boolean') ? strOrBool : "string" : string +>(typeof strOrBool !== 'boolean') : boolean +>typeof strOrBool !== 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'boolean' : string +>strOrBool : string +>"string" : string + + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +>bool2 : boolean +>(typeof strOrBool !== 'string') ? strOrBool : false : boolean +>(typeof strOrBool !== 'string') : boolean +>typeof strOrBool !== 'string' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'string' : string +>strOrBool : boolean +>false : boolean +} + +if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { +>(typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean' : boolean +>(typeof strOrBool !== 'string' && !strOrBool) : boolean +>typeof strOrBool !== 'string' && !strOrBool : boolean +>typeof strOrBool !== 'string' : boolean +>typeof strOrBool : string +>strOrBool : string | boolean +>'string' : string +>!strOrBool : boolean +>strOrBool : boolean +>typeof strOrBool !== 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : string | boolean +>'boolean' : string + + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; +>label : string +>(typeof strOrBool === 'string') ? strOrBool : "string" : string +>(typeof strOrBool === 'string') : boolean +>typeof strOrBool === 'string' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'string' : string +>strOrBool : string +>"string" : string + + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; +>bool : boolean +>(typeof strOrBool === 'boolean') ? strOrBool : false : boolean +>(typeof strOrBool === 'boolean') : boolean +>typeof strOrBool === 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'boolean' : string +>strOrBool : boolean +>false : boolean + + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; +>label2 : string +>(typeof strOrBool !== 'boolean') ? strOrBool : "string" : string +>(typeof strOrBool !== 'boolean') : boolean +>typeof strOrBool !== 'boolean' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'boolean' : string +>strOrBool : string +>"string" : string + + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +>bool2 : boolean +>(typeof strOrBool !== 'string') ? strOrBool : false : boolean +>(typeof strOrBool !== 'string') : boolean +>typeof strOrBool !== 'string' : boolean +>typeof strOrBool : string +>strOrBool : boolean | string +>'string' : string +>strOrBool : boolean +>false : boolean +} + diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js index 3bb1a2091f6..d1cb4994196 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js @@ -23,19 +23,19 @@ if (typeof strOrC === "Object") { c = strOrC; // C } else { - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string } if (typeof numOrC === "Object") { c = numOrC; // C } else { - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number } if (typeof boolOrC === "Object") { c = boolOrC; // C } else { - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean } // Narrowing occurs only if target type is a subtype of variable type @@ -50,19 +50,19 @@ else { // - when true, narrows the type of x by typeof x === s when false, or // - when false, narrows the type of x by typeof x === s when true. if (typeof strOrC !== "Object") { - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string } else { c = strOrC; // C } if (typeof numOrC !== "Object") { - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number } else { c = numOrC; // C } if (typeof boolOrC !== "Object") { - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean } else { c = boolOrC; // C @@ -104,19 +104,19 @@ if (typeof strOrC === "Object") { c = strOrC; // C } else { - var r2 = strOrC; // string | C + var r2 = strOrC; // string } if (typeof numOrC === "Object") { c = numOrC; // C } else { - var r3 = numOrC; // number | C + var r3 = numOrC; // number } if (typeof boolOrC === "Object") { c = boolOrC; // C } else { - var r4 = boolOrC; // boolean | C + var r4 = boolOrC; // boolean } // Narrowing occurs only if target type is a subtype of variable type if (typeof strOrNumOrBool === "Object") { @@ -129,19 +129,19 @@ else { // - when true, narrows the type of x by typeof x === s when false, or // - when false, narrows the type of x by typeof x === s when true. if (typeof strOrC !== "Object") { - var r2 = strOrC; // string | C + var r2 = strOrC; // string } else { c = strOrC; // C } if (typeof numOrC !== "Object") { - var r3 = numOrC; // number | C + var r3 = numOrC; // number } else { c = numOrC; // C } if (typeof boolOrC !== "Object") { - var r4 = boolOrC; // boolean | C + var r4 = boolOrC; // boolean } else { c = boolOrC; // C diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.symbols b/tests/baselines/reference/typeGuardOfFormTypeOfOther.symbols index e3ecffdc2e9..eb120d468dc 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.symbols +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.symbols @@ -56,9 +56,8 @@ if (typeof strOrC === "Object") { >strOrC : Symbol(strOrC, Decl(typeGuardOfFormTypeOfOther.ts, 9, 3)) } else { - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string >r2 : Symbol(r2, Decl(typeGuardOfFormTypeOfOther.ts, 24, 7), Decl(typeGuardOfFormTypeOfOther.ts, 51, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >strOrC : Symbol(strOrC, Decl(typeGuardOfFormTypeOfOther.ts, 9, 3)) } if (typeof numOrC === "Object") { @@ -69,9 +68,8 @@ if (typeof numOrC === "Object") { >numOrC : Symbol(numOrC, Decl(typeGuardOfFormTypeOfOther.ts, 10, 3)) } else { - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number >r3 : Symbol(r3, Decl(typeGuardOfFormTypeOfOther.ts, 30, 7), Decl(typeGuardOfFormTypeOfOther.ts, 57, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >numOrC : Symbol(numOrC, Decl(typeGuardOfFormTypeOfOther.ts, 10, 3)) } if (typeof boolOrC === "Object") { @@ -82,9 +80,8 @@ if (typeof boolOrC === "Object") { >boolOrC : Symbol(boolOrC, Decl(typeGuardOfFormTypeOfOther.ts, 11, 3)) } else { - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean >r4 : Symbol(r4, Decl(typeGuardOfFormTypeOfOther.ts, 36, 7), Decl(typeGuardOfFormTypeOfOther.ts, 63, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >boolOrC : Symbol(boolOrC, Decl(typeGuardOfFormTypeOfOther.ts, 11, 3)) } @@ -108,9 +105,8 @@ else { if (typeof strOrC !== "Object") { >strOrC : Symbol(strOrC, Decl(typeGuardOfFormTypeOfOther.ts, 9, 3)) - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string >r2 : Symbol(r2, Decl(typeGuardOfFormTypeOfOther.ts, 24, 7), Decl(typeGuardOfFormTypeOfOther.ts, 51, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >strOrC : Symbol(strOrC, Decl(typeGuardOfFormTypeOfOther.ts, 9, 3)) } else { @@ -121,9 +117,8 @@ else { if (typeof numOrC !== "Object") { >numOrC : Symbol(numOrC, Decl(typeGuardOfFormTypeOfOther.ts, 10, 3)) - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number >r3 : Symbol(r3, Decl(typeGuardOfFormTypeOfOther.ts, 30, 7), Decl(typeGuardOfFormTypeOfOther.ts, 57, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >numOrC : Symbol(numOrC, Decl(typeGuardOfFormTypeOfOther.ts, 10, 3)) } else { @@ -134,9 +129,8 @@ else { if (typeof boolOrC !== "Object") { >boolOrC : Symbol(boolOrC, Decl(typeGuardOfFormTypeOfOther.ts, 11, 3)) - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean >r4 : Symbol(r4, Decl(typeGuardOfFormTypeOfOther.ts, 36, 7), Decl(typeGuardOfFormTypeOfOther.ts, 63, 7)) ->C : Symbol(C, Decl(typeGuardOfFormTypeOfOther.ts, 0, 0)) >boolOrC : Symbol(boolOrC, Decl(typeGuardOfFormTypeOfOther.ts, 11, 3)) } else { diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.types b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types index e0fd443ef63..5cec3567194 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types @@ -60,10 +60,9 @@ if (typeof strOrC === "Object") { >strOrC : C } else { - var r2: string | C = strOrC; // string | C ->r2 : string | C ->C : C ->strOrC : string | C + var r2: string = strOrC; // string +>r2 : string +>strOrC : string } if (typeof numOrC === "Object") { >typeof numOrC === "Object" : boolean @@ -77,10 +76,9 @@ if (typeof numOrC === "Object") { >numOrC : C } else { - var r3: number | C = numOrC; // number | C ->r3 : number | C ->C : C ->numOrC : number | C + var r3: number = numOrC; // number +>r3 : number +>numOrC : number } if (typeof boolOrC === "Object") { >typeof boolOrC === "Object" : boolean @@ -94,10 +92,9 @@ if (typeof boolOrC === "Object") { >boolOrC : C } else { - var r4: boolean | C = boolOrC; // boolean | C ->r4 : boolean | C ->C : C ->boolOrC : boolean | C + var r4: boolean = boolOrC; // boolean +>r4 : boolean +>boolOrC : boolean } // Narrowing occurs only if target type is a subtype of variable type @@ -126,10 +123,9 @@ if (typeof strOrC !== "Object") { >strOrC : string | C >"Object" : string - var r2: string | C = strOrC; // string | C ->r2 : string | C ->C : C ->strOrC : string | C + var r2: string = strOrC; // string +>r2 : string +>strOrC : string } else { c = strOrC; // C @@ -143,10 +139,9 @@ if (typeof numOrC !== "Object") { >numOrC : number | C >"Object" : string - var r3: number | C = numOrC; // number | C ->r3 : number | C ->C : C ->numOrC : number | C + var r3: number = numOrC; // number +>r3 : number +>numOrC : number } else { c = numOrC; // C @@ -160,10 +155,9 @@ if (typeof boolOrC !== "Object") { >boolOrC : boolean | C >"Object" : string - var r4: boolean | C = boolOrC; // boolean | C ->r4 : boolean | C ->C : C ->boolOrC : boolean | C + var r4: boolean = boolOrC; // boolean +>r4 : boolean +>boolOrC : boolean } else { c = boolOrC; // C diff --git a/tests/baselines/reference/typeGuardRedundancy.js b/tests/baselines/reference/typeGuardRedundancy.js new file mode 100644 index 00000000000..1dfa964cbc9 --- /dev/null +++ b/tests/baselines/reference/typeGuardRedundancy.js @@ -0,0 +1,17 @@ +//// [typeGuardRedundancy.ts] +var x: string|number; + +var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; + +var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr; + +var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; + +var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr; + +//// [typeGuardRedundancy.js] +var x; +var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; +var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr; +var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; +var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr; diff --git a/tests/baselines/reference/typeGuardRedundancy.symbols b/tests/baselines/reference/typeGuardRedundancy.symbols new file mode 100644 index 00000000000..356061407ad --- /dev/null +++ b/tests/baselines/reference/typeGuardRedundancy.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts === +var x: string|number; +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) + +var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; +>r1 : Symbol(r1, Decl(typeGuardRedundancy.ts, 2, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x.substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr; +>r2 : Symbol(r2, Decl(typeGuardRedundancy.ts, 4, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x.substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) + +var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; +>r3 : Symbol(r3, Decl(typeGuardRedundancy.ts, 6, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x.substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr; +>r4 : Symbol(r4, Decl(typeGuardRedundancy.ts, 8, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>x.substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(typeGuardRedundancy.ts, 0, 3)) +>substr : Symbol(String.substr, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/typeGuardRedundancy.types b/tests/baselines/reference/typeGuardRedundancy.types new file mode 100644 index 00000000000..1507ceb850e --- /dev/null +++ b/tests/baselines/reference/typeGuardRedundancy.types @@ -0,0 +1,84 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts === +var x: string|number; +>x : string | number + +var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; +>r1 : (from: number, length?: number) => string +>typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed : (from: number, length?: number) => string +>typeof x === "string" && typeof x === "string" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>"string" : string +>typeof x === "string" : boolean +>typeof x : string +>x : string +>"string" : string +>x.substr : (from: number, length?: number) => string +>x : string +>substr : (from: number, length?: number) => string +>x.toFixed : (fractionDigits?: number) => string +>x : number +>toFixed : (fractionDigits?: number) => string + +var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr; +>r2 : (fractionDigits?: number) => string +>!(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr : (fractionDigits?: number) => string +>!(typeof x === "string" && typeof x === "string") : boolean +>(typeof x === "string" && typeof x === "string") : boolean +>typeof x === "string" && typeof x === "string" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>"string" : string +>typeof x === "string" : boolean +>typeof x : string +>x : string +>"string" : string +>x.toFixed : (fractionDigits?: number) => string +>x : number +>toFixed : (fractionDigits?: number) => string +>x.substr : (from: number, length?: number) => string +>x : string +>substr : (from: number, length?: number) => string + +var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; +>r3 : (from: number, length?: number) => string +>typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed : (from: number, length?: number) => string +>typeof x === "string" || typeof x === "string" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>"string" : string +>typeof x === "string" : boolean +>typeof x : string +>x : number +>"string" : string +>x.substr : (from: number, length?: number) => string +>x : string +>substr : (from: number, length?: number) => string +>x.toFixed : (fractionDigits?: number) => string +>x : number +>toFixed : (fractionDigits?: number) => string + +var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr; +>r4 : (fractionDigits?: number) => string +>!(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr : (fractionDigits?: number) => string +>!(typeof x === "string" || typeof x === "string") : boolean +>(typeof x === "string" || typeof x === "string") : boolean +>typeof x === "string" || typeof x === "string" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>"string" : string +>typeof x === "string" : boolean +>typeof x : string +>x : number +>"string" : string +>x.toFixed : (fractionDigits?: number) => string +>x : number +>toFixed : (fractionDigits?: number) => string +>x.substr : (from: number, length?: number) => string +>x : string +>substr : (from: number, length?: number) => string + diff --git a/tests/baselines/reference/typeGuardTautologicalConsistiency.js b/tests/baselines/reference/typeGuardTautologicalConsistiency.js new file mode 100644 index 00000000000..1b7fa2021c5 --- /dev/null +++ b/tests/baselines/reference/typeGuardTautologicalConsistiency.js @@ -0,0 +1,24 @@ +//// [typeGuardTautologicalConsistiency.ts] +let stringOrNumber: string | number; + +if (typeof stringOrNumber === "number") { + if (typeof stringOrNumber !== "number") { + stringOrNumber; + } +} + +if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { + stringOrNumber; +} + + +//// [typeGuardTautologicalConsistiency.js] +var stringOrNumber; +if (typeof stringOrNumber === "number") { + if (typeof stringOrNumber !== "number") { + stringOrNumber; + } +} +if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { + stringOrNumber; +} diff --git a/tests/baselines/reference/typeGuardTautologicalConsistiency.symbols b/tests/baselines/reference/typeGuardTautologicalConsistiency.symbols new file mode 100644 index 00000000000..9ee82a5413f --- /dev/null +++ b/tests/baselines/reference/typeGuardTautologicalConsistiency.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardTautologicalConsistiency.ts === +let stringOrNumber: string | number; +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) + +if (typeof stringOrNumber === "number") { +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) + + if (typeof stringOrNumber !== "number") { +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) + + stringOrNumber; +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) + } +} + +if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) + + stringOrNumber; +>stringOrNumber : Symbol(stringOrNumber, Decl(typeGuardTautologicalConsistiency.ts, 0, 3)) +} + diff --git a/tests/baselines/reference/typeGuardTautologicalConsistiency.types b/tests/baselines/reference/typeGuardTautologicalConsistiency.types new file mode 100644 index 00000000000..d758dcde22b --- /dev/null +++ b/tests/baselines/reference/typeGuardTautologicalConsistiency.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardTautologicalConsistiency.ts === +let stringOrNumber: string | number; +>stringOrNumber : string | number + +if (typeof stringOrNumber === "number") { +>typeof stringOrNumber === "number" : boolean +>typeof stringOrNumber : string +>stringOrNumber : string | number +>"number" : string + + if (typeof stringOrNumber !== "number") { +>typeof stringOrNumber !== "number" : boolean +>typeof stringOrNumber : string +>stringOrNumber : number +>"number" : string + + stringOrNumber; +>stringOrNumber : string | number + } +} + +if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { +>typeof stringOrNumber === "number" && typeof stringOrNumber !== "number" : boolean +>typeof stringOrNumber === "number" : boolean +>typeof stringOrNumber : string +>stringOrNumber : string | number +>"number" : string +>typeof stringOrNumber !== "number" : boolean +>typeof stringOrNumber : string +>stringOrNumber : number +>"number" : string + + stringOrNumber; +>stringOrNumber : string | number +} + diff --git a/tests/baselines/reference/typeGuardTypeOfUndefined.js b/tests/baselines/reference/typeGuardTypeOfUndefined.js new file mode 100644 index 00000000000..a24ff2ec0dc --- /dev/null +++ b/tests/baselines/reference/typeGuardTypeOfUndefined.js @@ -0,0 +1,357 @@ +//// [typeGuardTypeOfUndefined.ts] +// undefined type guard adds no new type information +function test1(a: any) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test2(a: any) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test3(a: any) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test4(a: any) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test5(a: boolean | void) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test6(a: boolean | void) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test7(a: boolean | void) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test8(a: boolean | void) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test9(a: boolean | number) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test10(a: boolean | number) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test11(a: boolean | number) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test12(a: boolean | number) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test13(a: boolean | number | void) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test14(a: boolean | number | void) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test15(a: boolean | number | void) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test16(a: boolean | number | void) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + + +//// [typeGuardTypeOfUndefined.js] +// undefined type guard adds no new type information +function test1(a) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test2(a) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test3(a) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} +function test4(a) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} +function test5(a) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test6(a) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test7(a) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} +function test8(a) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} +function test9(a) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test10(a) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test11(a) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} +function test12(a) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} +function test13(a) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test14(a) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} +function test15(a) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} +function test16(a) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} diff --git a/tests/baselines/reference/typeGuardTypeOfUndefined.symbols b/tests/baselines/reference/typeGuardTypeOfUndefined.symbols new file mode 100644 index 00000000000..d6d36223fe4 --- /dev/null +++ b/tests/baselines/reference/typeGuardTypeOfUndefined.symbols @@ -0,0 +1,330 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts === +// undefined type guard adds no new type information +function test1(a: any) { +>test1 : Symbol(test1, Decl(typeGuardTypeOfUndefined.ts, 0, 0)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + + if (typeof a !== "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 1, 15)) + } +} + +function test2(a: any) { +>test2 : Symbol(test2, Decl(typeGuardTypeOfUndefined.ts, 13, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + + if (typeof a === "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 15, 15)) + } +} + +function test3(a: any) { +>test3 : Symbol(test3, Decl(typeGuardTypeOfUndefined.ts, 27, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 29, 15)) + + if (typeof a === "undefined" || typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 29, 15)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 29, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 29, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 29, 15)) + } +} + +function test4(a: any) { +>test4 : Symbol(test4, Decl(typeGuardTypeOfUndefined.ts, 36, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 38, 15)) + + if (typeof a !== "undefined" && typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 38, 15)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 38, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 38, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 38, 15)) + } +} + +function test5(a: boolean | void) { +>test5 : Symbol(test5, Decl(typeGuardTypeOfUndefined.ts, 45, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + + if (typeof a !== "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 47, 15)) + } +} + +function test6(a: boolean | void) { +>test6 : Symbol(test6, Decl(typeGuardTypeOfUndefined.ts, 59, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + + if (typeof a === "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 61, 15)) + } +} + +function test7(a: boolean | void) { +>test7 : Symbol(test7, Decl(typeGuardTypeOfUndefined.ts, 73, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 75, 15)) + + if (typeof a === "undefined" || typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 75, 15)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 75, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 75, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 75, 15)) + } +} + +function test8(a: boolean | void) { +>test8 : Symbol(test8, Decl(typeGuardTypeOfUndefined.ts, 82, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 84, 15)) + + if (typeof a !== "undefined" && typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 84, 15)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 84, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 84, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 84, 15)) + } +} + +function test9(a: boolean | number) { +>test9 : Symbol(test9, Decl(typeGuardTypeOfUndefined.ts, 91, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + + if (typeof a !== "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 93, 15)) + } +} + +function test10(a: boolean | number) { +>test10 : Symbol(test10, Decl(typeGuardTypeOfUndefined.ts, 105, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + + if (typeof a === "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 107, 16)) + } +} + +function test11(a: boolean | number) { +>test11 : Symbol(test11, Decl(typeGuardTypeOfUndefined.ts, 119, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 121, 16)) + + if (typeof a === "undefined" || typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 121, 16)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 121, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 121, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 121, 16)) + } +} + +function test12(a: boolean | number) { +>test12 : Symbol(test12, Decl(typeGuardTypeOfUndefined.ts, 128, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 130, 16)) + + if (typeof a !== "undefined" && typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 130, 16)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 130, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 130, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 130, 16)) + } +} + +function test13(a: boolean | number | void) { +>test13 : Symbol(test13, Decl(typeGuardTypeOfUndefined.ts, 137, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + + if (typeof a !== "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 139, 16)) + } +} + +function test14(a: boolean | number | void) { +>test14 : Symbol(test14, Decl(typeGuardTypeOfUndefined.ts, 151, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + + if (typeof a === "undefined") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + + if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + } + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 153, 16)) + } +} + +function test15(a: boolean | number | void) { +>test15 : Symbol(test15, Decl(typeGuardTypeOfUndefined.ts, 165, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 167, 16)) + + if (typeof a === "undefined" || typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 167, 16)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 167, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 167, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 167, 16)) + } +} + +function test16(a: boolean | number | void) { +>test16 : Symbol(test16, Decl(typeGuardTypeOfUndefined.ts, 174, 1)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 176, 16)) + + if (typeof a !== "undefined" && typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 176, 16)) +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 176, 16)) + + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 176, 16)) + } + else { + a; +>a : Symbol(a, Decl(typeGuardTypeOfUndefined.ts, 176, 16)) + } +} + diff --git a/tests/baselines/reference/typeGuardTypeOfUndefined.types b/tests/baselines/reference/typeGuardTypeOfUndefined.types new file mode 100644 index 00000000000..6cf57e1a1dd --- /dev/null +++ b/tests/baselines/reference/typeGuardTypeOfUndefined.types @@ -0,0 +1,434 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts === +// undefined type guard adds no new type information +function test1(a: any) { +>test1 : (a: any) => void +>a : any + + if (typeof a !== "undefined") { +>typeof a !== "undefined" : boolean +>typeof a : string +>a : any +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : any +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : any + } + } + else { + a; +>a : any + } +} + +function test2(a: any) { +>test2 : (a: any) => void +>a : any + + if (typeof a === "undefined") { +>typeof a === "undefined" : boolean +>typeof a : string +>a : any +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : any +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : any + } + } + else { + a; +>a : any + } +} + +function test3(a: any) { +>test3 : (a: any) => void +>a : any + + if (typeof a === "undefined" || typeof a === "boolean") { +>typeof a === "undefined" || typeof a === "boolean" : boolean +>typeof a === "undefined" : boolean +>typeof a : string +>a : any +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : any +>"boolean" : string + + a; +>a : any + } + else { + a; +>a : any + } +} + +function test4(a: any) { +>test4 : (a: any) => void +>a : any + + if (typeof a !== "undefined" && typeof a === "boolean") { +>typeof a !== "undefined" && typeof a === "boolean" : boolean +>typeof a !== "undefined" : boolean +>typeof a : string +>a : any +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : any +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : any + } +} + +function test5(a: boolean | void) { +>test5 : (a: boolean | void) => void +>a : boolean | void + + if (typeof a !== "undefined") { +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | void +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : void + } + } + else { + a; +>a : boolean | void + } +} + +function test6(a: boolean | void) { +>test6 : (a: boolean | void) => void +>a : boolean | void + + if (typeof a === "undefined") { +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | void +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : void + } + } + else { + a; +>a : boolean | void + } +} + +function test7(a: boolean | void) { +>test7 : (a: boolean | void) => void +>a : boolean | void + + if (typeof a === "undefined" || typeof a === "boolean") { +>typeof a === "undefined" || typeof a === "boolean" : boolean +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | void +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | void +>"boolean" : string + + a; +>a : boolean | void + } + else { + a; +>a : void + } +} + +function test8(a: boolean | void) { +>test8 : (a: boolean | void) => void +>a : boolean | void + + if (typeof a !== "undefined" && typeof a === "boolean") { +>typeof a !== "undefined" && typeof a === "boolean" : boolean +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | void +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : boolean | void + } +} + +function test9(a: boolean | number) { +>test9 : (a: boolean | number) => void +>a : boolean | number + + if (typeof a !== "undefined") { +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | number +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : number + } + } + else { + a; +>a : boolean | number + } +} + +function test10(a: boolean | number) { +>test10 : (a: boolean | number) => void +>a : boolean | number + + if (typeof a === "undefined") { +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | number +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : number + } + } + else { + a; +>a : boolean | number + } +} + +function test11(a: boolean | number) { +>test11 : (a: boolean | number) => void +>a : boolean | number + + if (typeof a === "undefined" || typeof a === "boolean") { +>typeof a === "undefined" || typeof a === "boolean" : boolean +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | number +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number +>"boolean" : string + + a; +>a : boolean | number + } + else { + a; +>a : number + } +} + +function test12(a: boolean | number) { +>test12 : (a: boolean | number) => void +>a : boolean | number + + if (typeof a !== "undefined" && typeof a === "boolean") { +>typeof a !== "undefined" && typeof a === "boolean" : boolean +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | number +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : boolean | number + } +} + +function test13(a: boolean | number | void) { +>test13 : (a: boolean | number | void) => void +>a : boolean | number | void + + if (typeof a !== "undefined") { +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | number | void +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : number | void + } + } + else { + a; +>a : boolean | number | void + } +} + +function test14(a: boolean | number | void) { +>test14 : (a: boolean | number | void) => void +>a : boolean | number | void + + if (typeof a === "undefined") { +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | number | void +>"undefined" : string + + if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : number | void + } + } + else { + a; +>a : boolean | number | void + } +} + +function test15(a: boolean | number | void) { +>test15 : (a: boolean | number | void) => void +>a : boolean | number | void + + if (typeof a === "undefined" || typeof a === "boolean") { +>typeof a === "undefined" || typeof a === "boolean" : boolean +>typeof a === "undefined" : boolean +>typeof a : string +>a : boolean | number | void +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number | void +>"boolean" : string + + a; +>a : boolean | number | void + } + else { + a; +>a : number | void + } +} + +function test16(a: boolean | number | void) { +>test16 : (a: boolean | number | void) => void +>a : boolean | number | void + + if (typeof a !== "undefined" && typeof a === "boolean") { +>typeof a !== "undefined" && typeof a === "boolean" : boolean +>typeof a !== "undefined" : boolean +>typeof a : string +>a : boolean | number | void +>"undefined" : string +>typeof a === "boolean" : boolean +>typeof a : string +>a : boolean | number | void +>"boolean" : string + + a; +>a : boolean + } + else { + a; +>a : boolean | number | void + } +} + diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js index 7cf19dac0ad..91443a9ae78 100644 --- a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js @@ -41,12 +41,12 @@ function foo4(x: number | string | boolean) { : x.toString(); // number })(x); // x here is narrowed to number | boolean } -// Type guards affect nested function expressions, but not nested function declarations +// Type guards affect nested function expressions and nested function declarations function foo5(x: number | string | boolean) { if (typeof x === "string") { var y = x; // string; function foo() { - var z = x; // number | string | boolean, type guard has no effect + var z = x; // string } } } @@ -121,12 +121,12 @@ function foo4(x) { : x.toString(); // number })(x); // x here is narrowed to number | boolean } -// Type guards affect nested function expressions, but not nested function declarations +// Type guards affect nested function expressions and nested function declarations function foo5(x) { if (typeof x === "string") { var y = x; // string; function foo() { - var z = x; // number | string | boolean, type guard has no effect + var z = x; // string } } } diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.symbols b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.symbols index 2f3232b0225..34810f303db 100644 --- a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.symbols +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.symbols @@ -130,7 +130,7 @@ function foo4(x: number | string | boolean) { })(x); // x here is narrowed to number | boolean >x : Symbol(x, Decl(typeGuardsInFunctionAndModuleBlock.ts, 32, 14)) } -// Type guards affect nested function expressions, but not nested function declarations +// Type guards affect nested function expressions and nested function declarations function foo5(x: number | string | boolean) { >foo5 : Symbol(foo5, Decl(typeGuardsInFunctionAndModuleBlock.ts, 41, 1)) >x : Symbol(x, Decl(typeGuardsInFunctionAndModuleBlock.ts, 43, 14)) @@ -145,7 +145,7 @@ function foo5(x: number | string | boolean) { function foo() { >foo : Symbol(foo, Decl(typeGuardsInFunctionAndModuleBlock.ts, 45, 18)) - var z = x; // number | string | boolean, type guard has no effect + var z = x; // string >z : Symbol(z, Decl(typeGuardsInFunctionAndModuleBlock.ts, 47, 15)) >x : Symbol(x, Decl(typeGuardsInFunctionAndModuleBlock.ts, 43, 14)) } diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types index 0a084d6eb54..f7d56ed17d1 100644 --- a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types @@ -181,7 +181,7 @@ function foo4(x: number | string | boolean) { })(x); // x here is narrowed to number | boolean >x : number | boolean } -// Type guards affect nested function expressions, but not nested function declarations +// Type guards affect nested function expressions and nested function declarations function foo5(x: number | string | boolean) { >foo5 : (x: number | string | boolean) => void >x : number | string | boolean @@ -199,9 +199,9 @@ function foo5(x: number | string | boolean) { function foo() { >foo : () => void - var z = x; // number | string | boolean, type guard has no effect ->z : number | string | boolean ->x : number | string | boolean + var z = x; // string +>z : string +>x : string } } } diff --git a/tests/baselines/reference/typeParameterConstraints1.errors.txt b/tests/baselines/reference/typeParameterConstraints1.errors.txt index f30fd4f6700..e837e19317d 100644 --- a/tests/baselines/reference/typeParameterConstraints1.errors.txt +++ b/tests/baselines/reference/typeParameterConstraints1.errors.txt @@ -1,12 +1,11 @@ tests/cases/compiler/typeParameterConstraints1.ts(6,25): error TS2304: Cannot find name 'hm'. -tests/cases/compiler/typeParameterConstraints1.ts(8,25): error TS1110: Type expected. tests/cases/compiler/typeParameterConstraints1.ts(9,25): error TS1110: Type expected. tests/cases/compiler/typeParameterConstraints1.ts(10,26): error TS1110: Type expected. tests/cases/compiler/typeParameterConstraints1.ts(11,26): error TS1110: Type expected. tests/cases/compiler/typeParameterConstraints1.ts(12,26): error TS2304: Cannot find name 'undefined'. -==== tests/cases/compiler/typeParameterConstraints1.ts (6 errors) ==== +==== tests/cases/compiler/typeParameterConstraints1.ts (5 errors) ==== function foo1(test: T) { } function foo2(test: T) { } function foo3(test: T) { } @@ -17,8 +16,6 @@ tests/cases/compiler/typeParameterConstraints1.ts(12,26): error TS2304: Cannot f !!! error TS2304: Cannot find name 'hm'. function foo7(test: T) { } // valid function foo8(test: T) { } - ~~ -!!! error TS1110: Type expected. function foo9 (test: T) { } ~ !!! error TS1110: Type expected. diff --git a/tests/baselines/reference/typeParameterEquality.js b/tests/baselines/reference/typeParameterEquality.js new file mode 100644 index 00000000000..b77e534b354 --- /dev/null +++ b/tests/baselines/reference/typeParameterEquality.js @@ -0,0 +1,11 @@ +//// [typeParameterEquality.ts] +class C { + get x(): (a: T) => T { return null; } + set x(p: (a: U) => U) {} +} + +//// [typeParameterEquality.js] +class C { + get x() { return null; } + set x(p) { } +} diff --git a/tests/baselines/reference/typeParameterEquality.symbols b/tests/baselines/reference/typeParameterEquality.symbols new file mode 100644 index 00000000000..562d6277d93 --- /dev/null +++ b/tests/baselines/reference/typeParameterEquality.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/typeParameterEquality.ts === +class C { +>C : Symbol(C, Decl(typeParameterEquality.ts, 0, 0)) + + get x(): (a: T) => T { return null; } +>x : Symbol(x, Decl(typeParameterEquality.ts, 0, 9), Decl(typeParameterEquality.ts, 1, 44)) +>T : Symbol(T, Decl(typeParameterEquality.ts, 1, 14)) +>a : Symbol(a, Decl(typeParameterEquality.ts, 1, 17)) +>T : Symbol(T, Decl(typeParameterEquality.ts, 1, 14)) +>T : Symbol(T, Decl(typeParameterEquality.ts, 1, 14)) + + set x(p: (a: U) => U) {} +>x : Symbol(x, Decl(typeParameterEquality.ts, 0, 9), Decl(typeParameterEquality.ts, 1, 44)) +>p : Symbol(p, Decl(typeParameterEquality.ts, 2, 10)) +>U : Symbol(U, Decl(typeParameterEquality.ts, 2, 14)) +>a : Symbol(a, Decl(typeParameterEquality.ts, 2, 17)) +>U : Symbol(U, Decl(typeParameterEquality.ts, 2, 14)) +>U : Symbol(U, Decl(typeParameterEquality.ts, 2, 14)) +} diff --git a/tests/baselines/reference/typeParameterEquality.types b/tests/baselines/reference/typeParameterEquality.types new file mode 100644 index 00000000000..2e51c3a51e6 --- /dev/null +++ b/tests/baselines/reference/typeParameterEquality.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/typeParameterEquality.ts === +class C { +>C : C + + get x(): (a: T) => T { return null; } +>x : (a: T) => T +>T : T +>a : T +>T : T +>T : T +>null : null + + set x(p: (a: U) => U) {} +>x : (a: T) => T +>p : (a: U) => U +>U : U +>a : U +>U : U +>U : U +} diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt b/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt new file mode 100644 index 00000000000..872a0a10923 --- /dev/null +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/typeParametersAndParametersInComputedNames.ts(6,10): error TS2304: Cannot find name 'T'. +tests/cases/compiler/typeParametersAndParametersInComputedNames.ts(6,13): error TS2304: Cannot find name 'a'. + + +==== tests/cases/compiler/typeParametersAndParametersInComputedNames.ts (2 errors) ==== + function foo(a: T) : string { + return ""; + } + + class A { + [foo(a)](a: T) { + ~ +!!! error TS2304: Cannot find name 'T'. + ~ +!!! error TS2304: Cannot find name 'a'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.js b/tests/baselines/reference/typeParametersAndParametersInComputedNames.js new file mode 100644 index 00000000000..1cb53663fbd --- /dev/null +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.js @@ -0,0 +1,21 @@ +//// [typeParametersAndParametersInComputedNames.ts] +function foo(a: T) : string { + return ""; +} + +class A { + [foo(a)](a: T) { + } +} + +//// [typeParametersAndParametersInComputedNames.js] +function foo(a) { + return ""; +} +var A = (function () { + function A() { + } + A.prototype[foo(a)] = function (a) { + }; + return A; +})(); diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.types b/tests/baselines/reference/typesWithSpecializedCallSignatures.types index fa3ac7a4ba4..b587ee7840e 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.types @@ -19,22 +19,22 @@ class C { >C : C foo(x: 'hi'): Derived1; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'hi' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "hi" >Derived1 : Derived1 foo(x: 'bye'): Derived2; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'bye' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "bye" >Derived2 : Derived2 foo(x: string): Base; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >x : string >Base : Base foo(x) { ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >x : any return x; @@ -50,17 +50,17 @@ interface I { >I : I foo(x: 'hi'): Derived1; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'hi' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "hi" >Derived1 : Derived1 foo(x: 'bye'): Derived2; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'bye' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "bye" >Derived2 : Derived2 foo(x: string): Base; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >x : string >Base : Base } @@ -69,20 +69,20 @@ var i: I; >I : I var a: { ->a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } foo(x: 'hi'): Derived1; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'hi' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "hi" >Derived1 : Derived1 foo(x: 'bye'): Derived2; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->x : 'bye' +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>x : "bye" >Derived2 : Derived2 foo(x: string): Base; ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >x : string >Base : Base @@ -94,9 +94,9 @@ c = i; >i : I c = a; ->c = a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>c = a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } >c : C ->a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } i = c; >i = c : C @@ -104,44 +104,44 @@ i = c; >c : C i = a; ->i = a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>i = a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } >i : I ->a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } a = c; >a = c : C ->a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } >c : C a = i; >a = i : I ->a : { foo(x: 'hi'): Derived1; foo(x: 'bye'): Derived2; foo(x: string): Base; } +>a : { foo(x: "hi"): Derived1; foo(x: "bye"): Derived2; foo(x: string): Base; } >i : I var r1: Derived1 = c.foo('hi'); >r1 : Derived1 >Derived1 : Derived1 >c.foo('hi') : Derived1 ->c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >c : C ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->'hi' : string +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>'hi' : "hi" var r2: Derived2 = c.foo('bye'); >r2 : Derived2 >Derived2 : Derived2 >c.foo('bye') : Derived2 ->c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >c : C ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } ->'bye' : string +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } +>'bye' : "bye" var r3: Base = c.foo('hm'); >r3 : Base >Base : Base >c.foo('hm') : Base ->c.foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >c : C ->foo : { (x: 'hi'): Derived1; (x: 'bye'): Derived2; (x: string): Base; } +>foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >'hm' : string diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types index 66e274d917a..3036c0cea71 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types @@ -19,10 +19,10 @@ class C { >C : C constructor(x: 'hi'); ->x : 'hi' +>x : "hi" constructor(x: 'bye'); ->x : 'bye' +>x : "bye" constructor(x: string); >x : string @@ -44,11 +44,11 @@ interface I { >I : I new(x: 'hi'): Derived1; ->x : 'hi' +>x : "hi" >Derived1 : Derived1 new(x: 'bye'): Derived2; ->x : 'bye' +>x : "bye" >Derived2 : Derived2 new(x: string): Base; @@ -60,14 +60,14 @@ var i: I; >I : I var a: { ->a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } new(x: 'hi'): Derived1; ->x : 'hi' +>x : "hi" >Derived1 : Derived1 new(x: 'bye'): Derived2; ->x : 'bye' +>x : "bye" >Derived2 : Derived2 new(x: string): Base; @@ -82,37 +82,37 @@ c = i; >i : I c = a; ->c = a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>c = a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } >c : C ->a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } i = a; ->i = a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>i = a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } >i : I ->a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } a = i; >a = i : I ->a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } >i : I var r1 = new C('hi'); >r1 : C >new C('hi') : C >C : typeof C ->'hi' : string +>'hi' : "hi" var r2: Derived2 = new i('bye'); >r2 : Derived2 >Derived2 : Derived2 >new i('bye') : Derived2 >i : I ->'bye' : string +>'bye' : "bye" var r3: Base = new a('hm'); >r3 : Base >Base : Base >new a('hm') : Base ->a : { new (x: 'hi'): Derived1; new (x: 'bye'): Derived2; new (x: string): Base; } +>a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } >'hm' : string diff --git a/tests/baselines/reference/withExportDecl.errors.txt b/tests/baselines/reference/withExportDecl.errors.txt deleted file mode 100644 index 77d185d207f..00000000000 --- a/tests/baselines/reference/withExportDecl.errors.txt +++ /dev/null @@ -1,64 +0,0 @@ -tests/cases/compiler/withExportDecl.ts(43,9): error TS1029: 'export' modifier must precede 'declare' modifier. - - -==== tests/cases/compiler/withExportDecl.ts (1 errors) ==== - var simpleVar; - export var exportedSimpleVar; - - var anotherVar: any; - var varWithSimpleType: number; - var varWithArrayType: number[]; - - var varWithInitialValue = 30; - export var exportedVarWithInitialValue = 70; - - var withComplicatedValue = { x: 30, y: 70, desc: "position" }; - export var exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; - - declare var declaredVar; - declare var declareVar2 - - declare var declaredVar; - declare var deckareVarWithType: number; - export declare var exportedDeclaredVar: number; - - var arrayVar: string[] = ['a', 'b']; - - export var exportedArrayVar: { x: number; y: string; }[] ; - exportedArrayVar.push({ x: 30, y : 'hello world' }); - - function simpleFunction() { - return { - x: "Hello", - y: "word", - n: 2 - }; - } - - export function exportedFunction() { - return simpleFunction(); - } - - module m1 { - export function foo() { - return "Hello"; - } - } - declare export module m2 { - ~~~~~~ -!!! error TS1029: 'export' modifier must precede 'declare' modifier. - - export var a: number; - } - - - export module m3 { - - export function foo() { - return m1.foo(); - } - } - - export var eVar1, eVar2 = 10; - var eVar22; - export var eVar3 = 10, eVar4, eVar5; \ No newline at end of file diff --git a/tests/baselines/reference/withExportDecl.js b/tests/baselines/reference/withExportDecl.js index 8d8b8b817ea..085458717ec 100644 --- a/tests/baselines/reference/withExportDecl.js +++ b/tests/baselines/reference/withExportDecl.js @@ -41,7 +41,7 @@ module m1 { return "Hello"; } } -declare export module m2 { +export declare module m2 { export var a: number; } diff --git a/tests/baselines/reference/withExportDecl.symbols b/tests/baselines/reference/withExportDecl.symbols new file mode 100644 index 00000000000..4457abb76ea --- /dev/null +++ b/tests/baselines/reference/withExportDecl.symbols @@ -0,0 +1,129 @@ +=== tests/cases/compiler/withExportDecl.ts === +var simpleVar; +>simpleVar : Symbol(simpleVar, Decl(withExportDecl.ts, 0, 3)) + +export var exportedSimpleVar; +>exportedSimpleVar : Symbol(exportedSimpleVar, Decl(withExportDecl.ts, 1, 10)) + +var anotherVar: any; +>anotherVar : Symbol(anotherVar, Decl(withExportDecl.ts, 3, 3)) + +var varWithSimpleType: number; +>varWithSimpleType : Symbol(varWithSimpleType, Decl(withExportDecl.ts, 4, 3)) + +var varWithArrayType: number[]; +>varWithArrayType : Symbol(varWithArrayType, Decl(withExportDecl.ts, 5, 3)) + +var varWithInitialValue = 30; +>varWithInitialValue : Symbol(varWithInitialValue, Decl(withExportDecl.ts, 7, 3)) + +export var exportedVarWithInitialValue = 70; +>exportedVarWithInitialValue : Symbol(exportedVarWithInitialValue, Decl(withExportDecl.ts, 8, 10)) + +var withComplicatedValue = { x: 30, y: 70, desc: "position" }; +>withComplicatedValue : Symbol(withComplicatedValue, Decl(withExportDecl.ts, 10, 3)) +>x : Symbol(x, Decl(withExportDecl.ts, 10, 28)) +>y : Symbol(y, Decl(withExportDecl.ts, 10, 35)) +>desc : Symbol(desc, Decl(withExportDecl.ts, 10, 42)) + +export var exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; +>exportedWithComplicatedValue : Symbol(exportedWithComplicatedValue, Decl(withExportDecl.ts, 11, 10)) +>x : Symbol(x, Decl(withExportDecl.ts, 11, 43)) +>y : Symbol(y, Decl(withExportDecl.ts, 11, 50)) +>desc : Symbol(desc, Decl(withExportDecl.ts, 11, 57)) + +declare var declaredVar; +>declaredVar : Symbol(declaredVar, Decl(withExportDecl.ts, 13, 11), Decl(withExportDecl.ts, 16, 11)) + +declare var declareVar2 +>declareVar2 : Symbol(declareVar2, Decl(withExportDecl.ts, 14, 11)) + +declare var declaredVar; +>declaredVar : Symbol(declaredVar, Decl(withExportDecl.ts, 13, 11), Decl(withExportDecl.ts, 16, 11)) + +declare var deckareVarWithType: number; +>deckareVarWithType : Symbol(deckareVarWithType, Decl(withExportDecl.ts, 17, 11)) + +export declare var exportedDeclaredVar: number; +>exportedDeclaredVar : Symbol(exportedDeclaredVar, Decl(withExportDecl.ts, 18, 18)) + +var arrayVar: string[] = ['a', 'b']; +>arrayVar : Symbol(arrayVar, Decl(withExportDecl.ts, 20, 3)) + +export var exportedArrayVar: { x: number; y: string; }[] ; +>exportedArrayVar : Symbol(exportedArrayVar, Decl(withExportDecl.ts, 22, 10)) +>x : Symbol(x, Decl(withExportDecl.ts, 22, 30)) +>y : Symbol(y, Decl(withExportDecl.ts, 22, 41)) + +exportedArrayVar.push({ x: 30, y : 'hello world' }); +>exportedArrayVar.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>exportedArrayVar : Symbol(exportedArrayVar, Decl(withExportDecl.ts, 22, 10)) +>push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(withExportDecl.ts, 23, 23)) +>y : Symbol(y, Decl(withExportDecl.ts, 23, 30)) + +function simpleFunction() { +>simpleFunction : Symbol(simpleFunction, Decl(withExportDecl.ts, 23, 52)) + + return { + x: "Hello", +>x : Symbol(x, Decl(withExportDecl.ts, 26, 12)) + + y: "word", +>y : Symbol(y, Decl(withExportDecl.ts, 27, 19)) + + n: 2 +>n : Symbol(n, Decl(withExportDecl.ts, 28, 18)) + + }; +} + +export function exportedFunction() { +>exportedFunction : Symbol(exportedFunction, Decl(withExportDecl.ts, 31, 1)) + + return simpleFunction(); +>simpleFunction : Symbol(simpleFunction, Decl(withExportDecl.ts, 23, 52)) +} + +module m1 { +>m1 : Symbol(m1, Decl(withExportDecl.ts, 35, 1)) + + export function foo() { +>foo : Symbol(foo, Decl(withExportDecl.ts, 37, 11)) + + return "Hello"; + } +} +export declare module m2 { +>m2 : Symbol(m2, Decl(withExportDecl.ts, 41, 1)) + + export var a: number; +>a : Symbol(a, Decl(withExportDecl.ts, 44, 14)) +} + + +export module m3 { +>m3 : Symbol(m3, Decl(withExportDecl.ts, 45, 1)) + + export function foo() { +>foo : Symbol(foo, Decl(withExportDecl.ts, 48, 18)) + + return m1.foo(); +>m1.foo : Symbol(m1.foo, Decl(withExportDecl.ts, 37, 11)) +>m1 : Symbol(m1, Decl(withExportDecl.ts, 35, 1)) +>foo : Symbol(m1.foo, Decl(withExportDecl.ts, 37, 11)) + } +} + +export var eVar1, eVar2 = 10; +>eVar1 : Symbol(eVar1, Decl(withExportDecl.ts, 55, 10)) +>eVar2 : Symbol(eVar2, Decl(withExportDecl.ts, 55, 17)) + +var eVar22; +>eVar22 : Symbol(eVar22, Decl(withExportDecl.ts, 56, 3)) + +export var eVar3 = 10, eVar4, eVar5; +>eVar3 : Symbol(eVar3, Decl(withExportDecl.ts, 57, 10)) +>eVar4 : Symbol(eVar4, Decl(withExportDecl.ts, 57, 22)) +>eVar5 : Symbol(eVar5, Decl(withExportDecl.ts, 57, 29)) + diff --git a/tests/baselines/reference/withExportDecl.types b/tests/baselines/reference/withExportDecl.types new file mode 100644 index 00000000000..099a6241f44 --- /dev/null +++ b/tests/baselines/reference/withExportDecl.types @@ -0,0 +1,156 @@ +=== tests/cases/compiler/withExportDecl.ts === +var simpleVar; +>simpleVar : any + +export var exportedSimpleVar; +>exportedSimpleVar : any + +var anotherVar: any; +>anotherVar : any + +var varWithSimpleType: number; +>varWithSimpleType : number + +var varWithArrayType: number[]; +>varWithArrayType : number[] + +var varWithInitialValue = 30; +>varWithInitialValue : number +>30 : number + +export var exportedVarWithInitialValue = 70; +>exportedVarWithInitialValue : number +>70 : number + +var withComplicatedValue = { x: 30, y: 70, desc: "position" }; +>withComplicatedValue : { x: number; y: number; desc: string; } +>{ x: 30, y: 70, desc: "position" } : { x: number; y: number; desc: string; } +>x : number +>30 : number +>y : number +>70 : number +>desc : string +>"position" : string + +export var exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; +>exportedWithComplicatedValue : { x: number; y: number; desc: string; } +>{ x: 30, y: 70, desc: "position" } : { x: number; y: number; desc: string; } +>x : number +>30 : number +>y : number +>70 : number +>desc : string +>"position" : string + +declare var declaredVar; +>declaredVar : any + +declare var declareVar2 +>declareVar2 : any + +declare var declaredVar; +>declaredVar : any + +declare var deckareVarWithType: number; +>deckareVarWithType : number + +export declare var exportedDeclaredVar: number; +>exportedDeclaredVar : number + +var arrayVar: string[] = ['a', 'b']; +>arrayVar : string[] +>['a', 'b'] : string[] +>'a' : string +>'b' : string + +export var exportedArrayVar: { x: number; y: string; }[] ; +>exportedArrayVar : { x: number; y: string; }[] +>x : number +>y : string + +exportedArrayVar.push({ x: 30, y : 'hello world' }); +>exportedArrayVar.push({ x: 30, y : 'hello world' }) : number +>exportedArrayVar.push : (...items: { x: number; y: string; }[]) => number +>exportedArrayVar : { x: number; y: string; }[] +>push : (...items: { x: number; y: string; }[]) => number +>{ x: 30, y : 'hello world' } : { x: number; y: string; } +>x : number +>30 : number +>y : string +>'hello world' : string + +function simpleFunction() { +>simpleFunction : () => { x: string; y: string; n: number; } + + return { +>{ x: "Hello", y: "word", n: 2 } : { x: string; y: string; n: number; } + + x: "Hello", +>x : string +>"Hello" : string + + y: "word", +>y : string +>"word" : string + + n: 2 +>n : number +>2 : number + + }; +} + +export function exportedFunction() { +>exportedFunction : () => { x: string; y: string; n: number; } + + return simpleFunction(); +>simpleFunction() : { x: string; y: string; n: number; } +>simpleFunction : () => { x: string; y: string; n: number; } +} + +module m1 { +>m1 : typeof m1 + + export function foo() { +>foo : () => string + + return "Hello"; +>"Hello" : string + } +} +export declare module m2 { +>m2 : typeof m2 + + export var a: number; +>a : number +} + + +export module m3 { +>m3 : typeof m3 + + export function foo() { +>foo : () => string + + return m1.foo(); +>m1.foo() : string +>m1.foo : () => string +>m1 : typeof m1 +>foo : () => string + } +} + +export var eVar1, eVar2 = 10; +>eVar1 : any +>eVar2 : number +>10 : number + +var eVar22; +>eVar22 : any + +export var eVar3 = 10, eVar4, eVar5; +>eVar3 : number +>10 : number +>eVar4 : any +>eVar5 : any + diff --git a/tests/cases/compiler/ambientClassDeclarationWithExtends.ts b/tests/cases/compiler/ambientClassDeclarationWithExtends.ts index 0c5d8d156bf..ca26f1b2a44 100644 --- a/tests/cases/compiler/ambientClassDeclarationWithExtends.ts +++ b/tests/cases/compiler/ambientClassDeclarationWithExtends.ts @@ -1,2 +1,23 @@ +// @Filename: ambientClassDeclarationExtends_singleFile.ts declare class A { } declare class B extends A { } + +declare class C { + public foo; +} +namespace D { var x; } +declare class D extends C { } + +var d: C = new D(); + +// @Filename: ambientClassDeclarationExtends_file1.ts + +declare class E { + public bar; +} +namespace F { var y; } + +// @Filename: ambientClassDeclarationExtends_file2.ts + +declare class F extends E { } +var f: E = new F(); diff --git a/tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts b/tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts new file mode 100644 index 00000000000..931f64a4b29 --- /dev/null +++ b/tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts @@ -0,0 +1,11 @@ +declare function use(a: any): void; + +class A { + doIt(x: Array): void { + x.forEach((v) => { + switch(v) { + case "test": use(this); + } + }); + } +} \ No newline at end of file diff --git a/tests/cases/compiler/classdecl.ts b/tests/cases/compiler/classdecl.ts index 785faf82865..2b9a55a1f3e 100644 --- a/tests/cases/compiler/classdecl.ts +++ b/tests/cases/compiler/classdecl.ts @@ -1,4 +1,5 @@ // @declaration: true +// @target: es5 class a { //constructor (); constructor (n: number); @@ -13,7 +14,7 @@ class a { public get d() { return 30; } - public set d() { + public set d(a: number) { } public static get p2() { diff --git a/tests/cases/compiler/commonSourceDir1.ts b/tests/cases/compiler/commonSourceDir1.ts new file mode 100644 index 00000000000..1a178ac0226 --- /dev/null +++ b/tests/cases/compiler/commonSourceDir1.ts @@ -0,0 +1,6 @@ +// @outDir: A:/ +// @Filename: A:/foo/bar.ts +var x: number; + +// @Filename: A:/foo/baz.ts +var y: number; diff --git a/tests/cases/compiler/commonSourceDir2.ts b/tests/cases/compiler/commonSourceDir2.ts new file mode 100644 index 00000000000..68dab0727a3 --- /dev/null +++ b/tests/cases/compiler/commonSourceDir2.ts @@ -0,0 +1,6 @@ +// @outDir: A:/ +// @Filename: A:/foo/bar.ts +var x: number; + +// @Filename: B:/foo/baz.ts +var y: number; \ No newline at end of file diff --git a/tests/cases/compiler/commonSourceDir3.ts b/tests/cases/compiler/commonSourceDir3.ts new file mode 100644 index 00000000000..54b6e8c89b7 --- /dev/null +++ b/tests/cases/compiler/commonSourceDir3.ts @@ -0,0 +1,7 @@ +// @useCaseSensitiveFileNames: false +// @outDir: A:/ +// @Filename: A:/foo/bar.ts +var x: number; + +// @Filename: a:/foo/baz.ts +var y: number; \ No newline at end of file diff --git a/tests/cases/compiler/commonSourceDir4.ts b/tests/cases/compiler/commonSourceDir4.ts new file mode 100644 index 00000000000..41ee7a0344a --- /dev/null +++ b/tests/cases/compiler/commonSourceDir4.ts @@ -0,0 +1,7 @@ +// @useCaseSensitiveFileNames: true +// @outDir: A:/ +// @Filename: A:/foo/bar.ts +var x: number; + +// @Filename: a:/foo/baz.ts +var y: number; \ No newline at end of file diff --git a/tests/cases/compiler/computedPropertiesInDestructuring1.ts b/tests/cases/compiler/computedPropertiesInDestructuring1.ts new file mode 100644 index 00000000000..d3ccaa57ad1 --- /dev/null +++ b/tests/cases/compiler/computedPropertiesInDestructuring1.ts @@ -0,0 +1,36 @@ +// destructuring in variable declarations +let foo = "bar"; +let {[foo]: bar} = {bar: "bar"}; + +let {["bar"]: bar2} = {bar: "bar"}; + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {bar: "bar"}; + +let [{[foo]: bar4}] = [{bar: "bar"}]; +let [{[foo2()]: bar5}] = [{bar: "bar"}]; + +function f1({["bar"]: x}: { bar: number }) {} +function f2({[foo]: x}: { bar: number }) {} +function f3({[foo2()]: x}: { bar: number }) {} +function f4([{[foo]: x}]: [{ bar: number }]) {} +function f5([{[foo2()]: x}]: [{ bar: number }]) {} + +// report errors on type errors in computed properties used in destructuring +let [{[foo()]: bar6}] = [{bar: "bar"}]; +let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + +// destructuring assignment +({[foo]: bar} = {bar: "bar"}); + +({["bar"]: bar2} = {bar: "bar"}); + +({[foo2()]: bar3} = {bar: "bar"}); + +[{[foo]: bar4}] = [{bar: "bar"}]; +[{[foo2()]: bar5}] = [{bar: "bar"}]; + +[{[foo()]: bar4}] = [{bar: "bar"}]; +[{[(1 + {})]: bar4}] = [{bar: "bar"}]; + + diff --git a/tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts b/tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts new file mode 100644 index 00000000000..4951e474fdb --- /dev/null +++ b/tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts @@ -0,0 +1,36 @@ +// @target: ES6 +// destructuring in variable declarations +let foo = "bar"; +let {[foo]: bar} = {bar: "bar"}; + +let {["bar"]: bar2} = {bar: "bar"}; +let {[11]: bar2_1} = {11: "bar"}; + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {bar: "bar"}; + +let [{[foo]: bar4}] = [{bar: "bar"}]; +let [{[foo2()]: bar5}] = [{bar: "bar"}]; + +function f1({["bar"]: x}: { bar: number }) {} +function f2({[foo]: x}: { bar: number }) {} +function f3({[foo2()]: x}: { bar: number }) {} +function f4([{[foo]: x}]: [{ bar: number }]) {} +function f5([{[foo2()]: x}]: [{ bar: number }]) {} + +// report errors on type errors in computed properties used in destructuring +let [{[foo()]: bar6}] = [{bar: "bar"}]; +let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; + +// destructuring assignment +({[foo]: bar} = {bar: "bar"}); + +({["bar"]: bar2} = {bar: "bar"}); + +({[foo2()]: bar3} = {bar: "bar"}); + +[{[foo]: bar4}] = [{bar: "bar"}]; +[{[foo2()]: bar5}] = [{bar: "bar"}]; + +[{[foo()]: bar4}] = [{bar: "bar"}]; +[{[(1 + {})]: bar4}] = [{bar: "bar"}]; diff --git a/tests/cases/compiler/computedPropertiesInDestructuring2.ts b/tests/cases/compiler/computedPropertiesInDestructuring2.ts new file mode 100644 index 00000000000..806c528c17c --- /dev/null +++ b/tests/cases/compiler/computedPropertiesInDestructuring2.ts @@ -0,0 +1,2 @@ +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {}; \ No newline at end of file diff --git a/tests/cases/compiler/computedPropertiesInDestructuring2_ES6.ts b/tests/cases/compiler/computedPropertiesInDestructuring2_ES6.ts new file mode 100644 index 00000000000..c21f86bed1c --- /dev/null +++ b/tests/cases/compiler/computedPropertiesInDestructuring2_ES6.ts @@ -0,0 +1,4 @@ +// @target: ES6 + +let foo2 = () => "bar"; +let {[foo2()]: bar3} = {}; \ No newline at end of file diff --git a/tests/cases/compiler/declFileObjectLiteralWithAccessors.ts b/tests/cases/compiler/declFileObjectLiteralWithAccessors.ts index 4d424e75d23..24b094b602d 100644 --- a/tests/cases/compiler/declFileObjectLiteralWithAccessors.ts +++ b/tests/cases/compiler/declFileObjectLiteralWithAccessors.ts @@ -1,4 +1,5 @@ // @declaration: true +// @target: es5 function /*1*/makePoint(x: number) { return { diff --git a/tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts b/tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts index 545018c5a7f..79c9b581e5f 100644 --- a/tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts +++ b/tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts @@ -1,4 +1,5 @@ // @declaration: true +// @target: es5 function /*1*/makePoint(x: number) { return { diff --git a/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts b/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts index b82cebc553f..de11cec9fe8 100644 --- a/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts +++ b/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts @@ -1,4 +1,5 @@ // @declaration: true +// @target: es5 function /*1*/makePoint(x: number) { return { diff --git a/tests/cases/compiler/declFilePrivateStatic.ts b/tests/cases/compiler/declFilePrivateStatic.ts index 77edf963b69..0d64844ff99 100644 --- a/tests/cases/compiler/declFilePrivateStatic.ts +++ b/tests/cases/compiler/declFilePrivateStatic.ts @@ -1,4 +1,5 @@ // @declaration: true +// @target: es5 class C { private static x = 1; diff --git a/tests/cases/compiler/declFileWithErrorsInInputDeclarationFile.ts b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFile.ts new file mode 100644 index 00000000000..e7d3b592932 --- /dev/null +++ b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFile.ts @@ -0,0 +1,15 @@ +// @declaration: true + +// @Filename: declFile.d.ts +declare module M { + declare var x; + declare function f(); + + declare module N { } + + declare class C { } +} + +// @Filename: client.ts +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file diff --git a/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts new file mode 100644 index 00000000000..005b52d5bc9 --- /dev/null +++ b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts @@ -0,0 +1,16 @@ +// @declaration: true +// @out: out.js + +// @Filename: declFile.d.ts +declare module M { + declare var x; + declare function f(); + + declare module N { } + + declare class C { } +} + +// @Filename: client.ts +/// +var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file diff --git a/tests/cases/compiler/declarationFileOverwriteError.ts b/tests/cases/compiler/declarationFileOverwriteError.ts new file mode 100644 index 00000000000..b7ecb654002 --- /dev/null +++ b/tests/cases/compiler/declarationFileOverwriteError.ts @@ -0,0 +1,9 @@ +// @declaration: true + +// @Filename: a.d.ts +declare class c { +} + +// @FileName: a.ts +class d { +} \ No newline at end of file diff --git a/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts b/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts new file mode 100644 index 00000000000..b43c9a8b2e0 --- /dev/null +++ b/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts @@ -0,0 +1,10 @@ +// @declaration: true +// @out: tests/cases/compiler/out.js + +// @Filename: out.d.ts +declare class c { +} + +// @FileName: a.ts +class d { +} \ No newline at end of file diff --git a/tests/cases/compiler/filesEmittingIntoSameOutput.ts b/tests/cases/compiler/filesEmittingIntoSameOutput.ts new file mode 100644 index 00000000000..2e53db45edc --- /dev/null +++ b/tests/cases/compiler/filesEmittingIntoSameOutput.ts @@ -0,0 +1,7 @@ +// @filename: a.ts +class c { +} + +// @filename: a.tsx +function foo() { +} diff --git a/tests/cases/compiler/filesEmittingIntoSameOutputWithOutOption.ts b/tests/cases/compiler/filesEmittingIntoSameOutputWithOutOption.ts new file mode 100644 index 00000000000..e8770c99fba --- /dev/null +++ b/tests/cases/compiler/filesEmittingIntoSameOutputWithOutOption.ts @@ -0,0 +1,9 @@ +// @out: tests/cases/compiler/a.js +// @module: amd +// @filename: a.ts +export class c { +} + +// @filename: b.ts +function foo() { +} diff --git a/tests/cases/compiler/functionVariableInReturnTypeAnnotation.ts b/tests/cases/compiler/functionVariableInReturnTypeAnnotation.ts new file mode 100644 index 00000000000..c8936034a25 --- /dev/null +++ b/tests/cases/compiler/functionVariableInReturnTypeAnnotation.ts @@ -0,0 +1,4 @@ +function bar(): typeof b { + var b = 1; + return undefined; +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationAmbientVarDeclarationSyntax.ts b/tests/cases/compiler/jsFileCompilationAmbientVarDeclarationSyntax.ts new file mode 100644 index 00000000000..2654dddf2bc --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationAmbientVarDeclarationSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +declare var v; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationClassMethodContainingArrowFunction.ts b/tests/cases/compiler/jsFileCompilationClassMethodContainingArrowFunction.ts new file mode 100644 index 00000000000..50adc50388d --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationClassMethodContainingArrowFunction.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @out: out.js + +// @FileName: a.js +class c { + method(a) { + let x = a => this.method(a); + } +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationDecoratorSyntax.ts b/tests/cases/compiler/jsFileCompilationDecoratorSyntax.ts new file mode 100644 index 00000000000..2ef95db01fe --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationDecoratorSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +@internal class C { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts new file mode 100644 index 00000000000..8517c9dbf8e --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts @@ -0,0 +1,12 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: b.js +function foo() { + return 10; +} +// @filename: a.ts +function foo() { + return 30; +} + diff --git a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts new file mode 100644 index 00000000000..a02b7d9d88a --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts @@ -0,0 +1,13 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +function foo() { + return 30; +} + +// @filename: b.js +function foo() { + return 10; +} + diff --git a/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts b/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts new file mode 100644 index 00000000000..cf2e27de885 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +var x = 10; + +// @filename: b.js +var x = "hello"; // No error is recorded here and declaration file will show this as number \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts b/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts new file mode 100644 index 00000000000..05b750fe608 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: b.js +var x = "hello"; + +// @filename: a.ts +var x = 10; // Error reported so no declaration file generated? \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationEmitBlockedCorrectly.ts b/tests/cases/compiler/jsFileCompilationEmitBlockedCorrectly.ts new file mode 100644 index 00000000000..55f1d0ad933 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationEmitBlockedCorrectly.ts @@ -0,0 +1,13 @@ +// @allowJs: true +// @filename: a.ts +class c { +} + +// @filename: b.ts +// this should be emitted +class d { +} + +// @filename: a.js +function foo() { +} diff --git a/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts b/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts new file mode 100644 index 00000000000..9d6daeac6fa --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts @@ -0,0 +1,10 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +class c { +} + +// @filename: b.js +function foo() { +} diff --git a/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts b/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts new file mode 100644 index 00000000000..8d41ac2ef13 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts @@ -0,0 +1,15 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +class c { +} + +// @filename: b.js +/// +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationEnumSyntax.ts b/tests/cases/compiler/jsFileCompilationEnumSyntax.ts new file mode 100644 index 00000000000..1c607d09cb6 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationEnumSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +enum E { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.ts b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.ts new file mode 100644 index 00000000000..1741e3c2802 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.ts @@ -0,0 +1,15 @@ +// @allowJs: true +// @declaration: true +// @filename: a.ts +class c { +} + +// @filename: b.ts +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts new file mode 100644 index 00000000000..35228678bb7 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts @@ -0,0 +1,16 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +class c { +} + +// @filename: b.ts +/// +// error on above reference when emitting declarations +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.ts b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.ts new file mode 100644 index 00000000000..64e009c2515 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.ts @@ -0,0 +1,16 @@ +// @allowJs: true +// @declaration: true +// @outDir: outDir +// @filename: a.ts +class c { +} + +// @filename: b.ts +/// +// b.d.ts should have c.js as the reference path since we dont emit declarations for js files +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationExportAssignmentSyntax.ts b/tests/cases/compiler/jsFileCompilationExportAssignmentSyntax.ts new file mode 100644 index 00000000000..c6fced0e2d3 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationExportAssignmentSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +export = b; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationHeritageClauseSyntaxOfClass.ts b/tests/cases/compiler/jsFileCompilationHeritageClauseSyntaxOfClass.ts new file mode 100644 index 00000000000..5e8587bb252 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationHeritageClauseSyntaxOfClass.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +class C implements D { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationImportEqualsSyntax.ts b/tests/cases/compiler/jsFileCompilationImportEqualsSyntax.ts new file mode 100644 index 00000000000..e7a38914931 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationImportEqualsSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +import a = b; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationInterfaceSyntax.ts b/tests/cases/compiler/jsFileCompilationInterfaceSyntax.ts new file mode 100644 index 00000000000..205e06395ac --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationInterfaceSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +interface I { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationLetBeingRenamed.ts b/tests/cases/compiler/jsFileCompilationLetBeingRenamed.ts new file mode 100644 index 00000000000..177b0f55e27 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationLetBeingRenamed.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @out: out.js + +// @FileName: a.js +function foo(a) { + for (let a = 0; a < 10; a++) { + // do something + } +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts new file mode 100644 index 00000000000..962267c5cab --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts @@ -0,0 +1,10 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: b.js +let a = 10; +b = 30; + +// @filename: a.ts +let b = 30; +a = 10; diff --git a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts new file mode 100644 index 00000000000..8f89c57ade2 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @out: out.js +// @declaration: true +// @filename: a.ts +let b = 30; +a = 10; +// @filename: b.js +let a = 10; +b = 30; diff --git a/tests/cases/compiler/jsFileCompilationModuleSyntax.ts b/tests/cases/compiler/jsFileCompilationModuleSyntax.ts new file mode 100644 index 00000000000..f7d1a9070f6 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationModuleSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +module M { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.ts b/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.ts new file mode 100644 index 00000000000..111645d995e --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.ts @@ -0,0 +1,14 @@ +// @allowJs: true +// @filename: a.ts +class c { +} + +// @filename: b.ts +/// +// no error on above reference path since not emitting declarations +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.ts b/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.ts new file mode 100644 index 00000000000..8783b722f2a --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithOut.ts @@ -0,0 +1,15 @@ +// @allowJs: true +// @out: out.js +// @filename: a.ts +class c { +} + +// @filename: b.ts +/// +//no error on above reference since not emitting declarations +function foo() { +} + +// @filename: c.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationOptionalParameter.ts b/tests/cases/compiler/jsFileCompilationOptionalParameter.ts new file mode 100644 index 00000000000..541ff041c2a --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationOptionalParameter.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +function F(p?) { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationPropertySyntaxOfClass.ts b/tests/cases/compiler/jsFileCompilationPropertySyntaxOfClass.ts new file mode 100644 index 00000000000..62a0058bcef --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationPropertySyntaxOfClass.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +class C { v } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationPublicMethodSyntaxOfClass.ts b/tests/cases/compiler/jsFileCompilationPublicMethodSyntaxOfClass.ts new file mode 100644 index 00000000000..2016d4afdbd --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationPublicMethodSyntaxOfClass.ts @@ -0,0 +1,6 @@ +// @allowJs: true +// @filename: a.js +class C { + public foo() { + } +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationPublicParameterModifier.ts b/tests/cases/compiler/jsFileCompilationPublicParameterModifier.ts new file mode 100644 index 00000000000..0c17ea98ccc --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationPublicParameterModifier.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +class C { constructor(public x) { }} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationRestParameter.ts b/tests/cases/compiler/jsFileCompilationRestParameter.ts new file mode 100644 index 00000000000..560fc1ebd1a --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationRestParameter.ts @@ -0,0 +1,5 @@ +// @allowJs: true +// @filename: a.js +// @target: es6 +// @out: b.js +function foo(...a) { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationReturnTypeSyntaxOfFunction.ts b/tests/cases/compiler/jsFileCompilationReturnTypeSyntaxOfFunction.ts new file mode 100644 index 00000000000..8e9412d489a --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationReturnTypeSyntaxOfFunction.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +function F(): number { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationShortHandProperty.ts b/tests/cases/compiler/jsFileCompilationShortHandProperty.ts new file mode 100644 index 00000000000..476658e0fa1 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationShortHandProperty.ts @@ -0,0 +1,12 @@ +// @allowJs: true +// @out: out.js + +// @FileName: a.js +function foo() { + var a = 10; + var b = "Hello"; + return { + a, + b + }; +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationSyntaxError.ts b/tests/cases/compiler/jsFileCompilationSyntaxError.ts new file mode 100644 index 00000000000..4d17d6d3aae --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationSyntaxError.ts @@ -0,0 +1,7 @@ +// @allowJs: true +// @filename: a.js +/** + * @type {number} + * @type {string} + */ +var v; diff --git a/tests/cases/compiler/jsFileCompilationTypeAliasSyntax.ts b/tests/cases/compiler/jsFileCompilationTypeAliasSyntax.ts new file mode 100644 index 00000000000..d849ca5ea4b --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeAliasSyntax.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +type a = b; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeArgumentSyntaxOfCall.ts b/tests/cases/compiler/jsFileCompilationTypeArgumentSyntaxOfCall.ts new file mode 100644 index 00000000000..a5bcdae904b --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeArgumentSyntaxOfCall.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +Foo(); \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeAssertions.ts b/tests/cases/compiler/jsFileCompilationTypeAssertions.ts new file mode 100644 index 00000000000..15f39b36d01 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeAssertions.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +var v = undefined; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeOfParameter.ts b/tests/cases/compiler/jsFileCompilationTypeOfParameter.ts new file mode 100644 index 00000000000..d9e42c264da --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeOfParameter.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +function F(a: number) { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfClass.ts b/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfClass.ts new file mode 100644 index 00000000000..d0aa85f5993 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfClass.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +class C { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfFunction.ts b/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfFunction.ts new file mode 100644 index 00000000000..19a567fbdb5 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeParameterSyntaxOfFunction.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +function F() { } \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationTypeSyntaxOfVar.ts b/tests/cases/compiler/jsFileCompilationTypeSyntaxOfVar.ts new file mode 100644 index 00000000000..14085ea9dfb --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeSyntaxOfVar.ts @@ -0,0 +1,3 @@ +// @allowJs: true +// @filename: a.js +var v: () => number; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithDeclarationEmitPathSameAsInput.ts b/tests/cases/compiler/jsFileCompilationWithDeclarationEmitPathSameAsInput.ts new file mode 100644 index 00000000000..c200602dddd --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithDeclarationEmitPathSameAsInput.ts @@ -0,0 +1,7 @@ +// @declaration: true +// @filename: a.ts +class c { +} + +// @filename: a.d.ts +declare function isC(): boolean; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithJsEmitPathSameAsInput.ts b/tests/cases/compiler/jsFileCompilationWithJsEmitPathSameAsInput.ts new file mode 100644 index 00000000000..82dba88f785 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithJsEmitPathSameAsInput.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @filename: a.ts +class c { +} + +// @filename: a.js +function foo() { +} diff --git a/tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts b/tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts new file mode 100644 index 00000000000..4008204cd66 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts @@ -0,0 +1,14 @@ +// @allowJs: true +// @sourcemap: true + +// @filename: a.ts +class c { +} + +// @filename: b.js.map +function foo() { +} + +// @filename: b.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.ts b/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.ts new file mode 100644 index 00000000000..ae510f9eec3 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.ts @@ -0,0 +1,14 @@ +// @allowJs: true +// @inlineSourceMap: true + +// @filename: a.ts +class c { +} + +// @filename: b.js.map +function foo() { +} + +// @filename: b.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithOutDir.ts b/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithOutDir.ts new file mode 100644 index 00000000000..9e39ae274b4 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithOutDir.ts @@ -0,0 +1,15 @@ +// @allowJs: true,map +// @sourcemap: true +// @outdir: out + +// @filename: a.ts +class c { +} + +// @filename: b.js.map +function foo() { +} + +// @filename: b.js +function bar() { +} \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithOut.ts b/tests/cases/compiler/jsFileCompilationWithOut.ts new file mode 100644 index 00000000000..f76605b7fe6 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithOut.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @out: out.js +// @filename: a.ts +class c { +} + +// @filename: b.js +function foo() { +} diff --git a/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts b/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts new file mode 100644 index 00000000000..1c6bb41de14 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts @@ -0,0 +1,8 @@ +// @declaration: true +// @out: tests/cases/compiler/b.js +// @filename: a.ts +class c { +} + +// @filename: b.d.ts +declare function foo(): boolean; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithOutFileNameSameAsInputJsFile.ts b/tests/cases/compiler/jsFileCompilationWithOutFileNameSameAsInputJsFile.ts new file mode 100644 index 00000000000..16410244004 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithOutFileNameSameAsInputJsFile.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @out: tests/cases/compiler/b.js +// @filename: a.ts +class c { +} + +// @filename: b.js +function foo() { +} diff --git a/tests/cases/compiler/jsFileCompilationWithoutJsExtensions.ts b/tests/cases/compiler/jsFileCompilationWithoutJsExtensions.ts new file mode 100644 index 00000000000..636866e7eeb --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithoutJsExtensions.ts @@ -0,0 +1,2 @@ +// @filename: a.js +declare var v; \ No newline at end of file diff --git a/tests/cases/compiler/jsFileCompilationWithoutOut.ts b/tests/cases/compiler/jsFileCompilationWithoutOut.ts new file mode 100644 index 00000000000..667315a55a9 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationWithoutOut.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @filename: a.ts +class c { +} + +// @filename: b.js +function foo() { +} diff --git a/tests/cases/compiler/literalsInComputedProperties1.ts b/tests/cases/compiler/literalsInComputedProperties1.ts new file mode 100644 index 00000000000..e3fed5b80aa --- /dev/null +++ b/tests/cases/compiler/literalsInComputedProperties1.ts @@ -0,0 +1,52 @@ +// @noImplicitAny: true + +let x = { + 1:1, + [2]:1, + "3":1, + ["4"]:1 +} +x[1].toExponential(); +x[2].toExponential(); +x[3].toExponential(); +x[4].toExponential(); + +interface A { + 1:number; + [2]:number; + "3":number; + ["4"]:number; +} + +let y:A; +y[1].toExponential(); +y[2].toExponential(); +y[3].toExponential(); +y[4].toExponential(); + +class C { + 1:number; + [2]:number; + "3":number; + ["4"]:number; +} + +let z:C; +z[1].toExponential(); +z[2].toExponential(); +z[3].toExponential(); +z[4].toExponential(); + +enum X { + 1 = 1, + [2] = 2, + "3" = 3, + ["4"] = 4, + "foo" = 5, + ["bar"] = 6 +} + +let a = X["foo"]; +let a0 = X["bar"]; + +// TODO: make sure that enum still disallow template literals as member names \ No newline at end of file diff --git a/tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts b/tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts new file mode 100644 index 00000000000..6395813b658 --- /dev/null +++ b/tests/cases/compiler/mixedStaticAndInstanceClassMembers.ts @@ -0,0 +1,15 @@ +class A { + f() {} + static m1 (a: string): void; + m1 (a: number): void; + m1 (a: any): void { + } +} + +class B { + f() {} + m1 (a: string): void; + static m1 (a: number): void; + m1 (a: any): void { + } +} \ No newline at end of file diff --git a/tests/cases/compiler/moduledecl.ts b/tests/cases/compiler/moduledecl.ts index 0997f00eab4..eac2e9ff78c 100644 --- a/tests/cases/compiler/moduledecl.ts +++ b/tests/cases/compiler/moduledecl.ts @@ -1,4 +1,6 @@ // @declaration: true +// @target: es5 + module a { } diff --git a/tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts b/tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts new file mode 100644 index 00000000000..6ec4c6076f2 --- /dev/null +++ b/tests/cases/compiler/nonMergedDeclarationsAndOverloads.ts @@ -0,0 +1,8 @@ +class A { + m1: string; + f() {} + m1 (a: string): void; + m1 (a: number): void; + m1 (a: any): void { + } +} \ No newline at end of file diff --git a/tests/cases/compiler/nonMergedOverloads.ts b/tests/cases/compiler/nonMergedOverloads.ts new file mode 100644 index 00000000000..582cd72e1f4 --- /dev/null +++ b/tests/cases/compiler/nonMergedOverloads.ts @@ -0,0 +1,5 @@ +var f = 10; + +export function f(); +export function f() { +} \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts b/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts new file mode 100644 index 00000000000..ddea5f363c7 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts @@ -0,0 +1,4 @@ +// @mapRoot: local +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts b/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts new file mode 100644 index 00000000000..b4fdc66e309 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts @@ -0,0 +1,4 @@ +// @sourceRoot: local +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts b/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts new file mode 100644 index 00000000000..d78097985d8 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts @@ -0,0 +1,4 @@ +// @sourcemap: true +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsSourcemapInlineSources.ts b/tests/cases/compiler/optionsSourcemapInlineSources.ts new file mode 100644 index 00000000000..dddfb5f84ca --- /dev/null +++ b/tests/cases/compiler/optionsSourcemapInlineSources.ts @@ -0,0 +1,4 @@ +// @sourcemap: true +// @inlineSources: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts b/tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts new file mode 100644 index 00000000000..c7a74469dc1 --- /dev/null +++ b/tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts @@ -0,0 +1,5 @@ +// @sourcemap: true +// @inlineSources: true +// @mapRoot: local + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts b/tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts new file mode 100644 index 00000000000..4fd372658ad --- /dev/null +++ b/tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts @@ -0,0 +1,5 @@ +// @sourcemap: true +// @inlineSources: true +// @sourceRoot: local + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/outModuleConcatAmd.ts b/tests/cases/compiler/outModuleConcatAmd.ts new file mode 100644 index 00000000000..411a13e72a2 --- /dev/null +++ b/tests/cases/compiler/outModuleConcatAmd.ts @@ -0,0 +1,12 @@ +// @target: ES5 +// @sourcemap: true +// @declaration: true +// @module: amd +// @outFile: all.js + +// @Filename: ref/a.ts +export class A { } + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } \ No newline at end of file diff --git a/tests/cases/compiler/outModuleConcatCommonjs.ts b/tests/cases/compiler/outModuleConcatCommonjs.ts new file mode 100644 index 00000000000..0cb57bd11e7 --- /dev/null +++ b/tests/cases/compiler/outModuleConcatCommonjs.ts @@ -0,0 +1,14 @@ +// @target: ES5 +// @sourcemap: true +// @declaration: true +// @module: commonjs +// @outFile: all.js + +// This should be an error + +// @Filename: ref/a.ts +export class A { } + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } \ No newline at end of file diff --git a/tests/cases/compiler/outModuleConcatES6.ts b/tests/cases/compiler/outModuleConcatES6.ts new file mode 100644 index 00000000000..e98514e9adc --- /dev/null +++ b/tests/cases/compiler/outModuleConcatES6.ts @@ -0,0 +1,14 @@ +// @target: ES6 +// @sourcemap: true +// @declaration: true +// @module: es6 +// @outFile: all.js + +// This should be an error + +// @Filename: ref/a.ts +export class A { } + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } \ No newline at end of file diff --git a/tests/cases/compiler/outModuleConcatSystem.ts b/tests/cases/compiler/outModuleConcatSystem.ts new file mode 100644 index 00000000000..c8d9b4e9737 --- /dev/null +++ b/tests/cases/compiler/outModuleConcatSystem.ts @@ -0,0 +1,12 @@ +// @target: ES5 +// @sourcemap: true +// @declaration: true +// @module: system +// @outFile: all.js + +// @Filename: ref/a.ts +export class A { } + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } \ No newline at end of file diff --git a/tests/cases/compiler/outModuleConcatUmd.ts b/tests/cases/compiler/outModuleConcatUmd.ts new file mode 100644 index 00000000000..fa4a4a519c6 --- /dev/null +++ b/tests/cases/compiler/outModuleConcatUmd.ts @@ -0,0 +1,14 @@ +// @target: ES5 +// @sourcemap: true +// @declaration: true +// @module: umd +// @outFile: all.js + +// This should error + +// @Filename: ref/a.ts +export class A { } + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } \ No newline at end of file diff --git a/tests/cases/compiler/outModuleTripleSlashRefs.ts b/tests/cases/compiler/outModuleTripleSlashRefs.ts new file mode 100644 index 00000000000..fdeb4f93453 --- /dev/null +++ b/tests/cases/compiler/outModuleTripleSlashRefs.ts @@ -0,0 +1,33 @@ +// @target: ES5 +// @sourcemap: true +// @declaration: true +// @module: amd +// @outFile: all.js + +// @Filename: ref/a.ts +/// +export class A { + member: typeof GlobalFoo; +} + +// @Filename: ref/b.ts +/// +class Foo { + member: Bar; +} +declare var GlobalFoo: Foo; + +// @Filename: ref/c.d.ts +/// +declare class Bar { + member: Baz; +} + +// @Filename: ref/d.d.ts +declare class Baz { + member: number; +} + +// @Filename: b.ts +import {A} from "./ref/a"; +export class B extends A { } diff --git a/tests/cases/compiler/parameterNamesInTypeParameterList.ts b/tests/cases/compiler/parameterNamesInTypeParameterList.ts new file mode 100644 index 00000000000..dba122db866 --- /dev/null +++ b/tests/cases/compiler/parameterNamesInTypeParameterList.ts @@ -0,0 +1,23 @@ +function f0(a: T) { + a.b; +} + +function f1({a}: {a:T}) { + a.b; +} + +function f2([a]: T[]) { + a.b; +} + +class A { + m0(a: T) { + a.b + } + m1({a}: {a:T}) { + a.b + } + m2([a]: T[]) { + a.b + } +} \ No newline at end of file diff --git a/tests/cases/compiler/shorthandPropertyAssignmentInES6Module.ts b/tests/cases/compiler/shorthandPropertyAssignmentInES6Module.ts new file mode 100644 index 00000000000..8b08fd64e3e --- /dev/null +++ b/tests/cases/compiler/shorthandPropertyAssignmentInES6Module.ts @@ -0,0 +1,16 @@ +// @target: ES6 +// @module: commonjs + +// @filename: existingModule.ts +export var x = 1; + +// @filename: test.ts +import {x} from './existingModule'; +import {foo} from './missingModule'; + +declare function use(a: any): void; + +const test = { x, foo }; + +use(x); +use(foo); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts b/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts new file mode 100644 index 00000000000..57ba843a69c --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts @@ -0,0 +1,4 @@ +// @sourcemap: true +((item: string) => + item +) \ No newline at end of file diff --git a/tests/cases/compiler/typeCheckTypeArgument.ts b/tests/cases/compiler/typeCheckTypeArgument.ts index ea125f62c07..1647f40dafb 100644 --- a/tests/cases/compiler/typeCheckTypeArgument.ts +++ b/tests/cases/compiler/typeCheckTypeArgument.ts @@ -1,4 +1,3 @@ -/// var f: () => void; diff --git a/tests/cases/compiler/typeParameterEquality.ts b/tests/cases/compiler/typeParameterEquality.ts new file mode 100644 index 00000000000..aa136aa3655 --- /dev/null +++ b/tests/cases/compiler/typeParameterEquality.ts @@ -0,0 +1,5 @@ +// @target: es6 +class C { + get x(): (a: T) => T { return null; } + set x(p: (a: U) => U) {} +} \ No newline at end of file diff --git a/tests/cases/compiler/typeParametersAndParametersInComputedNames.ts b/tests/cases/compiler/typeParametersAndParametersInComputedNames.ts new file mode 100644 index 00000000000..273dcb2a3ea --- /dev/null +++ b/tests/cases/compiler/typeParametersAndParametersInComputedNames.ts @@ -0,0 +1,8 @@ +function foo(a: T) : string { + return ""; +} + +class A { + [foo(a)](a: T) { + } +} \ No newline at end of file diff --git a/tests/cases/compiler/withExportDecl.ts b/tests/cases/compiler/withExportDecl.ts index c7ae2f1bf38..f3c926ad707 100644 --- a/tests/cases/compiler/withExportDecl.ts +++ b/tests/cases/compiler/withExportDecl.ts @@ -42,7 +42,7 @@ module m1 { return "Hello"; } } -declare export module m2 { +export declare module m2 { export var a: number; } diff --git a/tests/cases/conformance/classes/classExpressions/genericClassExpressionInFunction.ts b/tests/cases/conformance/classes/classExpressions/genericClassExpressionInFunction.ts new file mode 100644 index 00000000000..14885ca9905 --- /dev/null +++ b/tests/cases/conformance/classes/classExpressions/genericClassExpressionInFunction.ts @@ -0,0 +1,30 @@ +class A { + genericVar: T +} +function B1() { + // class expression can use T + return class extends A { } +} +class B2 { + anon = class extends A { } +} +function B3() { + return class Inner extends A { } +} +// extends can call B +class K extends B1() { + namae: string; +} +class C extends (new B2().anon) { + name: string; +} +let b3Number = B3(); +class S extends b3Number { + nom: string; +} +var c = new C(); +var k = new K(); +var s = new S(); +c.genericVar = 12; +k.genericVar = 12; +s.genericVar = 12; diff --git a/tests/cases/conformance/decorators/decoratorMetadata.ts b/tests/cases/conformance/decorators/decoratorMetadata.ts index 3f622909309..6d7792bb832 100644 --- a/tests/cases/conformance/decorators/decoratorMetadata.ts +++ b/tests/cases/conformance/decorators/decoratorMetadata.ts @@ -14,4 +14,8 @@ declare var decorator: any; class MyComponent { constructor(public Service: Service) { } + + @decorator + method(x: this) { + } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts index 70c0b35763e..54c95c95a37 100644 --- a/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts +++ b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts @@ -10,16 +10,16 @@ class C { static get ["computedname"]() { return ""; } - get ["computedname"]() { + get ["computedname1"]() { return ""; } - get ["computedname"]() { + get ["computedname2"]() { return ""; } - set ["computedname"](x: any) { + set ["computedname3"](x: any) { } - set ["computedname"](y: string) { + set ["computedname4"](y: string) { } set foo(a: string) { } diff --git a/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts index c5d95bc6cb1..b7399a3511c 100644 --- a/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts +++ b/tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts @@ -2,18 +2,18 @@ class D { _bar: string; foo() { } - ["computedName"]() { } - ["computedName"](a: string) { } - ["computedName"](a: string): number { return 1; } + ["computedName1"]() { } + ["computedName2"](a: string) { } + ["computedName3"](a: string): number { return 1; } bar(): string { return this._bar; } baz(a: any, x: string): string { return "HELLO"; } - static ["computedname"]() { } - static ["computedname"](a: string) { } - static ["computedname"](a: string): boolean { return true; } + static ["computedname4"]() { } + static ["computedname5"](a: string) { } + static ["computedname6"](a: string): boolean { return true; } static staticMethod() { var x = 1 + 2; return x diff --git a/tests/cases/conformance/es6/modules/reExportDefaultExport.ts b/tests/cases/conformance/es6/modules/reExportDefaultExport.ts new file mode 100644 index 00000000000..730435fd4ee --- /dev/null +++ b/tests/cases/conformance/es6/modules/reExportDefaultExport.ts @@ -0,0 +1,15 @@ +// @module: commonjs +// @target: ES5 + +// @filename: m1.ts +export default function f() { +} +export {f}; + + +// @filename: m2.ts +import foo from "./m1"; +import {f} from "./m1"; + +f(); +foo(); \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardEnums.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardEnums.ts new file mode 100644 index 00000000000..54e9a1bd8fe --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardEnums.ts @@ -0,0 +1,18 @@ +enum E {} +enum V {} + +let x: number|string|E|V; + +if (typeof x === "number") { + x; // number|E|V +} +else { + x; // string +} + +if (typeof x !== "number") { + x; // string +} +else { + x; // number|E|V +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts new file mode 100644 index 00000000000..aa394aaa75b --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts @@ -0,0 +1,16 @@ +let x: string | number; + +if (typeof x === "string") { + let n = class { + constructor() { + let y: string = x; + } + } +} +else { + let m = class { + constructor() { + let y: number = x; + } + } +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts new file mode 100644 index 00000000000..6423af18a5a --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts @@ -0,0 +1,14 @@ +let strOrBool: string|boolean; +if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') { + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +} + +if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { + let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; + let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; + let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; + let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts index 9d7d555fc18..ac3403d8151 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts @@ -22,19 +22,19 @@ if (typeof strOrC === "Object") { c = strOrC; // C } else { - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string } if (typeof numOrC === "Object") { c = numOrC; // C } else { - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number } if (typeof boolOrC === "Object") { c = boolOrC; // C } else { - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean } // Narrowing occurs only if target type is a subtype of variable type @@ -49,19 +49,19 @@ else { // - when true, narrows the type of x by typeof x === s when false, or // - when false, narrows the type of x by typeof x === s when true. if (typeof strOrC !== "Object") { - var r2: string | C = strOrC; // string | C + var r2: string = strOrC; // string } else { c = strOrC; // C } if (typeof numOrC !== "Object") { - var r3: number | C = numOrC; // number | C + var r3: number = numOrC; // number } else { c = numOrC; // C } if (typeof boolOrC !== "Object") { - var r4: boolean | C = boolOrC; // boolean | C + var r4: boolean = boolOrC; // boolean } else { c = boolOrC; // C diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts new file mode 100644 index 00000000000..4e9e3137d78 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts @@ -0,0 +1,9 @@ +var x: string|number; + +var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; + +var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.substr; + +var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; + +var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.substr; \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardTautologicalConsistiency.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardTautologicalConsistiency.ts new file mode 100644 index 00000000000..9a44603d2d4 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardTautologicalConsistiency.ts @@ -0,0 +1,11 @@ +let stringOrNumber: string | number; + +if (typeof stringOrNumber === "number") { + if (typeof stringOrNumber !== "number") { + stringOrNumber; + } +} + +if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { + stringOrNumber; +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts new file mode 100644 index 00000000000..766c5ed8ca2 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts @@ -0,0 +1,184 @@ +// undefined type guard adds no new type information +function test1(a: any) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test2(a: any) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test3(a: any) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test4(a: any) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test5(a: boolean | void) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test6(a: boolean | void) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test7(a: boolean | void) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test8(a: boolean | void) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test9(a: boolean | number) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test10(a: boolean | number) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test11(a: boolean | number) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test12(a: boolean | number) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test13(a: boolean | number | void) { + if (typeof a !== "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test14(a: boolean | number | void) { + if (typeof a === "undefined") { + if (typeof a === "boolean") { + a; + } + else { + a; + } + } + else { + a; + } +} + +function test15(a: boolean | number | void) { + if (typeof a === "undefined" || typeof a === "boolean") { + a; + } + else { + a; + } +} + +function test16(a: boolean | number | void) { + if (typeof a !== "undefined" && typeof a === "boolean") { + a; + } + else { + a; + } +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts index ec23b75b590..5dbc925d04b 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts @@ -40,12 +40,12 @@ function foo4(x: number | string | boolean) { : x.toString(); // number })(x); // x here is narrowed to number | boolean } -// Type guards affect nested function expressions, but not nested function declarations +// Type guards affect nested function expressions and nested function declarations function foo5(x: number | string | boolean) { if (typeof x === "string") { var y = x; // string; function foo() { - var z = x; // number | string | boolean, type guard has no effect + var z = x; // string } } } diff --git a/tests/cases/conformance/jsx/tsxReactEmit7.tsx b/tests/cases/conformance/jsx/tsxReactEmit7.tsx new file mode 100644 index 00000000000..847a55d4719 --- /dev/null +++ b/tests/cases/conformance/jsx/tsxReactEmit7.tsx @@ -0,0 +1,22 @@ +//@jsx: react +//@module: commonjs + +//@filename: file.tsx +declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } +} + +var m =
; +var n =
; +var o =
; +var p =
; + +// Investigation +var a =
; +var b =
; +var c =
; +var d =
; +var e =
; diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts new file mode 100644 index 00000000000..f13ce35e829 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf01.ts @@ -0,0 +1,15 @@ + +type S = "a" | "b"; +type T = S[] | S; + +function f(foo: T) { + if (foo === "a") { + return foo; + } + else if (foo === "b") { + return foo; + } + else { + return (foo as S[])[0]; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf02.ts new file mode 100644 index 00000000000..4eaf18ca7cc --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralCheckedInIf02.ts @@ -0,0 +1,16 @@ + +type S = "a" | "b"; +type T = S[] | S; + +function isS(t: T): t is S { + return t === "a" || t === "b"; +} + +function f(foo: T) { + if (isS(foo)) { + return foo; + } + else { + return foo[0]; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts new file mode 100644 index 00000000000..141f5d12795 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralMatchedInSwitch01.ts @@ -0,0 +1,13 @@ + +type S = "a" | "b"; +type T = S[] | S; + +var foo: T; +switch (foo) { + case "a": + case "b": + break; + default: + foo = (foo as S[])[0]; + break; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts new file mode 100644 index 00000000000..ec1f1e5eb56 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts @@ -0,0 +1,31 @@ + +type S = "a" | "b"; +type T = S[] | S; + +var s: S; +var t: T; +var str: string; + +//////////////// + +s = t; +s = t as S; + +s = str; +s = str as S; + +//////////////// + +t = s; +t = s as T; + +t = str; +t = str as T; + +//////////////// + +str = s; +str = s as string; + +str = t; +str = t as string; diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts new file mode 100644 index 00000000000..8a257ae1caf --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts @@ -0,0 +1,9 @@ +// @declaration: true + +declare function myRandBool(): boolean; + +let a: "foo" = "foo"; +let b = a || "foo"; +let c: "foo" = b; +let d = b || "bar"; +let e: "foo" | "bar" = d; diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts new file mode 100644 index 00000000000..7910c0e16b7 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts @@ -0,0 +1,8 @@ +// @declaration: true + +declare function myRandBool(): boolean; + +let a: "foo" = ("foo"); +let b: "foo" | "bar" = ("foo"); +let c: "foo" = (myRandBool ? "foo" : ("foo")); +let d: "foo" | "bar" = (myRandBool ? "foo" : ("bar")); diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndTuples01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndTuples01.ts new file mode 100644 index 00000000000..388f4567ed7 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndTuples01.ts @@ -0,0 +1,20 @@ +// @declaration: true + +// Should all be strings. +let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; + +type RexOrRaptor = "t-rex" | "raptor" +let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; + +rawr(dinosaur); + +function rawr(dino: RexOrRaptor) { + if (dino === "t-rex") { + return "ROAAAAR!"; + } + if (dino === "raptor") { + return "yip yip!"; + } + + throw "Unexpected " + dino; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts new file mode 100644 index 00000000000..cea04f0818e --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags01.ts @@ -0,0 +1,43 @@ +// @declaration: true + +type Kind = "A" | "B" + +interface Entity { + kind: Kind; +} + +interface A extends Entity { + kind: "A"; + a: number; +} + +interface B extends Entity { + kind: "B"; + b: string; +} + +function hasKind(entity: Entity, kind: "A"): entity is A; +function hasKind(entity: Entity, kind: "B"): entity is B; +function hasKind(entity: Entity, kind: Kind): entity is Entity; +function hasKind(entity: Entity, kind: Kind): boolean { + return kind === is; +} + +let x: A = { + kind: "A", + a: 100, +} + +if (hasKind(x, "A")) { + let a = x; +} +else { + let b = x; +} + +if (!hasKind(x, "B")) { + let c = x; +} +else { + let d = x; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts new file mode 100644 index 00000000000..53f516f4209 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts @@ -0,0 +1,19 @@ +// @declaration: true + +function foo(f: (x: T) => T) { + return f; +} + +function bar(f: (x: T) => T) { + return f; +} + +let f = foo(x => x); +let fResult = f("foo"); + +let g = foo((x => x)); +let gResult = g("foo"); + +let h = bar(x => x); +let hResult = h("foo"); +hResult = h("bar"); \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts new file mode 100644 index 00000000000..fb3a019402d --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts @@ -0,0 +1,8 @@ +// @declaration: true + +function foo(f: (x: T) => T) { + return f; +} + +let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); +let fResult = f("foo"); \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts new file mode 100644 index 00000000000..b8ed1b47dd4 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts @@ -0,0 +1,21 @@ +// @declaration: true + +type T = "foo" | "bar" | "baz"; + +var x: "foo" | "bar" | "baz" = "foo"; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts new file mode 100644 index 00000000000..2cc63ab4460 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts @@ -0,0 +1,21 @@ +// @declaration: true + +type T = string | "foo" | "bar" | "baz"; + +var x: "foo" | "bar" | "baz" | string = "foo"; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts new file mode 100644 index 00000000000..d5c6a38af79 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts @@ -0,0 +1,21 @@ +// @declaration: true + +type T = number | "foo" | "bar"; + +var x: "foo" | "bar" | number; +var y: T = "bar"; + +if (x === "foo") { + let a = x; +} +else if (x !== "bar") { + let b = x || y; +} +else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; +} + +x = y; +y = x; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts new file mode 100644 index 00000000000..e9d062b0e5c --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts @@ -0,0 +1,38 @@ +// @declaration: true + +type T = "" | "foo"; + +let x: T = ""; +let y: T = "foo"; + +if (x === "") { + let a = x; +} + +if (x !== "") { + let b = x; +} + +if (x == "") { + let c = x; +} + +if (x != "") { + let d = x; +} + +if (x) { + let e = x; +} + +if (!x) { + let f = x; +} + +if (!!x) { + let g = x; +} + +if (!!!x) { + let h = x; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts new file mode 100644 index 00000000000..4f006387687 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts @@ -0,0 +1,19 @@ +// @declaration: true + +let a: ""; +var b: "foo"; +let c: "bar"; +const d: "baz"; + +a = ""; +b = "foo"; +c = "bar"; + +let e: "" = ""; +var f: "foo" = "foo"; +let g: "bar" = "bar"; +const h: "baz" = "baz"; + +e = ""; +f = "foo"; +g = "bar"; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts new file mode 100644 index 00000000000..d88167eaeff --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts @@ -0,0 +1,53 @@ +// @declaration: true + +type PrimitiveName = 'string' | 'number' | 'boolean'; + +function getFalsyPrimitive(x: "string"): string; +function getFalsyPrimitive(x: "number"): number; +function getFalsyPrimitive(x: "boolean"): boolean; +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +function getFalsyPrimitive(x: "number" | "string"): number | string; +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +function getFalsyPrimitive(x: PrimitiveName) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); +} + +const string: "string" = "string" +const number: "number" = "number" +const boolean: "boolean" = "boolean" + +const stringOrNumber = string || number; +const stringOrBoolean = string || boolean; +const booleanOrNumber = number || boolean; +const stringOrBooleanOrNumber = stringOrBoolean || number; + +namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +} + + diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts new file mode 100644 index 00000000000..5801aa50076 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts @@ -0,0 +1,51 @@ +// @declaration: true + +function getFalsyPrimitive(x: "string"): string; +function getFalsyPrimitive(x: "number"): number; +function getFalsyPrimitive(x: "boolean"): boolean; +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +function getFalsyPrimitive(x: "number" | "string"): number | string; +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +function getFalsyPrimitive(x: string) { + if (x === "string") { + return ""; + } + if (x === "number") { + return 0; + } + if (x === "boolean") { + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { + const EMPTY_STRING = getFalsyPrimitive("string"); + const ZERO = getFalsyPrimitive('number'); + const FALSE = getFalsyPrimitive("boolean"); +} + +const string: "string" = "string" +const number: "number" = "number" +const boolean: "boolean" = "boolean" + +const stringOrNumber = string || number; +const stringOrBoolean = string || boolean; +const booleanOrNumber = number || boolean; +const stringOrBooleanOrNumber = stringOrBoolean || number; + +namespace Consts2 { + const EMPTY_STRING = getFalsyPrimitive(string); + const ZERO = getFalsyPrimitive(number); + const FALSE = getFalsyPrimitive(boolean); + + const a = getFalsyPrimitive(stringOrNumber); + const b = getFalsyPrimitive(stringOrBoolean); + const c = getFalsyPrimitive(booleanOrNumber); + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +} + + diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads03.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads03.ts new file mode 100644 index 00000000000..a675c2c0eae --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads03.ts @@ -0,0 +1,46 @@ +// @declaration: true + +interface Base { + x: string; + y: number; +} + +interface HelloOrWorld extends Base { + p1: boolean; +} + +interface JustHello extends Base { + p2: boolean; +} + +interface JustWorld extends Base { + p3: boolean; +} + +let hello: "hello"; +let world: "world"; +let helloOrWorld: "hello" | "world"; + +function f(p: "hello"): JustHello; +function f(p: "hello" | "world"): HelloOrWorld; +function f(p: "world"): JustWorld; +function f(p: string): Base; +function f(...args: any[]): any { + return undefined; +} + +let fResult1 = f(hello); +let fResult2 = f(world); +let fResult3 = f(helloOrWorld); + +function g(p: string): Base; +function g(p: "hello"): JustHello; +function g(p: "hello" | "world"): HelloOrWorld; +function g(p: "world"): JustWorld; +function g(...args: any[]): any { + return undefined; +} + +let gResult1 = g(hello); +let gResult2 = g(world); +let gResult3 = g(helloOrWorld); \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads04.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads04.ts new file mode 100644 index 00000000000..8bc2a0c94b8 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads04.ts @@ -0,0 +1,8 @@ +// @declaration: true + +declare function f(x: (p: "foo" | "bar") => "foo"); + +f(y => { + let z = y = "foo"; + return z; +}) \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts new file mode 100644 index 00000000000..a78918c8122 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts @@ -0,0 +1,25 @@ +// @declaration: true + +type Kind = "A" | "B" + +function kindIs(kind: Kind, is: "A"): kind is "A"; +function kindIs(kind: Kind, is: "B"): kind is "B"; +function kindIs(kind: Kind, is: Kind): boolean { + return kind === is; +} + +var x: Kind = "A"; + +if (kindIs(x, "A")) { + let a = x; +} +else { + let b = x; +} + +if (!kindIs(x, "B")) { + let c = x; +} +else { + let d = x; +} \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts new file mode 100644 index 00000000000..1920551abd8 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts @@ -0,0 +1,7 @@ +// @declaration: true + +let ABC: "ABC" = `ABC`; +let DE_NEWLINE_F: "DE\nF" = `DE +F`; +let G_QUOTE_HI: 'G"HI'; +let JK_BACKTICK_L: "JK`L" = `JK\`L`; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts new file mode 100644 index 00000000000..12debae4e20 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts @@ -0,0 +1,5 @@ +// @declaration: true + +let abc: "AB\r\nC" = `AB +C`; +let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators01.ts new file mode 100644 index 00000000000..28c34d3c74a --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators01.ts @@ -0,0 +1,29 @@ +// @declaration: true + +let abc: "ABC" = "ABC"; +let xyz: "XYZ" = "XYZ"; +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; + +let a = "" + abc; +let b = abc + ""; +let c = 10 + abc; +let d = abc + 10; +let e = xyz + abc; +let f = abc + xyz; +let g = true + abc; +let h = abc + true; +let i = abc + abcOrXyz + xyz; +let j = abcOrXyz + abcOrXyz; +let k = +abcOrXyz; +let l = -abcOrXyz; +let m = abcOrXyzOrNumber + ""; +let n = "" + abcOrXyzOrNumber; +let o = abcOrXyzOrNumber + abcOrXyz; +let p = abcOrXyz + abcOrXyzOrNumber; +let q = !abcOrXyzOrNumber; +let r = ~abcOrXyzOrNumber; +let s = abcOrXyzOrNumber < abcOrXyzOrNumber; +let t = abcOrXyzOrNumber >= abcOrXyz; +let u = abc === abcOrXyz; +let v = abcOrXyz === abcOrXyzOrNumber; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts new file mode 100644 index 00000000000..cf66f66e47c --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts @@ -0,0 +1,19 @@ +// @declaration: true + +let abc: "ABC" = "ABC"; +let xyz: "XYZ" = "XYZ"; +let abcOrXyz: "ABC" | "XYZ" = abc || xyz; +let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; + +let a = abcOrXyzOrNumber + 100; +let b = 100 + abcOrXyzOrNumber; +let c = abcOrXyzOrNumber + abcOrXyzOrNumber; +let d = abcOrXyzOrNumber + true; +let e = false + abcOrXyzOrNumber; +let f = abcOrXyzOrNumber++; +let g = --abcOrXyzOrNumber; +let h = abcOrXyzOrNumber ^ 10; +let i = abcOrXyzOrNumber | 10; +let j = abc < xyz; +let k = abc === xyz; +let l = abc != xyz; \ No newline at end of file diff --git a/tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts b/tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts new file mode 100644 index 00000000000..08c971458e3 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts @@ -0,0 +1,113 @@ +// @declaration: true + +declare function randBool(): boolean; +declare function takeReturnString(str: string): string; +declare function takeReturnHello(str: "Hello"): "Hello"; +declare function takeReturnHelloWorld(str: "Hello" | "World"): "Hello" | "World"; + +function fun1(x: T, y: T) { + return randBool() ? x : y; +} + +function fun2(x: T, y: U) { + return randBool() ? x : y; +} + +function fun3(...args: T[]): T { + return args[+randBool()]; +} + +namespace n1 { + // The following should all come back as strings. + // They should be assignable to/from something of a type 'string'. + // They should not be assignable to either "Hello" or "World". + export let a = fun1("Hello", "World"); + export let b = fun1("Hello", "Hello"); + export let c = fun2("Hello", "World"); + export let d = fun2("Hello", "Hello"); + export let e = fun3("Hello", "Hello", "World", "Foo"); + + // Should be valid + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Passing these as arguments should cause an error. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} + +namespace n2 { + // The following (regardless of errors) should come back typed + // as "Hello" (or "Hello" | "Hello"). + export let a = fun1<"Hello">("Hello", "Hello"); + export let b = fun1<"Hello">("Hello", "World"); + export let c = fun2<"Hello", "Hello">("Hello", "Hello"); + export let d = fun2<"Hello", "Hello">("Hello", "World"); + export let e = fun3<"Hello">("Hello", "World"); + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Should be valid + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Assignment from the returned value should cause an error. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} + + +namespace n3 { + // The following (regardless of errors) should come back typed + // as "Hello" | "World" (or "World" | "Hello"). + export let a = fun2<"Hello", "World">("Hello", "World"); + export let b = fun2<"Hello", "World">("World", "Hello"); + export let c = fun2<"World", "Hello">("Hello", "Hello"); + export let d = fun2<"World", "Hello">("World", "World"); + export let e = fun3<"Hello" | "World">("Hello", "World"); + + // Assignment from the returned value should cause an error. + a = takeReturnString(a); + b = takeReturnString(b); + c = takeReturnString(c); + d = takeReturnString(d); + e = takeReturnString(e); + + // Passing these as arguments should cause an error. + a = takeReturnHello(a); + b = takeReturnHello(b); + c = takeReturnHello(c); + d = takeReturnHello(d); + e = takeReturnHello(e); + + // Both should be valid. + a = takeReturnHelloWorld(a); + b = takeReturnHelloWorld(b); + c = takeReturnHelloWorld(c); + d = takeReturnHelloWorld(d); + e = takeReturnHelloWorld(e); +} \ No newline at end of file diff --git a/tests/cases/fourslash/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.ts b/tests/cases/fourslash/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.ts new file mode 100644 index 00000000000..07f6316e4dd --- /dev/null +++ b/tests/cases/fourslash/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.ts @@ -0,0 +1,13 @@ +/// + +// @BaselineFile: compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline +// @allowJs: true +// @Filename: b.js +// @emitThisFile: true +////function foo() { } // This has error because js file cannot be overwritten - emitSkipped should be true + +// @Filename: a.ts +// @emitThisFile: true +////function foo2() { return 30; } // no error - should emit a.js + +verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionBeforeSemanticDiagnosticsInArrowFunction1.ts b/tests/cases/fourslash/completionBeforeSemanticDiagnosticsInArrowFunction1.ts index 16d2efcd6d4..d66c1620751 100644 --- a/tests/cases/fourslash/completionBeforeSemanticDiagnosticsInArrowFunction1.ts +++ b/tests/cases/fourslash/completionBeforeSemanticDiagnosticsInArrowFunction1.ts @@ -3,16 +3,16 @@ //// var f4 = (x: T/**/ ) => { //// } -fs.goTo.marker(); +goTo.marker(); // Replace the "T" type with the non-existent type 'V'. -fs.edit.backspace(1); -fs.edit.insert("A"); +edit.backspace(1); +edit.insert("A"); // Bring up completion to force a pull resolve. This will end up resolving several symbols and // producing unreported diagnostics (i.e. that 'V' wasn't found). -fs.verify.completionListContains("T"); -fs.verify.completionEntryDetailIs("T", "(type parameter) T in (x: any): void"); +verify.completionListContains("T"); +verify.completionEntryDetailIs("T", "(type parameter) T in (x: any): void"); // There should now be a single error. -fs.verify.numberOfErrorsInCurrentFile(1); \ No newline at end of file +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/completionInJsDoc.ts b/tests/cases/fourslash/completionInJsDoc.ts index 5424c8e79fa..80516303856 100644 --- a/tests/cases/fourslash/completionInJsDoc.ts +++ b/tests/cases/fourslash/completionInJsDoc.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: Foo.js /////** @/*1*/ */ ////var v1; diff --git a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts new file mode 100644 index 00000000000..357b355971d --- /dev/null +++ b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts @@ -0,0 +1,28 @@ +/// + +////interface IFoo { +//// [|a|]: string; +////} +////class C { +//// method() { +//// var x: T = { +//// [|a|]: "" +//// }; +//// x.[|a|]; +//// } +////} +//// +//// +////var x: IFoo = { +//// [|a|]: "ss" +////}; + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + + verify.referencesCountIs(ranges.length); + for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 41e8d9005f7..b9b379bd465 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -24,10 +24,7 @@ // @Module: Node // @Target: ES5 -// In the imperative section, you can write any valid TypeScript code. If -// you need help finding a something in Intellisense, you can -// type 'fs.' as an alternate way of accessing the top-level objects -// (e.g. 'fs.goTo.eof();') +// In the imperative section, you can write any valid TypeScript code. //--------------------------------------- // For API editors: @@ -45,52 +42,38 @@ // // TODO: figure out a better solution to the API exposure problem. -// /// -// /// - -declare var FourSlash; -module ts { - export interface SymbolDisplayPart { +declare module ts { + interface SymbolDisplayPart { text: string; kind: string; } + + enum IndentStyle { + None = 0, + Block = 1, + Smart = 2, + } + + interface OutputFile { + name: string; + writeByteOrderMark: boolean; + text: string; + } } -//--------------------------------------------- - -// Return code used by getEmitOutput function to indicate status of the function -// It is a duplicate of the one in types.ts to expose it to testcases in fourslash -enum EmitReturnStatus { - Succeeded = 0, // All outputs generated if requested (.js, .map, .d.ts), no errors reported - AllOutputGenerationSkipped = 1, // No .js generated because of syntax errors, or compiler options errors, nothing generated - JSGeneratedWithSemanticErrors = 2, // .js and .map generated with semantic errors - DeclarationGenerationSkipped = 3, // .d.ts generation skipped because of semantic errors or declaration emitter specific errors; Output .js with semantic errors - EmitErrorsEncountered = 4 // Emitter errors occurred during emitting process -} - -// This is a duplicate of the indentstyle in services.ts to expose it to testcases in fourslash -enum IndentStyle { - None, - Block, - Smart, -} - -module FourSlashInterface { - - export interface Marker { +declare namespace FourSlashInterface { + interface Marker { fileName: string; position: number; data?: any; } - - export interface EditorOptions { + interface EditorOptions { IndentSize: number; TabSize: number; NewLineCharacter: string; ConvertTabsToSpaces: boolean; } - - export interface FormatCodeOptions extends EditorOptions { + interface FormatCodeOptions extends EditorOptions { InsertSpaceAfterCommaDelimiter: boolean; InsertSpaceAfterSemicolonInForStatements: boolean; InsertSpaceBeforeAndAfterBinaryOperators: boolean; @@ -100,646 +83,267 @@ module FourSlashInterface { InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number| string; + [s: string]: boolean | number | string; } - - export interface Range { + interface Range { fileName: string; start: number; end: number; marker?: Marker; } - - export interface TextSpan { + interface TextSpan { start: number; end: number; } - - export class test_ { - public markers(): Marker[] { - return FourSlash.currentTestState.getMarkers(); - } - - public marker(name?: string): Marker { - return FourSlash.currentTestState.getMarkerByName(name); - } - - public ranges(): Range[] { - return FourSlash.currentTestState.getRanges(); - } - - public markerByName(s: string): Marker { - return FourSlash.currentTestState.getMarkerByName(s); - } + class test_ { + markers(): Marker[]; + marker(name?: string): Marker; + ranges(): Range[]; + markerByName(s: string): Marker; } - - export class goTo { - // Moves the caret to the specified marker, - // or the anonymous marker ('/**/') if no name - // is given - public marker(name?: string) { - FourSlash.currentTestState.goToMarker(name); - } - - public bof() { - FourSlash.currentTestState.goToBOF(); - } - - public eof() { - FourSlash.currentTestState.goToEOF(); - } - - public definition(definitionIndex: number = 0) { - FourSlash.currentTestState.goToDefinition(definitionIndex); - } - - public type(definitionIndex: number = 0) { - FourSlash.currentTestState.goToTypeDefinition(definitionIndex); - } - - public position(position: number, fileIndex?: number); - public position(position: number, fileName?: string); - public position(position: number, fileNameOrIndex?: any) { - if (fileNameOrIndex !== undefined) { - this.file(fileNameOrIndex); - } - FourSlash.currentTestState.goToPosition(position); - } - - // Opens a file, given either its index as it - // appears in the test source, or its filename - // as specified in the test metadata - public file(index: number); - public file(name: string); - public file(indexOrName: any) { - FourSlash.currentTestState.openFile(indexOrName); - } + class goTo { + marker(name?: string): void; + bof(): void; + eof(): void; + definition(definitionIndex?: number): void; + type(definitionIndex?: number): void; + position(position: number, fileIndex?: number): any; + position(position: number, fileName?: string): any; + file(index: number, content?: string): any; + file(name: string, content?: string): any; } - - export class verifyNegatable { - public not: verifyNegatable; - - constructor(private negative = false) { - if (!negative) { - this.not = new verifyNegatable(true); - } - } - - // Verifies the member list contains the specified symbol. The - // member list is brought up if necessary - public memberListContains(symbol: string, text?: string, documenation?: string, kind?: string) { - if (this.negative) { - FourSlash.currentTestState.verifyMemberListDoesNotContain(symbol); - } else { - FourSlash.currentTestState.verifyMemberListContains(symbol, text, documenation, kind); - } - } - - public memberListCount(expectedCount: number) { - FourSlash.currentTestState.verifyMemberListCount(expectedCount, this.negative); - } - - // Verifies the completion list contains the specified symbol. The - // completion list is brought up if necessary - public completionListContains(symbol: string, text?: string, documentation?: string, kind?: string) { - if (this.negative) { - FourSlash.currentTestState.verifyCompletionListDoesNotContain(symbol, text, documentation, kind); - } else { - FourSlash.currentTestState.verifyCompletionListContains(symbol, text, documentation, kind); - } - } - - // Verifies the completion list items count to be greater than the specified amount. The - // completion list is brought up if necessary - public completionListItemsCountIsGreaterThan(count: number) { - FourSlash.currentTestState.verifyCompletionListItemsCountIsGreaterThan(count, this.negative); - } - - public completionListIsEmpty() { - FourSlash.currentTestState.verifyCompletionListIsEmpty(this.negative); - } - - public completionListAllowsNewIdentifier() { - FourSlash.currentTestState.verifyCompletionListAllowsNewIdentifier(this.negative); - } - - public memberListIsEmpty() { - FourSlash.currentTestState.verifyMemberListIsEmpty(this.negative); - } - - public referencesCountIs(count: number) { - FourSlash.currentTestState.verifyReferencesCountIs(count, /*localFilesOnly*/ false); - } - - public referencesAtPositionContains(range: Range, isWriteAccess?: boolean) { - FourSlash.currentTestState.verifyReferencesAtPositionListContains(range.fileName, range.start, range.end, isWriteAccess); - } - - public signatureHelpPresent() { - FourSlash.currentTestState.verifySignatureHelpPresent(!this.negative); - } - - public errorExistsBetweenMarkers(startMarker: string, endMarker: string) { - FourSlash.currentTestState.verifyErrorExistsBetweenMarkers(startMarker, endMarker, !this.negative); - } - - public errorExistsAfterMarker(markerName = "") { - FourSlash.currentTestState.verifyErrorExistsAfterMarker(markerName, !this.negative, true); - } - - public errorExistsBeforeMarker(markerName = "") { - FourSlash.currentTestState.verifyErrorExistsAfterMarker(markerName, !this.negative, false); - } - - public quickInfoIs(expectedText?: string, expectedDocumentation?: string) { - FourSlash.currentTestState.verifyQuickInfoString(this.negative, expectedText, expectedDocumentation); - } - - public quickInfoExists() { - FourSlash.currentTestState.verifyQuickInfoExists(this.negative); - } - - public definitionCountIs(expectedCount: number) { - FourSlash.currentTestState.verifyDefinitionsCount(this.negative, expectedCount); - } - - public typeDefinitionCountIs(expectedCount: number) { - FourSlash.currentTestState.verifyTypeDefinitionsCount(this.negative, expectedCount); - } - - public definitionLocationExists() { - FourSlash.currentTestState.verifyDefinitionLocationExists(this.negative); - } - - public verifyDefinitionsName(name: string, containerName: string) { - FourSlash.currentTestState.verifyDefinitionsName(this.negative, name, containerName); - } + class verifyNegatable { + private negative; + not: verifyNegatable; + constructor(negative?: boolean); + memberListContains(symbol: string, text?: string, documenation?: string, kind?: string): void; + memberListCount(expectedCount: number): void; + completionListContains(symbol: string, text?: string, documentation?: string, kind?: string): void; + completionListItemsCountIsGreaterThan(count: number): void; + completionListIsEmpty(): void; + completionListAllowsNewIdentifier(): void; + memberListIsEmpty(): void; + referencesCountIs(count: number): void; + referencesAtPositionContains(range: Range, isWriteAccess?: boolean): void; + signatureHelpPresent(): void; + errorExistsBetweenMarkers(startMarker: string, endMarker: string): void; + errorExistsAfterMarker(markerName?: string): void; + errorExistsBeforeMarker(markerName?: string): void; + quickInfoIs(expectedText?: string, expectedDocumentation?: string): void; + quickInfoExists(): void; + definitionCountIs(expectedCount: number): void; + typeDefinitionCountIs(expectedCount: number): void; + definitionLocationExists(): void; + verifyDefinitionsName(name: string, containerName: string): void; } - - export class verify extends verifyNegatable { - public caretAtMarker(markerName?: string) { - FourSlash.currentTestState.verifyCaretAtMarker(markerName); - } - - public indentationIs(numberOfSpaces: number) { - FourSlash.currentTestState.verifyIndentationAtCurrentPosition(numberOfSpaces); - } - - public indentationAtPositionIs(fileName: string, position: number, numberOfSpaces: number, indentStyle = IndentStyle.Smart) { - FourSlash.currentTestState.verifyIndentationAtPosition(fileName, position, numberOfSpaces, indentStyle); - } - - public textAtCaretIs(text: string) { - FourSlash.currentTestState.verifyTextAtCaretIs(text); - } - + class verify extends verifyNegatable { + caretAtMarker(markerName?: string): void; + indentationIs(numberOfSpaces: number): void; + indentationAtPositionIs(fileName: string, position: number, numberOfSpaces: number, indentStyle?: ts.IndentStyle): void; + textAtCaretIs(text: string): void; /** * Compiles the current file and evaluates 'expr' in a context containing * the emitted output, then compares (using ===) the result of that expression * to 'value'. Do not use this function with external modules as it is not supported. */ - public eval(expr: string, value: any) { - FourSlash.currentTestState.verifyEval(expr, value); - } - - public currentLineContentIs(text: string) { - FourSlash.currentTestState.verifyCurrentLineContent(text); - } - - public currentFileContentIs(text: string) { - FourSlash.currentTestState.verifyCurrentFileContent(text); - } - - public verifyGetEmitOutputForCurrentFile(expected: string): void { - FourSlash.currentTestState.verifyGetEmitOutputForCurrentFile(expected); - } - - public currentParameterHelpArgumentNameIs(name: string) { - FourSlash.currentTestState.verifyCurrentParameterHelpName(name); - } - - public currentParameterSpanIs(parameter: string) { - FourSlash.currentTestState.verifyCurrentParameterSpanIs(parameter); - } - - public currentParameterHelpArgumentDocCommentIs(docComment: string) { - FourSlash.currentTestState.verifyCurrentParameterHelpDocComment(docComment); - } - - public currentSignatureHelpDocCommentIs(docComment: string) { - FourSlash.currentTestState.verifyCurrentSignatureHelpDocComment(docComment); - } - - public signatureHelpCountIs(expected: number) { - FourSlash.currentTestState.verifySignatureHelpCount(expected); - } - - public signatureHelpArgumentCountIs(expected: number) { - FourSlash.currentTestState.verifySignatureHelpArgumentCount(expected); - } - - public currentSignatureParameterCountIs(expected: number) { - FourSlash.currentTestState.verifyCurrentSignatureHelpParameterCount(expected); - } - - public currentSignatureTypeParameterCountIs(expected: number) { - FourSlash.currentTestState.verifyCurrentSignatureHelpTypeParameterCount(expected); - } - - public currentSignatureHelpIs(expected: string) { - FourSlash.currentTestState.verifyCurrentSignatureHelpIs(expected); - } - - public numberOfErrorsInCurrentFile(expected: number) { - FourSlash.currentTestState.verifyNumberOfErrorsInCurrentFile(expected); - } - - public baselineCurrentFileBreakpointLocations() { - FourSlash.currentTestState.baselineCurrentFileBreakpointLocations(); - } - - public baselineCurrentFileNameOrDottedNameSpans() { - FourSlash.currentTestState.baselineCurrentFileNameOrDottedNameSpans(); - } - - public baselineGetEmitOutput() { - FourSlash.currentTestState.baselineGetEmitOutput(); - } - - public nameOrDottedNameSpanTextIs(text: string) { - FourSlash.currentTestState.verifyCurrentNameOrDottedNameSpanText(text); - } - - public outliningSpansInCurrentFile(spans: TextSpan[]) { - FourSlash.currentTestState.verifyOutliningSpans(spans); - } - - public todoCommentsInCurrentFile(descriptors: string[]) { - FourSlash.currentTestState.verifyTodoComments(descriptors, test.ranges()); - } - - public matchingBracePositionInCurrentFile(bracePosition: number, expectedMatchPosition: number) { - FourSlash.currentTestState.verifyMatchingBracePosition(bracePosition, expectedMatchPosition); - } - - public noMatchingBracePositionInCurrentFile(bracePosition: number) { - FourSlash.currentTestState.verifyNoMatchingBracePosition(bracePosition); - } - - public DocCommentTemplate(expectedText: string, expectedOffset: number, empty?: boolean) { - FourSlash.currentTestState.verifyDocCommentTemplate(empty ? undefined : { newText: expectedText, caretOffset: expectedOffset }); - } - - public noDocCommentTemplate() { - this.DocCommentTemplate(/*expectedText*/ undefined, /*expectedOffset*/ undefined, true); - } - - public getScriptLexicalStructureListCount(count: number) { - FourSlash.currentTestState.verifyGetScriptLexicalStructureListCount(count); - } - - // TODO: figure out what to do with the unused arguments. - public getScriptLexicalStructureListContains( - name: string, - kind: string, - fileName?: string, - parentName?: string, - isAdditionalSpan?: boolean, - markerPosition?: number) { - FourSlash.currentTestState.verifyGetScriptLexicalStructureListContains(name, kind); - } - - public navigationItemsListCount(count: number, searchValue: string, matchKind?: string) { - FourSlash.currentTestState.verifyNavigationItemsCount(count, searchValue, matchKind); - } - - public navigationItemsListContains( - name: string, - kind: string, - searchValue: string, - matchKind: string, - fileName?: string, - parentName?: string) { - FourSlash.currentTestState.verifyNavigationItemsListContains( - name, - kind, - searchValue, - matchKind, - fileName, - parentName); - } - - public occurrencesAtPositionContains(range: Range, isWriteAccess?: boolean) { - FourSlash.currentTestState.verifyOccurrencesAtPositionListContains(range.fileName, range.start, range.end, isWriteAccess); - } - - public occurrencesAtPositionCount(expectedCount: number) { - FourSlash.currentTestState.verifyOccurrencesAtPositionListCount(expectedCount); - } - - public documentHighlightsAtPositionContains(range: Range, fileNamesToSearch: string[], kind?: string) { - FourSlash.currentTestState.verifyDocumentHighlightsAtPositionListContains(range.fileName, range.start, range.end, fileNamesToSearch, kind); - } - - public documentHighlightsAtPositionCount(expectedCount: number, fileNamesToSearch: string[]) { - FourSlash.currentTestState.verifyDocumentHighlightsAtPositionListCount(expectedCount, fileNamesToSearch); - } - - public completionEntryDetailIs(entryName: string, text: string, documentation?: string, kind?: string) { - FourSlash.currentTestState.verifyCompletionEntryDetails(entryName, text, documentation, kind); - } - + eval(expr: string, value: any): void; + currentLineContentIs(text: string): void; + currentFileContentIs(text: string): void; + verifyGetEmitOutputForCurrentFile(expected: string): void; + verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void; + currentParameterHelpArgumentNameIs(name: string): void; + currentParameterSpanIs(parameter: string): void; + currentParameterHelpArgumentDocCommentIs(docComment: string): void; + currentSignatureHelpDocCommentIs(docComment: string): void; + signatureHelpCountIs(expected: number): void; + signatureHelpArgumentCountIs(expected: number): void; + currentSignatureParameterCountIs(expected: number): void; + currentSignatureTypeParameterCountIs(expected: number): void; + currentSignatureHelpIs(expected: string): void; + numberOfErrorsInCurrentFile(expected: number): void; + baselineCurrentFileBreakpointLocations(): void; + baselineCurrentFileNameOrDottedNameSpans(): void; + baselineGetEmitOutput(): void; + nameOrDottedNameSpanTextIs(text: string): void; + outliningSpansInCurrentFile(spans: TextSpan[]): void; + todoCommentsInCurrentFile(descriptors: string[]): void; + matchingBracePositionInCurrentFile(bracePosition: number, expectedMatchPosition: number): void; + noMatchingBracePositionInCurrentFile(bracePosition: number): void; + DocCommentTemplate(expectedText: string, expectedOffset: number, empty?: boolean): void; + noDocCommentTemplate(): void; + getScriptLexicalStructureListCount(count: number): void; + getScriptLexicalStructureListContains(name: string, kind: string, fileName?: string, parentName?: string, isAdditionalSpan?: boolean, markerPosition?: number): void; + navigationItemsListCount(count: number, searchValue: string, matchKind?: string): void; + navigationItemsListContains(name: string, kind: string, searchValue: string, matchKind: string, fileName?: string, parentName?: string): void; + occurrencesAtPositionContains(range: Range, isWriteAccess?: boolean): void; + occurrencesAtPositionCount(expectedCount: number): void; + documentHighlightsAtPositionContains(range: Range, fileNamesToSearch: string[], kind?: string): void; + documentHighlightsAtPositionCount(expectedCount: number, fileNamesToSearch: string[]): void; + completionEntryDetailIs(entryName: string, text: string, documentation?: string, kind?: string): void; /** * This method *requires* a contiguous, complete, and ordered stream of classifications for a file. */ - public syntacticClassificationsAre(...classifications: { classificationType: string; text: string }[]) { - FourSlash.currentTestState.verifySyntacticClassifications(classifications); - } - + syntacticClassificationsAre(...classifications: { + classificationType: string; + text: string; + }[]): void; /** * This method *requires* an ordered stream of classifications for a file, and spans are highly recommended. */ - public semanticClassificationsAre(...classifications: { classificationType: string; text: string; textSpan?: TextSpan }[]) { - FourSlash.currentTestState.verifySemanticClassifications(classifications); - } - - public renameInfoSucceeded(displayName?: string, fullDisplayName?: string, kind?: string, kindModifiers?: string) { - FourSlash.currentTestState.verifyRenameInfoSucceeded(displayName, fullDisplayName, kind, kindModifiers) - } - - public renameInfoFailed(message?: string) { - FourSlash.currentTestState.verifyRenameInfoFailed(message) - } - - public renameLocations(findInStrings: boolean, findInComments: boolean) { - FourSlash.currentTestState.verifyRenameLocations(findInStrings, findInComments); - } - - public verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { start: number; length: number; }, - displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[]) { - FourSlash.currentTestState.verifyQuickInfoDisplayParts(kind, kindModifiers, textSpan, displayParts, documentation); - } - - public getSyntacticDiagnostics(expected: string) { - FourSlash.currentTestState.getSyntacticDiagnostics(expected); - } - - public getSemanticDiagnostics(expected: string) { - FourSlash.currentTestState.getSemanticDiagnostics(expected); - } - - public ProjectInfo(expected: string []) { - FourSlash.currentTestState.verifyProjectInfo(expected); - } + semanticClassificationsAre(...classifications: { + classificationType: string; + text: string; + textSpan?: TextSpan; + }[]): void; + renameInfoSucceeded(displayName?: string, fullDisplayName?: string, kind?: string, kindModifiers?: string): void; + renameInfoFailed(message?: string): void; + renameLocations(findInStrings: boolean, findInComments: boolean): void; + verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { + start: number; + length: number; + }, displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[]): void; + getSyntacticDiagnostics(expected: string): void; + getSemanticDiagnostics(expected: string): void; + ProjectInfo(expected: string[]): void; } - - export class edit { - public backspace(count?: number) { - FourSlash.currentTestState.deleteCharBehindMarker(count); - } - - public deleteAtCaret(times?: number) { - FourSlash.currentTestState.deleteChar(times); - } - - public replace(start: number, length: number, text: string) { - FourSlash.currentTestState.replace(start, length, text); - } - - public paste(text: string) { - FourSlash.currentTestState.paste(text); - } - - public insert(text: string) { - this.insertLines(text); - } - - public insertLine(text: string) { - this.insertLines(text + '\n'); - } - - public insertLines(...lines: string[]) { - FourSlash.currentTestState.type(lines.join('\n')); - } - - public moveRight(count?: number) { - FourSlash.currentTestState.moveCaretRight(count); - } - - public moveLeft(count?: number) { - if (typeof count === 'undefined') { - count = 1; - } - FourSlash.currentTestState.moveCaretRight(count * -1); - } - - public enableFormatting() { - FourSlash.currentTestState.enableFormatting = true; - } - - public disableFormatting() { - FourSlash.currentTestState.enableFormatting = false; - } + class edit { + backspace(count?: number): void; + deleteAtCaret(times?: number): void; + replace(start: number, length: number, text: string): void; + paste(text: string): void; + insert(text: string): void; + insertLine(text: string): void; + insertLines(...lines: string[]): void; + moveRight(count?: number): void; + moveLeft(count?: number): void; + enableFormatting(): void; + disableFormatting(): void; } - - export class debug { - public printCurrentParameterHelp() { - FourSlash.currentTestState.printCurrentParameterHelp(); - } - - public printCurrentFileState() { - FourSlash.currentTestState.printCurrentFileState(); - } - - public printCurrentFileStateWithWhitespace() { - FourSlash.currentTestState.printCurrentFileState(/*withWhiteSpace=*/true); - } - - public printCurrentFileStateWithoutCaret() { - FourSlash.currentTestState.printCurrentFileState(/*withWhiteSpace=*/false, /*withCaret=*/false); - } - - public printCurrentQuickInfo() { - FourSlash.currentTestState.printCurrentQuickInfo(); - } - - public printCurrentSignatureHelp() { - FourSlash.currentTestState.printCurrentSignatureHelp(); - } - - public printMemberListMembers() { - FourSlash.currentTestState.printMemberListMembers(); - } - - public printCompletionListMembers() { - FourSlash.currentTestState.printCompletionListMembers(); - } - - public printBreakpointLocation(pos: number) { - FourSlash.currentTestState.printBreakpointLocation(pos); - } - public printBreakpointAtCurrentLocation() { - FourSlash.currentTestState.printBreakpointAtCurrentLocation(); - } - - public printNameOrDottedNameSpans(pos: number) { - FourSlash.currentTestState.printNameOrDottedNameSpans(pos); - } - - public printErrorList() { - FourSlash.currentTestState.printErrorList(); - } - - public printNavigationItems(searchValue: string = ".*") { - FourSlash.currentTestState.printNavigationItems(searchValue); - } - - public printScriptLexicalStructureItems() { - FourSlash.currentTestState.printScriptLexicalStructureItems(); - } - - public printReferences() { - FourSlash.currentTestState.printReferences(); - } - - public printContext() { - FourSlash.currentTestState.printContext(); - } + class debug { + printCurrentParameterHelp(): void; + printCurrentFileState(): void; + printCurrentFileStateWithWhitespace(): void; + printCurrentFileStateWithoutCaret(): void; + printCurrentQuickInfo(): void; + printCurrentSignatureHelp(): void; + printMemberListMembers(): void; + printCompletionListMembers(): void; + printBreakpointLocation(pos: number): void; + printBreakpointAtCurrentLocation(): void; + printNameOrDottedNameSpans(pos: number): void; + printErrorList(): void; + printNavigationItems(searchValue?: string): void; + printScriptLexicalStructureItems(): void; + printReferences(): void; + printContext(): void; } - - export class format { - public document() { - FourSlash.currentTestState.formatDocument(); - } - - public copyFormatOptions(): FormatCodeOptions { - return FourSlash.currentTestState.copyFormatOptions(); - } - - public setFormatOptions(options: FormatCodeOptions) { - return FourSlash.currentTestState.setFormatOptions(options); - } - - public selection(startMarker: string, endMarker: string) { - FourSlash.currentTestState.formatSelection(FourSlash.currentTestState.getMarkerByName(startMarker).position, FourSlash.currentTestState.getMarkerByName(endMarker).position); - } - - public setOption(name: string, value: number); - public setOption(name: string, value: string); - public setOption(name: string, value: boolean); - public setOption(name: string, value: any) { - FourSlash.currentTestState.formatCodeOptions[name] = value; - } + class format { + document(): void; + copyFormatOptions(): FormatCodeOptions; + setFormatOptions(options: FormatCodeOptions): any; + selection(startMarker: string, endMarker: string): void; + setOption(name: string, value: number): any; + setOption(name: string, value: string): any; + setOption(name: string, value: boolean): any; } - - export class cancellation { - public resetCancelled() { - FourSlash.currentTestState.resetCancelled(); - } - - public setCancelled(numberOfCalls: number = 0) { - FourSlash.currentTestState.setCancelled(numberOfCalls); - } + class cancellation { + resetCancelled(): void; + setCancelled(numberOfCalls?: number): void; } - - export module classification { - export function comment(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("comment", text, position); - } - - export function identifier(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("identifier", text, position); - } - - export function keyword(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("keyword", text, position); - } - - export function numericLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("numericLiteral", text, position); - } - - export function operator(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("operator", text, position); - } - - export function stringLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("stringLiteral", text, position); - } - - export function whiteSpace(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("whiteSpace", text, position); - } - - export function text(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("text", text, position); - } - - export function punctuation(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("punctuation", text, position); - } - - export function docCommentTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("docCommentTagName", text, position); - } - - export function className(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("className", text, position); - } - - export function enumName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("enumName", text, position); - } - - export function interfaceName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("interfaceName", text, position); - } - - export function moduleName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("moduleName", text, position); - } - - export function typeParameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("typeParameterName", text, position); - } - - export function parameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("parameterName", text, position); - } - - export function typeAliasName(text: string, position?: number): { classificationType: string; text: string; textSpan?: TextSpan } { - return getClassification("typeAliasName", text, position); - } - - function getClassification(type: string, text: string, position?: number) { - return { - classificationType: type, - text: text, - textSpan: position === undefined ? undefined : { start: position, end: position + text.length } - }; - } + module classification { + function comment(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function identifier(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function keyword(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function numericLiteral(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function operator(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function stringLiteral(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function whiteSpace(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function text(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function punctuation(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function docCommentTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function className(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function enumName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function interfaceName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function moduleName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function typeParameterName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function parameterName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function typeAliasName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; } } - -module fs { - export var test = new FourSlashInterface.test_(); - export var goTo = new FourSlashInterface.goTo(); - export var verify = new FourSlashInterface.verify(); - export var edit = new FourSlashInterface.edit(); - export var debug = new FourSlashInterface.debug(); - export var format = new FourSlashInterface.format(); - export var cancellation = new FourSlashInterface.cancellation(); -} - -function verifyOperationIsCancelled(f) { - FourSlash.verifyOperationIsCancelled(f); -} - -var test = new FourSlashInterface.test_(); -var goTo = new FourSlashInterface.goTo(); -var verify = new FourSlashInterface.verify(); -var edit = new FourSlashInterface.edit(); -var debug = new FourSlashInterface.debug(); -var format = new FourSlashInterface.format(); -var cancellation = new FourSlashInterface.cancellation(); -var classification = FourSlashInterface.classification; +declare function verifyOperationIsCancelled(f: any): void; +declare var test: FourSlashInterface.test_; +declare var goTo: FourSlashInterface.goTo; +declare var verify: FourSlashInterface.verify; +declare var edit: FourSlashInterface.edit; +declare var debug: FourSlashInterface.debug; +declare var format: FourSlashInterface.format; +declare var cancellation: FourSlashInterface.cancellation; +declare var classification: typeof FourSlashInterface.classification; diff --git a/tests/cases/fourslash/getEmitOutputTsxFile_React.ts b/tests/cases/fourslash/getEmitOutputTsxFile_React.ts index ccfa3bcc0c2..0620f6d83ef 100644 --- a/tests/cases/fourslash/getEmitOutputTsxFile_React.ts +++ b/tests/cases/fourslash/getEmitOutputTsxFile_React.ts @@ -13,10 +13,18 @@ //// x : string; //// y : number //// } +//// /*1*/ // @Filename: inputFile2.tsx // @emitThisFile: true +//// declare var React: any; //// var y = "my div"; //// var x =
+//// /*2*/ + +goTo.marker("1"); +verify.numberOfErrorsInCurrentFile(0); +goTo.marker("2"); +verify.numberOfErrorsInCurrentFile(0); verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics1.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics1.ts index 05bc6727710..a94318c84fd 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics1.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics1.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// import a = b; diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics10.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics10.ts index 84c6c45f870..957357fc2c1 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics10.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics10.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function F() { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics11.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics11.ts index 7dfd3c4965b..d9c16fca651 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics11.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics11.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function F(): number { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics12.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics12.ts index 88a1331ef23..b4dcf076743 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics12.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics12.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// declare var v; diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics13.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics13.ts index 21a5e9cdcaa..a20bccc0887 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics13.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics13.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// var v: () => number; diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics14.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics14.ts index 8cd178ffec1..4f7673be384 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics14.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics14.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// Foo(); diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics15.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics15.ts index d1c3a8c6e63..f7cd4db3626 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics15.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics15.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function F(public p) { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics16.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics16.ts index 1e114532c79..cd19bd580cc 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics16.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics16.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function F(p?) { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics17.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics17.ts index 5e94c806c60..5a1ec6d92cf 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics17.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics17.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function F(a: number) { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics18.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics18.ts index a2859060cde..fdaafa9aa51 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics18.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics18.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// class C { v } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics19.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics19.ts index 34dbbc0271d..a7fbe3e0ecc 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics19.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics19.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// enum E { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics2.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics2.ts index b26d16f9017..9ab29b41798 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics2.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics2.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// export = b; diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts index 790f02bac92..c34f860b5fe 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts @@ -1,9 +1,10 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// var v = undefined; +verify.getSyntacticDiagnostics(`[]`); verify.getSemanticDiagnostics(`[ { "message": "'type assertion expressions' can only be used in a .ts file.", diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics21.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics21.ts index 23e3274261c..b71677554a2 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics21.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics21.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// @internal class C {} diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics22.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics22.ts index 16c5380189e..d4d830d29e9 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics22.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics22.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// function foo(...a) {} diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics3.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics3.ts index c7b6c6a80cf..3aff51d881b 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics3.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics3.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// class C { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics4.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics4.ts index f32ee5c4b68..99319b047e6 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics4.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics4.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// public class C { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics5.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics5.ts index e405624c9b0..18df3500bd9 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics5.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics5.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// class C implements D { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics6.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics6.ts index 918eb035a8b..e18f8f9be52 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics6.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics6.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// interface I { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics7.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics7.ts index cdec262f699..32cad0e5a07 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics7.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics7.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// module M { } diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts index a71a2cf2bc7..ba2d9faae8c 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// type a = b; diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics9.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics9.ts index 4bd4ce706b9..4c531b5255b 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics9.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics9.ts @@ -1,6 +1,6 @@ /// -// @allowNonTsExtensions: true +// @allowJs: true // @Filename: a.js //// public function F() { } diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts deleted file mode 100644 index e409029276b..00000000000 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -// @allowNonTsExtensions: true -// @Filename: a.js -//// /** -//// * @type {number} -//// * @type {string} -//// */ -//// var v; - -verify.getSyntacticDiagnostics(`[ - { - "message": "\'type\' tag already specified.", - "start": 26, - "length": 4, - "category": "error", - "code": 1223 - } -]`); \ No newline at end of file diff --git a/tests/cases/fourslash/indentationBlock.ts b/tests/cases/fourslash/indentationBlock.ts index e880c4a0957..853ff43b0d6 100644 --- a/tests/cases/fourslash/indentationBlock.ts +++ b/tests/cases/fourslash/indentationBlock.ts @@ -179,5 +179,5 @@ ////{| "indent": 0 |} test.markers().forEach(marker => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indent, IndentStyle.Block); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indent, ts.IndentStyle.Block); }); diff --git a/tests/cases/fourslash/indentationNone.ts b/tests/cases/fourslash/indentationNone.ts index 078f5ab35f6..610a336cdda 100644 --- a/tests/cases/fourslash/indentationNone.ts +++ b/tests/cases/fourslash/indentationNone.ts @@ -179,5 +179,5 @@ ////{| "indent": 0 |} test.markers().forEach(marker => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indent, IndentStyle.None); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indent, ts.IndentStyle.None); }); diff --git a/tests/cases/fourslash/javaScriptModules12.ts b/tests/cases/fourslash/javaScriptModules12.ts new file mode 100644 index 00000000000..5ed2431cf92 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules12.ts @@ -0,0 +1,57 @@ +/// + +// Invocations of 'require' stop top-level variables from becoming global + +// @allowJs: true + +// @Filename: mod1.js +//// var x = require('fs'); +//// /*1*/ + +// @Filename: mod2.js +//// var y; +//// if(true) { +//// y = require('fs'); +//// } +//// /*2*/ + +// @Filename: glob1.js +//// var a = require; +//// /*3*/ + +// @Filename: glob2.js +//// var b = ''; +//// /*4*/ + +// @Filename: consumer.js +//// /*5*/ + +goTo.marker('1'); +verify.completionListContains('x'); +verify.not.completionListContains('y'); +verify.completionListContains('a'); +verify.completionListContains('b'); + +goTo.marker('2'); +verify.not.completionListContains('x'); +verify.completionListContains('y'); +verify.completionListContains('a'); +verify.completionListContains('b'); + +goTo.marker('3'); +verify.not.completionListContains('x'); +verify.not.completionListContains('y'); +verify.completionListContains('a'); +verify.completionListContains('b'); + +goTo.marker('4'); +verify.not.completionListContains('x'); +verify.not.completionListContains('y'); +verify.completionListContains('a'); +verify.completionListContains('b'); + +goTo.marker('5'); +verify.not.completionListContains('x'); +verify.not.completionListContains('y'); +verify.completionListContains('a'); +verify.completionListContains('b'); diff --git a/tests/cases/fourslash/javaScriptModules13.ts b/tests/cases/fourslash/javaScriptModules13.ts new file mode 100644 index 00000000000..4eed369836f --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules13.ts @@ -0,0 +1,26 @@ +/// + +// Assignments to 'module.exports' create an external module + +// @allowJs: true +// @Filename: myMod.js +//// if (true) { +//// module.exports = { a: 10 }; +//// } +//// var invisible = true; + +// @Filename: isGlobal.js +//// var y = 10; + +// @Filename: consumer.js +//// var x = require('myMod'); +//// /**/; + +goTo.file('consumer.js'); +goTo.marker(); + +verify.completionListContains('y'); +verify.not.completionListContains('invisible'); + +edit.insert('x.'); +verify.completionListContains('a'); diff --git a/tests/cases/fourslash/javaScriptModules14.ts b/tests/cases/fourslash/javaScriptModules14.ts new file mode 100644 index 00000000000..9039292d511 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules14.ts @@ -0,0 +1,28 @@ +/// + +// Assignments to 'exports.p' stop global variables from being visible in other files + +// @allowJs: true +// @Filename: myMod.js +//// if (true) { +//// exports.b = true; +//// } else { +//// exports.n = 3; +//// } +//// function fn() { +//// exports.s = 'foo'; +//// } +//// var invisible = true; + +// @Filename: isGlobal.js +//// var y = 10; + +// @Filename: consumer.js +//// var x = require('myMod'); +//// /**/; + +goTo.file('consumer.js'); +goTo.marker(); + +verify.completionListContains('y'); +verify.not.completionListContains('invisible'); diff --git a/tests/cases/fourslash/javaScriptModules15.ts b/tests/cases/fourslash/javaScriptModules15.ts new file mode 100644 index 00000000000..5cd7545c83d --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules15.ts @@ -0,0 +1,27 @@ +/// + +// Assignments to 'exports.p' define a property 'p' even if they're not at top-level + +// @allowJs: true +// @Filename: myMod.js +//// if (true) { +//// exports.b = true; +//// } else { +//// exports.n = 3; +//// } +//// function fn() { +//// exports.s = 'foo'; +//// } + +// @Filename: consumer.js +//// var x = require('myMod'); +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/javaScriptModules16.ts b/tests/cases/fourslash/javaScriptModules16.ts new file mode 100644 index 00000000000..c34660df59f --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules16.ts @@ -0,0 +1,22 @@ +/// + +// Assignments to 'exports.p' define a property 'p' + +// @allowJs: true +// @Filename: myMod.js +//// exports.n = 3; +//// exports.s = 'foo'; +//// exports.b = true; + +// @Filename: consumer.js +//// var x = require('myMod'); +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/javaScriptModules17.ts b/tests/cases/fourslash/javaScriptModules17.ts new file mode 100644 index 00000000000..83ae882f323 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules17.ts @@ -0,0 +1,18 @@ +/// + +// @allowJs: true +// @Filename: myMod.js +//// module.exports = { n: 3, s: 'foo', b: true }; + +// @Filename: consumer.js +//// var x = require('./myMod'); +//// x/**/; + +goTo.file('consumer.js'); +goTo.marker(); +edit.insert('.'); +verify.completionListContains("n", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("s", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +verify.completionListContains("b", /*displayText:*/ undefined, /*documentation*/ undefined, "property"); +edit.insert('n.'); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/javaScriptModules18.ts b/tests/cases/fourslash/javaScriptModules18.ts new file mode 100644 index 00000000000..77a751f2a9b --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules18.ts @@ -0,0 +1,14 @@ +/// + +// CommonJS modules should not pollute the global namespace + +// @allowJs: true +// @Filename: myMod.js +//// var x = require('fs'); + +// @Filename: other.js +//// /**/; + +goTo.file('other.js'); + +verify.not.completionListContains('x'); diff --git a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts new file mode 100644 index 00000000000..00d03b6e60c --- /dev/null +++ b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts @@ -0,0 +1,24 @@ +/// + +// @declaration: true +// @out: out.js +// @allowJs: true +// @Filename: b.js +// @emitThisFile: true +////function foo() { return 10; }/*1*/ + +// @Filename: a.ts +// @emitThisFile: true +////function foo() { return 30; }/*2*/ + +goTo.marker("1"); +verify.getSemanticDiagnostics('[]'); +goTo.marker("2"); +verify.getSemanticDiagnostics('[\n {\n "message": "Duplicate function implementation.",\n "start": 9,\n "length": 3,\n "category": "error",\n "code": 2393\n }\n]'); +verify.verifyGetEmitOutputContentsForCurrentFile([ + { name: "out.js", text: "function foo() { return 10; }\r\nfunction foo() { return 30; }\r\n", writeByteOrderMark: false }, + { name: "out.d.ts", text: "", writeByteOrderMark: false }]); +goTo.marker("2"); +verify.getSemanticDiagnostics('[\n {\n "message": "Duplicate function implementation.",\n "start": 9,\n "length": 3,\n "category": "error",\n "code": 2393\n }\n]'); +goTo.marker("1"); +verify.getSemanticDiagnostics('[]'); \ No newline at end of file diff --git a/tests/cases/fourslash/overloadOnConstCallSignature.ts b/tests/cases/fourslash/overloadOnConstCallSignature.ts index d729fd4da6f..101d7750e04 100644 --- a/tests/cases/fourslash/overloadOnConstCallSignature.ts +++ b/tests/cases/fourslash/overloadOnConstCallSignature.ts @@ -11,7 +11,7 @@ goTo.marker('1'); verify.signatureHelpCountIs(4); -verify.currentSignatureHelpIs('foo(name: \'order\'): string'); +verify.currentSignatureHelpIs('foo(name: "order"): string'); edit.insert('"hi"'); goTo.marker('2'); diff --git a/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts b/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts new file mode 100644 index 00000000000..b48c7cfa3de --- /dev/null +++ b/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts @@ -0,0 +1,41 @@ +/// + +////let /*1*/hello: "hello" | 'hello' = "hello"; +////let /*2*/world: 'world' = "world"; +////let /*3*/helloOrWorld: "hello" | 'world'; + +goTo.marker("1"); +verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('1').position, length: "hello".length }, [ + { text: "let", kind: "keyword" }, + { text: " ", kind: "space" }, + { text: "hello", kind: "localName" }, + { text: ":", kind: "punctuation" }, + { text: " ", kind: "space" }, + { text: '"hello"', kind: "stringLiteral" }, ], + /*documentation*/ []); + +goTo.marker("2"); +verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('2').position, length: "world".length }, [ + { text: "let", kind: "keyword" }, + { text: " ", kind: "space" }, + { text: "world", kind: "localName" }, + { text: ":", kind: "punctuation" }, + { text: " ", kind: "space" }, + { text: '"world"', kind: "stringLiteral" }, + ], + /*documentation*/[]); + +goTo.marker("3"); +verify.verifyQuickInfoDisplayParts("let", "", { start: test.markerByName('3').position, length: "helloOrWorld".length }, [ + { text: "let", kind: "keyword" }, + { text: " ", kind: "space" }, + { text: "helloOrWorld", kind: "localName" }, + { text: ":", kind: "punctuation" }, + { text: " ", kind: "space" }, + { text: '"hello"', kind: "stringLiteral" }, + { text: " ", kind: "space" }, + { text: "|", kind: "punctuation" }, + { text: " ", kind: "space" }, + { text: '"world"', kind: "stringLiteral" }, + ], + /*documentation*/[]); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForOverloadOnConst1.ts b/tests/cases/fourslash/quickInfoForOverloadOnConst1.ts index f2ee37aa675..948c2fde999 100644 --- a/tests/cases/fourslash/quickInfoForOverloadOnConst1.ts +++ b/tests/cases/fourslash/quickInfoForOverloadOnConst1.ts @@ -20,22 +20,22 @@ ////c.x1(1, (x/*10*/x) => { return 1; } ); goTo.marker('1'); -verify.quickInfoIs("(method) I.x1(a: number, callback: (x: 'hi') => number): any"); +verify.quickInfoIs("(method) I.x1(a: number, callback: (x: \"hi\") => number): any"); goTo.marker('2'); -verify.quickInfoIs("(method) C.x1(a: number, callback: (x: 'hi') => number): any"); +verify.quickInfoIs("(method) C.x1(a: number, callback: (x: \"hi\") => number): any"); goTo.marker('3'); -verify.quickInfoIs("(parameter) callback: (x: 'hi') => number"); +verify.quickInfoIs("(parameter) callback: (x: \"hi\") => number"); goTo.marker('4'); -verify.quickInfoIs("(method) C.x1(a: number, callback: (x: 'hi') => number): any"); +verify.quickInfoIs("(method) C.x1(a: number, callback: (x: \"hi\") => number): any"); goTo.marker('5'); verify.quickInfoIs('(parameter) callback: (x: string) => number'); goTo.marker('6'); verify.quickInfoIs('(parameter) callback: (x: string) => number'); goTo.marker('7'); -verify.quickInfoIs("(method) C.x1(a: number, callback: (x: 'hi') => number): any"); +verify.quickInfoIs("(method) C.x1(a: number, callback: (x: \"hi\") => number): any"); goTo.marker('8'); -verify.quickInfoIs("(parameter) xx: 'hi'"); +verify.quickInfoIs("(parameter) xx: \"hi\""); goTo.marker('9'); -verify.quickInfoIs("(parameter) xx: 'bye'"); +verify.quickInfoIs("(parameter) xx: \"bye\""); goTo.marker('10'); -verify.quickInfoIs("(parameter) xx: 'hi'"); \ No newline at end of file +verify.quickInfoIs("(parameter) xx: \"hi\""); \ No newline at end of file diff --git a/tests/cases/fourslash/recursiveClassReference.ts b/tests/cases/fourslash/recursiveClassReference.ts index d0e96ac90e3..81843711d65 100644 --- a/tests/cases/fourslash/recursiveClassReference.ts +++ b/tests/cases/fourslash/recursiveClassReference.ts @@ -11,4 +11,4 @@ //// } goTo.marker(); -fs.verify.quickInfoExists(); +verify.quickInfoExists(); diff --git a/tests/cases/fourslash/renameModuleToVar.ts b/tests/cases/fourslash/renameModuleToVar.ts index 023b0fa1c74..fc31f4040e8 100644 --- a/tests/cases/fourslash/renameModuleToVar.ts +++ b/tests/cases/fourslash/renameModuleToVar.ts @@ -10,7 +10,7 @@ //// var z = y + 5; ////} -fs.goTo.marker(); -fs.edit.backspace(6); -fs.edit.insert("var"); -fs.verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file +goTo.marker(); +edit.backspace(6); +edit.insert("var"); +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/server/openFile.ts b/tests/cases/fourslash/server/openFile.ts new file mode 100644 index 00000000000..320e52c9f5e --- /dev/null +++ b/tests/cases/fourslash/server/openFile.ts @@ -0,0 +1,16 @@ +/// + +// @Filename: test1.ts +////t. + +// @Filename: test.ts +////var t = '10'; + +// @Filename: tsconfig.json +////{ "files": ["test.ts", "test1.ts"] } + +var overridingContent = "var t = 10; t."; +goTo.file("test.ts", overridingContent); +goTo.file("test1.ts"); +goTo.eof(); +verify.completionListContains("toExponential"); diff --git a/tests/cases/fourslash/signatureHelpConstructorCallParamProperties.ts b/tests/cases/fourslash/signatureHelpConstructorCallParamProperties.ts new file mode 100644 index 00000000000..aab276403fe --- /dev/null +++ b/tests/cases/fourslash/signatureHelpConstructorCallParamProperties.ts @@ -0,0 +1,18 @@ +/// + +////class Circle { +//// /** +//// * Initialize a circle. +//// * @param radius The radius of the circle. +//// */ +//// constructor(private radius: number) { +//// } +////} +////var a = new Circle(/**/ + +goTo.marker(''); +verify.signatureHelpCountIs(1); +verify.currentSignatureHelpIs("Circle(radius: number): Circle"); +verify.currentParameterHelpArgumentNameIs("radius"); +verify.currentParameterSpanIs("radius: number"); +verify.currentParameterHelpArgumentDocCommentIs("The radius of the circle."); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpOnOverloadOnConst.ts b/tests/cases/fourslash/signatureHelpOnOverloadOnConst.ts index 8edd0617d70..e312b71aebe 100644 --- a/tests/cases/fourslash/signatureHelpOnOverloadOnConst.ts +++ b/tests/cases/fourslash/signatureHelpOnOverloadOnConst.ts @@ -18,9 +18,9 @@ verify.currentParameterSpanIs("z: string"); goTo.marker('2'); verify.signatureHelpCountIs(3); verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: 'hi'"); +verify.currentParameterSpanIs("x: \"hi\""); goTo.marker('3'); verify.signatureHelpCountIs(3); verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: 'bye'"); +verify.currentParameterSpanIs("y: \"bye\""); diff --git a/tests/cases/project/jsFileCompilationDifferentNamesNotSpecified.json b/tests/cases/project/jsFileCompilationDifferentNamesNotSpecified.json new file mode 100644 index 00000000000..253d6f0f1d4 --- /dev/null +++ b/tests/cases/project/jsFileCompilationDifferentNamesNotSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..c25902b499e --- /dev/null +++ b/tests/cases/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when different named .ts and .js file exists in the folder and tsconfig.json doesnt specify any files and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesNotSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationDifferentNamesSpecified.json b/tests/cases/project/jsFileCompilationDifferentNamesSpecified.json new file mode 100644 index 00000000000..a8b00875214 --- /dev/null +++ b/tests/cases/project/jsFileCompilationDifferentNamesSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..7e48c8b32d1 --- /dev/null +++ b/tests/cases/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when different .ts and .js file exist and their names are specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "DifferentNamesSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameDTsSpecified.json b/tests/cases/project/jsFileCompilationSameNameDTsSpecified.json new file mode 100644 index 00000000000..5f484c20e30 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameDTsSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..9990f37cbd6 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but .d.ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameDtsNotSpecified.json b/tests/cases/project/jsFileCompilationSameNameDtsNotSpecified.json new file mode 100644 index 00000000000..7b4a7efc042 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameDtsNotSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..b96d4e758ff --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .d.ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameDTsNotSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameFilesNotSpecified.json b/tests/cases/project/jsFileCompilationSameNameFilesNotSpecified.json new file mode 100644 index 00000000000..75582ff4402 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameFilesNotSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..badca871288 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but no file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameFilesNotSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameFilesSpecified.json b/tests/cases/project/jsFileCompilationSameNameFilesSpecified.json new file mode 100644 index 00000000000..656c973a981 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameFilesSpecified.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecified" +} \ No newline at end of file diff --git a/tests/cases/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json b/tests/cases/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json new file mode 100644 index 00000000000..d3176d3f607 --- /dev/null +++ b/tests/cases/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify when same named .ts and .js file exists in the folder but .ts file is specified in tsconfig.json and .js files are consumed", + "projectRoot": "tests/cases/projects/jsFileCompilation", + "baselineCheck": true, + "declaration": true, + "project": "SameNameTsSpecifiedWithAllowJs" +} \ No newline at end of file diff --git a/tests/cases/project/noProjectOptionAndInputFiles.json b/tests/cases/project/noProjectOptionAndInputFiles.json new file mode 100644 index 00000000000..b391da41dc3 --- /dev/null +++ b/tests/cases/project/noProjectOptionAndInputFiles.json @@ -0,0 +1,6 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption/Test", + "baselineCheck": true, + "declaration": true +} \ No newline at end of file diff --git a/tests/cases/project/projectOptionTest.json b/tests/cases/project/projectOptionTest.json new file mode 100644 index 00000000000..70ae0435eee --- /dev/null +++ b/tests/cases/project/projectOptionTest.json @@ -0,0 +1,7 @@ +{ + "scenario": "Verify project option", + "projectRoot": "tests/cases/projects/projectOption", + "baselineCheck": true, + "declaration": true, + "project": "Test" +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/a.ts b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/b.js b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/b.js new file mode 100644 index 00000000000..7ba71c35654 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/b.js @@ -0,0 +1 @@ +var test2 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/tsconfig.json new file mode 100644 index 00000000000..1b726957fdd --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecified/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": { "out": "test.js" } +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/a.ts b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/b.js b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/b.js new file mode 100644 index 00000000000..9fdf6253b80 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/b.js @@ -0,0 +1 @@ +var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..167eaebec3a --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesNotSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "out": "test.js", + "allowJs": true + } +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/a.ts b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/b.js b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/b.js new file mode 100644 index 00000000000..9fdf6253b80 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/b.js @@ -0,0 +1 @@ +var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/tsconfig.json new file mode 100644 index 00000000000..582826bdceb --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecified/tsconfig.json @@ -0,0 +1,4 @@ +{ + "compilerOptions": { "out": "test.js" }, + "files": [ "a.ts", "b.js" ] +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/a.ts b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/b.js b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/b.js new file mode 100644 index 00000000000..9fdf6253b80 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/b.js @@ -0,0 +1 @@ +var test2 = 10; // Should get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..1a5a6f6189f --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/DifferentNamesSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "out": "test.js", + "allowJs": true + }, + "files": [ "a.ts", "b.js" ] +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.d.ts b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.d.ts new file mode 100644 index 00000000000..16cb2db6fd7 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.d.ts @@ -0,0 +1 @@ +declare var a: number; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.js b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecified/tsconfig.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.d.ts b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..16cb2db6fd7 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var a: number; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.js b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..05e6c95dddf --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsNotSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1 @@ +{ "compilerOptions": { "allowJs": true } } \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.d.ts b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.d.ts new file mode 100644 index 00000000000..d9e24d329b7 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.d.ts @@ -0,0 +1 @@ +declare var test: number; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.js b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/tsconfig.json new file mode 100644 index 00000000000..e50280fa0d3 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecified/tsconfig.json @@ -0,0 +1 @@ +{ "files": [ "a.d.ts" ] } \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.d.ts b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.d.ts new file mode 100644 index 00000000000..d9e24d329b7 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.d.ts @@ -0,0 +1 @@ +declare var test: number; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.js b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..44fcccf5b22 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameDTsSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1,4 @@ +{ + "compilerOptions": { "allowJs": true }, + "files": [ "a.d.ts" ] +} \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.js b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.ts b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecified/tsconfig.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.js b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.ts b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..05e6c95dddf --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameFilesNotSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1 @@ +{ "compilerOptions": { "allowJs": true } } \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.js b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.ts b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/tsconfig.json new file mode 100644 index 00000000000..1c0fb803356 --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecified/tsconfig.json @@ -0,0 +1 @@ +{ "files": [ "a.ts" ] } \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.js b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.js new file mode 100644 index 00000000000..bbad8b11e3d --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.js @@ -0,0 +1 @@ +var test1 = 10; // Shouldnt get compiled \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.ts b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/tsconfig.json b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/tsconfig.json new file mode 100644 index 00000000000..cbc35e9b9db --- /dev/null +++ b/tests/cases/projects/jsFileCompilation/SameNameTsSpecifiedWithAllowJs/tsconfig.json @@ -0,0 +1,4 @@ +{ + "compilerOptions": { "allowJs": true }, + "files": [ "a.ts" ] +} \ No newline at end of file diff --git a/tests/cases/projects/projectOption/Test/a.ts b/tests/cases/projects/projectOption/Test/a.ts new file mode 100644 index 00000000000..6d820a0093e --- /dev/null +++ b/tests/cases/projects/projectOption/Test/a.ts @@ -0,0 +1 @@ +var test = 10; \ No newline at end of file diff --git a/tests/cases/projects/projectOption/Test/b.ts b/tests/cases/projects/projectOption/Test/b.ts new file mode 100644 index 00000000000..a6bd8e8d430 --- /dev/null +++ b/tests/cases/projects/projectOption/Test/b.ts @@ -0,0 +1 @@ +var test = 10; // Shouldnt get compiled so shouldnt error \ No newline at end of file diff --git a/tests/cases/projects/projectOption/Test/tsconfig.json b/tests/cases/projects/projectOption/Test/tsconfig.json new file mode 100644 index 00000000000..1c0fb803356 --- /dev/null +++ b/tests/cases/projects/projectOption/Test/tsconfig.json @@ -0,0 +1 @@ +{ "files": [ "a.ts" ] } \ No newline at end of file diff --git a/tests/cases/unittests/moduleResolution.ts b/tests/cases/unittests/moduleResolution.ts index a76428a62a1..c4c17ebb223 100644 --- a/tests/cases/unittests/moduleResolution.ts +++ b/tests/cases/unittests/moduleResolution.ts @@ -50,16 +50,16 @@ module ts { describe("Node module resolution - relative paths", () => { function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void { - for (let ext of supportedExtensions) { + for (let ext of supportedTypeScriptExtensions) { let containingFile = { name: containingFileName } let moduleFile = { name: moduleFileNameNoExt + ext } - let resolution = nodeModuleNameResolver(moduleName, containingFile.name, createModuleResolutionHost(containingFile, moduleFile)); + let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); let failedLookupLocations: string[] = []; let dir = getDirectoryPath(containingFileName); - for (let e of supportedExtensions) { + for (let e of supportedTypeScriptExtensions) { if (e === ext) { break; } @@ -92,11 +92,11 @@ module ts { let containingFile = { name: containingFileName }; let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) }; let moduleFile = { name: moduleFileName }; - let resolution = nodeModuleNameResolver(moduleName, containingFile.name, createModuleResolutionHost(containingFile, packageJson, moduleFile)); + let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); // expect three failed lookup location - attempt to load module as file with all supported extensions - assert.equal(resolution.failedLookupLocations.length, 3); + assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length); } it("module name as directory - load from typings", () => { @@ -110,7 +110,7 @@ module ts { let containingFile = { name: "/a/b/c.ts" }; let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) }; let indexFile = { name: "/a/b/foo/index.d.ts" }; - let resolution = nodeModuleNameResolver("./foo", containingFile.name, createModuleResolutionHost(containingFile, packageJson, indexFile)); + let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, indexFile)); assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name); assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); assert.deepEqual(resolution.failedLookupLocations, [ @@ -127,7 +127,7 @@ module ts { it("load module as file - ts files not loaded", () => { let containingFile = { name: "/a/b/c/d/e.ts" }; let moduleFile = { name: "/a/b/node_modules/foo.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, createModuleResolutionHost(containingFile, moduleFile)); + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.deepEqual(resolution.failedLookupLocations, [ "/a/b/c/d/node_modules/foo.ts", @@ -143,14 +143,14 @@ module ts { "/a/b/c/node_modules/foo/package.json", "/a/b/c/node_modules/foo/index.ts", "/a/b/c/node_modules/foo/index.tsx", - "/a/b/c/node_modules/foo/index.d.ts" + "/a/b/c/node_modules/foo/index.d.ts", ]) }); it("load module as file", () => { let containingFile = { name: "/a/b/c/d/e.ts" }; let moduleFile = { name: "/a/b/node_modules/foo.d.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, createModuleResolutionHost(containingFile, moduleFile)); + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); }); @@ -158,7 +158,7 @@ module ts { it("load module as directory", () => { let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" }; let moduleFile = { name: "/a/node_modules/foo/index.d.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, createModuleResolutionHost(containingFile, moduleFile)); + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); assert.deepEqual(resolution.failedLookupLocations, [ @@ -352,6 +352,31 @@ export = C; "moduleC.ts": "export var x" }; test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "", /* useCaseSensitiveFileNames */ false, ["moduleA.ts", "moduleB.ts", "moduleC.ts"], [1149, 1149]); + }); + + it("should fail when module names in 'require' calls has inconsistent casing and current directory has uppercase chars", () => { + const files: Map = { + "/a/B/c/moduleA.ts": `import a = require("./ModuleC")`, + "/a/B/c/moduleB.ts": `import a = require("./moduleC")`, + "/a/B/c/moduleC.ts": "export var x", + "/a/B/c/moduleD.ts": ` +import a = require("./moduleA.ts"); +import b = require("./moduleB.ts"); + ` + }; + test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /* useCaseSensitiveFileNames */ false, ["moduleD.ts"], [1149]); + }); + it("should not fail when module names in 'require' calls has consistent casing and current directory has uppercase chars", () => { + const files: Map = { + "/a/B/c/moduleA.ts": `import a = require("./moduleC")`, + "/a/B/c/moduleB.ts": `import a = require("./moduleC")`, + "/a/B/c/moduleC.ts": "export var x", + "/a/B/c/moduleD.ts": ` +import a = require("./moduleA.ts"); +import b = require("./moduleB.ts"); + ` + }; + test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /* useCaseSensitiveFileNames */ false, ["moduleD.ts"], []); }) }); } \ No newline at end of file diff --git a/tests/cases/unittests/services/preProcessFile.ts b/tests/cases/unittests/services/preProcessFile.ts index a3f8db5528f..d9ddaf0f256 100644 --- a/tests/cases/unittests/services/preProcessFile.ts +++ b/tests/cases/unittests/services/preProcessFile.ts @@ -2,8 +2,8 @@ /// describe('PreProcessFile:', function () { - function test(sourceText: string, readImportFile: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { - var resultPreProcess = ts.preProcessFile(sourceText, readImportFile); + function test(sourceText: string, readImportFile: boolean, detectJavaScriptImports: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { + var resultPreProcess = ts.preProcessFile(sourceText, readImportFile, detectJavaScriptImports); var resultIsLibFile = resultPreProcess.isLibFile; var resultImportedFiles = resultPreProcess.importedFiles; @@ -45,7 +45,9 @@ describe('PreProcessFile:', function () { } describe("Test preProcessFiles,", function () { it("Correctly return referenced files from triple slash", function () { - test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", true, + test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [{ fileName: "refFile1.ts", pos: 0, end: 37 }, { fileName: "refFile2.ts", pos: 38, end: 73 }, { fileName: "refFile3.ts", pos: 74, end: 109 }, { fileName: "..\\refFile4d.ts", pos: 110, end: 150 }], @@ -56,7 +58,9 @@ describe('PreProcessFile:', function () { }), it("Do not return reference path because of invalid triple-slash syntax", function () { - test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", true, + test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [], @@ -66,7 +70,9 @@ describe('PreProcessFile:', function () { }), it("Correctly return imported files", function () { - test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", true, + test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [{ fileName: "r1.ts", pos: 20, end: 25 }, { fileName: "r2.ts", pos: 49, end: 54 }, { fileName: "r3.ts", pos: 78, end: 83 }, @@ -77,7 +83,9 @@ describe('PreProcessFile:', function () { }), it("Do not return imported files if readImportFiles argument is false", function () { - test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", false, + test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", + /* readImports */ false, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [], @@ -87,7 +95,9 @@ describe('PreProcessFile:', function () { }), it("Do not return import path because of invalid import syntax", function () { - test("import i1 require(\"r1.ts\"); import = require(\"r2.ts\") import i3= require(\"r3.ts\"); import i5", true, + test("import i1 require(\"r1.ts\"); import = require(\"r2.ts\") import i3= require(\"r3.ts\"); import i5", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [{ fileName: "r3.ts", pos: 73, end: 78 }], @@ -97,7 +107,9 @@ describe('PreProcessFile:', function () { }), it("Correctly return referenced files and import files", function () { - test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\");", true, + test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\");", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [{ fileName: "refFile1.ts", pos: 0, end: 35 }, { fileName: "refFile2.ts", pos: 36, end: 71 }], importedFiles: [{ fileName: "r1.ts", pos: 92, end: 97 }, { fileName: "r2.ts", pos: 121, end: 126 }], @@ -107,7 +119,9 @@ describe('PreProcessFile:', function () { }), it("Correctly return referenced files and import files even with some invalid syntax", function () { - test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import = require(\"r2.ts\"); import i2 = require(\"r3.ts\");", true, + test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import = require(\"r2.ts\"); import i2 = require(\"r3.ts\");", + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [{ fileName: "refFile1.ts", pos: 0, end: 35 }], importedFiles: [{ fileName: "r1.ts", pos: 91, end: 96 }, { fileName: "r3.ts", pos: 148, end: 153 }], @@ -124,7 +138,8 @@ describe('PreProcessFile:', function () { "import {a as A} from \"m5\";" + "\n" + "import {a as A, b, c as C} from \"m6\";" + "\n" + "import def , {a, b, c as C} from \"m7\";" + "\n", - true, + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [ @@ -146,7 +161,8 @@ describe('PreProcessFile:', function () { "export {a} from \"m2\";" + "\n" + "export {a as A} from \"m3\";" + "\n" + "export {a as A, b, c as C} from \"m4\";" + "\n", - true, + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [ @@ -166,7 +182,11 @@ describe('PreProcessFile:', function () { declare module "B" {} function foo() { } - `, false, { + `, + /* readImports */ false, + /* detectJavaScriptImports */ false, + + { referencedFiles: [], importedFiles: [], ambientExternalModules: ["B"], @@ -176,7 +196,8 @@ describe('PreProcessFile:', function () { it("Correctly handles export import declarations", function () { test("export import a = require(\"m1\");", - true, + /* readImports */true, + /* detectJavaScriptImports */ false, { referencedFiles: [], importedFiles: [ @@ -186,7 +207,61 @@ describe('PreProcessFile:', function () { isLibFile: false }) }); - + it("Correctly handles export require calls in JavaScript files", function () { + test(` + export import a = require("m1"); + var x = require('m2'); + foo(require('m3')); + var z = { f: require('m4') } + `, + /* readImports */true, + /* detectJavaScriptImports */ true, + { + referencedFiles: [], + importedFiles: [ + { fileName: "m1", pos: 39, end: 41 }, + { fileName: "m2", pos: 74, end: 76 }, + { fileName: "m3", pos: 105, end: 107 }, + { fileName: "m4", pos: 146, end: 148 }, + ], + ambientExternalModules: undefined, + isLibFile: false + }) + }); + it("Correctly handles dependency lists in define([deplist]) calls in JavaScript files", function () { + test(` + define(["mod1", "mod2"], (m1, m2) => { + }); + `, + /* readImports */true, + /* detectJavaScriptImports */ true, + { + referencedFiles: [], + importedFiles: [ + { fileName: "mod1", pos: 21, end: 25 }, + { fileName: "mod2", pos: 29, end: 33 }, + ], + ambientExternalModules: undefined, + isLibFile: false + }) + }); + it("Correctly handles dependency lists in define(modName, [deplist]) calls in JavaScript files", function () { + test(` + define("mod", ["mod1", "mod2"], (m1, m2) => { + }); + `, + /* readImports */true, + /* detectJavaScriptImports */ true, + { + referencedFiles: [], + importedFiles: [ + { fileName: "mod1", pos: 28, end: 32 }, + { fileName: "mod2", pos: 36, end: 40 }, + ], + ambientExternalModules: undefined, + isLibFile: false + }) + }); }); }); diff --git a/tests/cases/unittests/versionCache.ts b/tests/cases/unittests/versionCache.ts index 06c2cadbfe9..c1d283ca8cd 100644 --- a/tests/cases/unittests/versionCache.ts +++ b/tests/cases/unittests/versionCache.ts @@ -20,7 +20,10 @@ module ts { } describe('VersionCache TS code', () => { - var testContent = `/// + let validateEditAtLineCharIndex: (line: number, char: number, deleteLength: number, insertString: string) => void; + + before(() => { + let testContent = `/// var x = 10; var y = { zebra: 12, giraffe: "ell" }; z.a; @@ -31,16 +34,21 @@ k=y; var p:Point=new Point(); var q:Point=p;` - let {lines, lineMap} = server.LineIndex.linesFromText(testContent); - assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); + let {lines, lineMap} = server.LineIndex.linesFromText(testContent); + assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); - let lineIndex = new server.LineIndex(); - lineIndex.load(lines); + let lineIndex = new server.LineIndex(); + lineIndex.load(lines); - function validateEditAtLineCharIndex(line: number, char: number, deleteLength: number, insertString: string): void { - let position = lineColToPosition(lineIndex, line, char); - validateEdit(lineIndex, testContent, position, deleteLength, insertString); - } + validateEditAtLineCharIndex = (line: number, char: number, deleteLength: number, insertString: string) => { + let position = lineColToPosition(lineIndex, line, char); + validateEdit(lineIndex, testContent, position, deleteLength, insertString); + }; + }); + + after(() => { + validateEditAtLineCharIndex = undefined; + }) it('change 9 1 0 1 {"y"}', () => { validateEditAtLineCharIndex(9, 1, 0, "y"); @@ -68,22 +76,35 @@ var q:Point=p;` }); describe('VersionCache simple text', () => { - let testContent = `in this story: + let validateEditAtPosition: (position: number, deleteLength: number, insertString: string) => void; + let testContent: string; + let lines: string[]; + let lineMap: number[]; + before(() => { + testContent = `in this story: the lazy brown fox jumped over the cow that ate the grass that was purple at the tips and grew 1cm per day`; - let {lines, lineMap} = server.LineIndex.linesFromText(testContent); - assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); + ({lines, lineMap} = server.LineIndex.linesFromText(testContent)); + assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); - let lineIndex = new server.LineIndex(); - lineIndex.load(lines); + let lineIndex = new server.LineIndex(); + lineIndex.load(lines); - function validateEditAtPosition(position: number, deleteLength: number, insertString: string): void { - validateEdit(lineIndex, testContent, position, deleteLength, insertString); - } + validateEditAtPosition = (position: number, deleteLength: number, insertString: string) => { + validateEdit(lineIndex, testContent, position, deleteLength, insertString); + } + }); + + after(() => { + validateEditAtPosition = undefined; + testContent = undefined; + lines = undefined; + lineMap = undefined; + }); it('Insert at end of file', () => { validateEditAtPosition(testContent.length, 0, "hmmmm...\r\n"); @@ -159,50 +180,69 @@ and grew 1cm per day`; }); describe('VersionCache stress test', () => { - const iterationCount = 20; - //const interationCount = 20000; // uncomment for testing - - // Use scanner.ts, decent size, does not change frequentlly - let testFileName = "src/compiler/scanner.ts"; - let testContent = Harness.IO.readFile(testFileName); - let totalChars = testContent.length; - assert.isTrue(totalChars > 0, "Failed to read test file."); - - let {lines, lineMap} = server.LineIndex.linesFromText(testContent); - assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); - - let lineIndex = new server.LineIndex(); - lineIndex.load(lines); - let rsa: number[] = []; let la: number[] = []; let las: number[] = []; let elas: number[] = []; let ersa: number[] = []; let ela: number[] = []; - let etotalChars = totalChars; + const iterationCount = 20; + //const iterationCount = 20000; // uncomment for testing + let lines: string[]; + let lineMap: number[]; + let lineIndex: server.LineIndex; + let testContent: string; - for (let j = 0; j < 100000; j++) { - rsa[j] = Math.floor(Math.random() * totalChars); - la[j] = Math.floor(Math.random() * (totalChars - rsa[j])); - if (la[j] > 4) { - las[j] = 4; - } - else { - las[j] = la[j]; - } - if (j < 4000) { - ersa[j] = Math.floor(Math.random() * etotalChars); - ela[j] = Math.floor(Math.random() * (etotalChars - ersa[j])); - if (ela[j] > 4) { - elas[j] = 4; + before(() => { + // Use scanner.ts, decent size, does not change frequently + let testFileName = "src/compiler/scanner.ts"; + testContent = Harness.IO.readFile(testFileName); + let totalChars = testContent.length; + assert.isTrue(totalChars > 0, "Failed to read test file."); + + ({lines, lineMap} = server.LineIndex.linesFromText(testContent)); + assert.isTrue(lines.length > 0, "Failed to initialize test text. Expected text to have at least one line"); + + lineIndex = new server.LineIndex(); + lineIndex.load(lines); + + let etotalChars = totalChars; + + for (let j = 0; j < 100000; j++) { + rsa[j] = Math.floor(Math.random() * totalChars); + la[j] = Math.floor(Math.random() * (totalChars - rsa[j])); + if (la[j] > 4) { + las[j] = 4; } else { - elas[j] = ela[j]; + las[j] = la[j]; + } + if (j < 4000) { + ersa[j] = Math.floor(Math.random() * etotalChars); + ela[j] = Math.floor(Math.random() * (etotalChars - ersa[j])); + if (ela[j] > 4) { + elas[j] = 4; + } + else { + elas[j] = ela[j]; + } + etotalChars += (las[j] - elas[j]); } - etotalChars += (las[j] - elas[j]); } - } + }); + + after(() => { + rsa = undefined; + la = undefined; + las = undefined; + elas = undefined; + ersa = undefined; + ela = undefined; + lines = undefined; + lineMap = undefined; + lineIndex = undefined; + testContent = undefined; + }); it("Range (average length 1/4 file size)", () => { for (let i = 0; i < iterationCount; i++) { diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index 6ddc18f1344..dab552e2619 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -5,7 +5,7 @@ import fs = require("fs"); import path = require("path"); import url = require("url"); import child_process = require("child_process"); -import os = require('os'); +import os = require("os"); /// Command line processing /// @@ -269,6 +269,9 @@ if ((browser && browser === 'chrome')) { case "win64": defaultChromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; break; + case "darwin": + defaultChromePath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; + break; case "linux": defaultChromePath = "/opt/google/chrome/chrome" break; @@ -276,7 +279,6 @@ if ((browser && browser === 'chrome')) { console.log(`default Chrome location is unknown for platform '${os.platform()}'`); break; } - if (fs.existsSync(defaultChromePath)) { browserPath = defaultChromePath; } else {