diff --git a/.travis.yml b/.travis.yml index 03e319f6b16..b31d1f10da0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js node_js: + - 'stable' - '4' - '0.10' diff --git a/AUTHORS.md b/AUTHORS.md index 0ade4c31221..a733520ff4f 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 Bumer +* 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 Hrlimann +* 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 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/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/src/compiler/binder.ts b/src/compiler/binder.ts index 6edba58cb11..2993ec3aa0c 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 { @@ -188,6 +189,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 +214,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; @@ -1069,7 +1078,7 @@ namespace ts { return "__" + indexOf((node.parent).parameters, node); } - function bind(node: Node) { + function bind(node: Node): void { if (!node) { return; } @@ -1145,9 +1154,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); @@ -1213,6 +1231,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 +1250,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 +1271,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 +1312,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); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 993742a71e1..7856e3f4cda 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -109,9 +109,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 = {}; @@ -364,7 +364,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 { @@ -480,15 +480,25 @@ namespace ts { } 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 @@ -502,13 +512,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)) { @@ -990,11 +993,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); @@ -1205,7 +1213,7 @@ namespace ts { } switch (location.kind) { case SyntaxKind.SourceFile: - if (!isExternalModule(location)) { + if (!isExternalOrCommonJsModule(location)) { break; } case SyntaxKind.ModuleDeclaration: @@ -1387,7 +1395,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 { @@ -1653,7 +1661,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 @@ -2061,7 +2069,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"); @@ -2182,7 +2190,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; @@ -2337,6 +2345,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; @@ -2359,10 +2387,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)); @@ -2473,10 +2508,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; @@ -2485,6 +2528,9 @@ namespace ts { if (includePatternInType) { result.pattern = pattern; } + if (hasComputedProperties) { + result.flags |= TypeFlags.ObjectLiteralPatternWithComputedProperties; + } return result; } @@ -2567,6 +2613,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; @@ -2870,23 +2924,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; @@ -2913,6 +2969,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) { @@ -2990,7 +3058,7 @@ namespace ts { (type).typeArguments = type.typeParameters; type.thisType = createType(TypeFlags.TypeParameter | TypeFlags.ThisType); type.thisType.symbol = symbol; - type.thisType.constraint = getTypeWithThisArgument(type); + type.thisType.constraint = type; } } return links.declaredType; @@ -3533,6 +3601,21 @@ namespace ts { return type.flags & TypeFlags.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: TypeParameter) { + if (!type.resolvedApparentType) { + let constraintType = getConstraintOfTypeParameter(type); + while (constraintType && constraintType.flags & TypeFlags.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 @@ -3540,12 +3623,7 @@ namespace ts { */ function getApparentType(type: Type): Type { if (type.flags & TypeFlags.TypeParameter) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & TypeFlags.TypeParameter); - if (!type) { - type = emptyObjectType; - } + type = getApparentTypeOfTypeParameter(type); } if (type.flags & TypeFlags.StringLike) { type = globalStringType; @@ -3721,7 +3799,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; } @@ -3831,6 +3909,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)) { @@ -4114,12 +4204,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; @@ -4323,7 +4413,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); @@ -4401,12 +4491,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; } @@ -4977,7 +5068,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) { @@ -5074,9 +5165,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; @@ -5606,18 +5694,31 @@ namespace ts { return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } + function isMatchingSignature(source: Signature, target: Signature, partialMatch: boolean) { + // 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: Signature, target: Signature, partialMatch: boolean, ignoreReturnTypes: boolean, compareTypes: (s: Type, t: Type) => Ternary): Ternary { if (source === target) { return Ternary.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 Ternary.False; - } + if (!(isMatchingSignature(source, target, partialMatch))) { + return Ternary.False; } let result = Ternary.True; if (source.typeParameters && target.typeParameters) { @@ -5724,6 +5825,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. @@ -6180,27 +6285,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)); } @@ -6302,33 +6386,16 @@ 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 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: - // 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); - } - 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); - } - 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); - } - else if ((node).operatorToken.kind === SyntaxKind.BarBarToken) { - narrowedType = narrowType(type, (node).left, /*assumeTrue*/ false); - } - } + nodeStack.push({node, child}); break; case SyntaxKind.SourceFile: case SyntaxKind.ModuleDeclaration: @@ -6341,13 +6408,48 @@ namespace ts { // Stop at the first containing function or module declaration break loop; } - // Use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { + } + + 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) { + type = narrowType(type, (node).expression, /*assumeTrue*/ child === (node).thenStatement); + } break; - } - type = narrowedType; + case SyntaxKind.ConditionalExpression: + // In a branch of a conditional expression, narrow based on controlling condition + if (child !== (node).condition) { + 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) { + type = narrowType(type, (node).left, /*assumeTrue*/ true); + } + else if ((node).operatorToken.kind === SyntaxKind.BarBarToken) { + type = narrowType(type, (node).left, /*assumeTrue*/ false); + } + } + break; + default: + Debug.fail("Unreachable!"); } + + // 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; } } } @@ -6364,31 +6466,31 @@ 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]; + // 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); } } @@ -6402,7 +6504,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) ]); } } @@ -6413,7 +6515,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 { @@ -6424,9 +6526,10 @@ namespace ts { function narrowTypeByInstanceof(type: Type, expr: BinaryExpression, assumeTrue: boolean): Type { // 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 !== SyntaxKind.Identifier || getResolvedSymbol(expr.left) !== symbol) { + if (isTypeAny(type) || expr.left.kind !== SyntaxKind.Identifier || getResolvedSymbol(expr.left) !== symbol) { return type; } + // Check that right operand is a function type with a prototype property const rightType = checkExpression(expr.right); if (!isTypeSubtypeOf(rightType, globalFunctionType)) { @@ -6458,6 +6561,13 @@ namespace ts { } if (targetType) { + if (!assumeTrue) { + if (type.flags & TypeFlags.Union) { + return getUnionType(filter((type).types, t => !isTypeSubtypeOf(t, targetType))); + } + return type; + } + return getNarrowedType(type, targetType); } @@ -6995,6 +7105,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)); @@ -7020,7 +7134,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 @@ -7046,7 +7160,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) @@ -7084,12 +7198,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; @@ -7168,7 +7299,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; } @@ -7298,7 +7429,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 @@ -7390,11 +7521,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 || @@ -7422,8 +7554,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); @@ -7480,7 +7615,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; } @@ -9379,6 +9514,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); } @@ -9391,7 +9532,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); } } @@ -9999,19 +10145,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 { @@ -10221,6 +10375,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(); } @@ -10359,6 +10517,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. @@ -10418,7 +10585,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) { @@ -10489,6 +10656,7 @@ namespace ts { case SyntaxKind.TemplateExpression: return checkTemplateExpression(node); case SyntaxKind.StringLiteral: + return checkStringLiteralExpression(node); case SyntaxKind.NoSubstitutionTemplateLiteral: return stringType; case SyntaxKind.RegularExpressionLiteral: @@ -11278,7 +11446,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); } @@ -12001,7 +12169,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)); @@ -12130,6 +12298,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); @@ -12557,9 +12733,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) { @@ -12683,6 +12864,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) { @@ -12703,6 +12885,12 @@ 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); + + // Permit 'number[] | "foo"' to be asserted to 'string'. + if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, TypeFlags.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); @@ -13234,11 +13422,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; @@ -14058,8 +14249,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 @@ -14073,7 +14268,7 @@ namespace ts { forEach(node.statements, checkSourceElement); checkFunctionAndClassExpressionBodies(node); - if (isExternalModule(node)) { + if (isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -14176,7 +14371,7 @@ namespace ts { switch (location.kind) { case SyntaxKind.SourceFile: - if (!isExternalModule(location)) { + if (!isExternalOrCommonJsModule(location)) { break; } case SyntaxKind.ModuleDeclaration: @@ -14190,8 +14385,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, @@ -14347,8 +14542,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)) { @@ -14415,8 +14610,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); @@ -14453,7 +14648,7 @@ namespace ts { (node.parent).moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } - // Fall through + // Fall through case SyntaxKind.NumericLiteral: // index access @@ -14649,7 +14844,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; } @@ -14900,10 +15095,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 => { @@ -14912,16 +15117,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"); @@ -15682,7 +15887,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/core.ts b/src/compiler/core.ts index 5c882fb5304..c866cf41a92 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -739,12 +739,7 @@ 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 supportedJsExtensions = supportedExtensions.concat(".js", ".jsx"); export function isSupportedSourceFileName(fileName: string) { if (!fileName) { return false; } @@ -785,7 +780,8 @@ namespace ts { }; export interface ObjectAllocator { - getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node; + getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; + getSourceFileConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => SourceFile; getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; getSignatureConstructor(): new (checker: TypeChecker) => Signature; @@ -804,17 +800,17 @@ namespace ts { function Signature(checker: TypeChecker) { } + function Node(kind: SyntaxKind, pos: number, end: number) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = NodeFlags.None; + this.parent = undefined; + } + export let objectAllocator: ObjectAllocator = { - getNodeConstructor: kind => { - function Node(pos: number, end: number) { - this.pos = pos; - this.end = end; - this.flags = NodeFlags.None; - this.parent = undefined; - } - Node.prototype = { kind }; - return Node; - }, + getNodeConstructor: () => Node, + getSourceFileConstructor: () => Node, getSymbolConstructor: () => Symbol, getTypeConstructor: () => Type, getSignatureConstructor: () => Signature diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index ac91a39a78b..669cbcbcf0c 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -45,18 +45,22 @@ namespace ts { let writeLine: () => void; let increaseIndent: () => void; let decreaseIndent: () => void; - let writeTextOfNode: (sourceFile: SourceFile, node: Node) => void; + let writeTextOfNode: (text: string, node: Node) => void; let writer = createAndSetNewTextWriterWithSymbolWriter(); let enclosingDeclaration: Node; - let currentSourceFile: SourceFile; + let currentText: string; + let currentLineMap: number[]; + let currentIdentifiers: Map; + let isCurrentFileExternalModule: boolean; let reportedDeclarationError = false; let errorNameNode: DeclarationName; const emitJsDocComments = compilerOptions.removeComments ? function (declaration: Node) { } : writeJsDocComments; const emit = compilerOptions.stripInternal ? stripInternal : emitNode; + let noDeclare = !root; - const moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; + let moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; let asynchronousSubModuleDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[]; // Contains the reference paths that needs to go in the declaration file. @@ -104,15 +108,16 @@ namespace ts { else { // Emit references corresponding to this file const emittedReferencedFiles: SourceFile[] = []; + let prevModuleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = []; forEach(host.getSourceFiles(), sourceFile => { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { + if (!isDeclarationFile(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) && + // If the reference file is a declaration file, emit that reference + if (referencedFile && (isDeclarationFile(referencedFile) && !contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted writeReferencePath(referencedFile); @@ -120,10 +125,43 @@ namespace ts { } }); } + } + if (!isExternalModuleOrDeclarationFile(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 && !aliasEmitInfo.asynchronousOutput) { + Debug.assert(aliasEmitInfo.node.kind === SyntaxKind.ImportDeclaration); + createAndSetNewTextWriterWithSymbolWriter(); + 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 { @@ -134,14 +172,13 @@ namespace ts { }; function hasInternalAnnotation(range: CommentRange) { - const text = currentSourceFile.text; - const comment = text.substring(range.pos, range.end); + const comment = currentText.substring(range.pos, range.end); return comment.indexOf("@internal") >= 0; } function stripInternal(node: Node) { if (node) { - const leadingCommentRanges = getLeadingCommentRanges(currentSourceFile.text, node.pos); + const leadingCommentRanges = getLeadingCommentRanges(currentText, node.pos); if (forEach(leadingCommentRanges, hasInternalAnnotation)) { return; } @@ -243,7 +280,7 @@ namespace ts { if (errorInfo.typeName) { diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, - getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), + getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } @@ -321,10 +358,10 @@ namespace ts { function writeJsDocComments(declaration: Node) { if (declaration) { - const jsDocComments = getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + const jsDocComments = getJsDocCommentsFromText(declaration, currentText); + emitNewLineBeforeLeadingComments(currentLineMap, writer, declaration, jsDocComments); // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(currentSourceFile, writer, jsDocComments, /*trailingSeparator*/ true, newLine, writeCommentRange); + emitComments(currentText, currentLineMap, writer, jsDocComments, /*trailingSeparator*/ true, newLine, writeCommentRange); } } @@ -343,7 +380,7 @@ namespace ts { case SyntaxKind.VoidKeyword: case SyntaxKind.ThisKeyword: case SyntaxKind.StringLiteral: - return writeTextOfNode(currentSourceFile, type); + return writeTextOfNode(currentText, type); case SyntaxKind.ExpressionWithTypeArguments: return emitExpressionWithTypeArguments(type); case SyntaxKind.TypeReference: @@ -375,14 +412,14 @@ namespace ts { function writeEntityName(entityName: EntityName | Expression) { if (entityName.kind === SyntaxKind.Identifier) { - writeTextOfNode(currentSourceFile, entityName); + writeTextOfNode(currentText, entityName); } else { const left = entityName.kind === SyntaxKind.QualifiedName ? (entityName).left : (entityName).expression; const right = entityName.kind === SyntaxKind.QualifiedName ? (entityName).right : (entityName).name; writeEntityName(left); write("."); - writeTextOfNode(currentSourceFile, right); + writeTextOfNode(currentText, right); } } @@ -417,7 +454,7 @@ namespace ts { } function emitTypePredicate(type: TypePredicateNode) { - writeTextOfNode(currentSourceFile, type.parameterName); + writeTextOfNode(currentText, type.parameterName); write(" is "); emitType(type.type); } @@ -466,9 +503,12 @@ namespace ts { } function emitSourceFile(node: SourceFile) { - currentSourceFile = node; + currentText = node.text; + currentLineMap = getLineStarts(node); + currentIdentifiers = node.identifiers; + isCurrentFileExternalModule = isExternalModule(node); enclosingDeclaration = node; - emitDetachedComments(currentSourceFile, writer, writeCommentRange, node, newLine, true /* remove comments */); + emitDetachedComments(currentText, currentLineMap, writer, writeCommentRange, node, newLine, true /* remove comments */); emitLines(node.statements); } @@ -478,13 +518,13 @@ namespace ts { // do not need to keep track of created temp names. function getExportDefaultTempVariableName(): string { const baseName = "_default"; - if (!hasProperty(currentSourceFile.identifiers, baseName)) { + if (!hasProperty(currentIdentifiers, baseName)) { return baseName; } let count = 0; while (true) { const name = baseName + "_" + (++count); - if (!hasProperty(currentSourceFile.identifiers, name)) { + if (!hasProperty(currentIdentifiers, name)) { return name; } } @@ -493,7 +533,7 @@ namespace ts { function emitExportAssignment(node: ExportAssignment) { if (node.expression.kind === SyntaxKind.Identifier) { write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); + writeTextOfNode(currentText, node.expression); } else { // Expression @@ -537,7 +577,7 @@ namespace ts { } // Import equals declaration in internal module can become visible as part of any emit so lets make sure we add these irrespective else if (node.kind === SyntaxKind.ImportEqualsDeclaration || - (node.parent.kind === SyntaxKind.SourceFile && isExternalModule(currentSourceFile))) { + (node.parent.kind === SyntaxKind.SourceFile && isCurrentFileExternalModule)) { let isVisible: boolean; if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== SyntaxKind.SourceFile) { // Import declaration of another module that is visited async so lets put it in right spot @@ -593,7 +633,7 @@ namespace ts { function emitModuleElementDeclarationFlags(node: 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 === SyntaxKind.SourceFile) { // If the node is exported if (node.flags & NodeFlags.Export) { write("export "); @@ -602,7 +642,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 "); } } @@ -632,7 +672,7 @@ namespace ts { write("export "); } write("import "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" = "); if (isInternalModuleImportEqualsDeclaration(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); @@ -640,7 +680,7 @@ namespace ts { } else { write("require("); - writeTextOfNode(currentSourceFile, getExternalModuleImportEqualsDeclarationExpression(node)); + writeTextOfNode(currentText, getExternalModuleImportEqualsDeclarationExpression(node)); write(");"); } writer.writeLine(); @@ -678,7 +718,7 @@ namespace ts { if (node.importClause) { const 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()) { @@ -687,7 +727,7 @@ namespace ts { } if (node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { write("* as "); - writeTextOfNode(currentSourceFile, (node.importClause.namedBindings).name); + writeTextOfNode(currentText, (node.importClause.namedBindings).name); } else { write("{ "); @@ -697,17 +737,31 @@ namespace ts { } write(" from "); } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); write(";"); writer.writeLine(); } + function emitExternalModuleSpecifier(moduleSpecifier: Expression) { + if (moduleSpecifier.kind === SyntaxKind.StringLiteral && (!root) && (compilerOptions.out || compilerOptions.outFile)) { + 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(currentSourceFile, node.propertyName); + writeTextOfNode(currentText, node.propertyName); write(" as "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } function emitExportSpecifier(node: ExportSpecifier) { @@ -733,7 +787,7 @@ namespace ts { } if (node.moduleSpecifier) { write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); + emitExternalModuleSpecifier(node.moduleSpecifier); } write(";"); writer.writeLine(); @@ -748,11 +802,11 @@ namespace ts { else { write("module "); } - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); while (node.body.kind !== SyntaxKind.ModuleBlock) { node = node.body; write("."); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } const prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; @@ -772,7 +826,7 @@ namespace ts { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("type "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); emitTypeParameters(node.typeParameters); write(" = "); emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); @@ -796,7 +850,7 @@ namespace ts { write("const "); } write("enum "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); write(" {"); writeLine(); increaseIndent(); @@ -808,7 +862,7 @@ namespace ts { function emitEnumMemberDeclaration(node: EnumMember) { emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); const enumMemberValue = resolver.getConstantValue(node); if (enumMemberValue !== undefined) { write(" = "); @@ -827,7 +881,7 @@ namespace 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 "); @@ -958,7 +1012,7 @@ namespace ts { } write("class "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); const prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -982,7 +1036,7 @@ namespace ts { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); write("interface "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); const prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitTypeParameters(node.typeParameters); @@ -1020,7 +1074,7 @@ namespace 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 === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && hasQuestionToken(node)) { write("?"); @@ -1107,7 +1161,7 @@ namespace ts { emitBindingPattern(bindingElement.name); } else { - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); writeTypeOfDeclaration(bindingElement, /*type*/ undefined, getBindingElementTypeVisibilityError); } } @@ -1157,7 +1211,7 @@ namespace ts { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (!(node.flags & NodeFlags.Private)) { accessorWithTypeAnnotation = node; let type = getTypeAnnotationFromAccessor(node); @@ -1247,13 +1301,13 @@ namespace ts { } if (node.kind === SyntaxKind.FunctionDeclaration) { write("function "); - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } else if (node.kind === SyntaxKind.Constructor) { write("constructor"); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); if (hasQuestionToken(node)) { write("?"); } @@ -1393,7 +1447,7 @@ namespace ts { emitBindingPattern(node.name); } else { - writeTextOfNode(currentSourceFile, node.name); + writeTextOfNode(currentText, node.name); } if (resolver.isOptionalParameter(node)) { write("?"); @@ -1519,7 +1573,7 @@ namespace 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) { @@ -1542,7 +1596,7 @@ namespace ts { if (bindingElement.dotDotDotToken) { write("..."); } - writeTextOfNode(currentSourceFile, bindingElement.name); + writeTextOfNode(currentText, bindingElement.name); } } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e6008ce3c1e..ad71d646b7b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2310,7 +2310,6 @@ "category": "Message", "code": 6078 }, - "Specify JSX code generation: 'preserve' or 'react'": { "category": "Message", "code": 6080 @@ -2319,7 +2318,10 @@ "category": "Message", "code": 6081 }, - + "Only 'amd' and 'system' modules are supported alongside --{0}.": { + "category": "Error", + "code": 6082 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 464bd51a91d..d0314649b88 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -7,6 +7,18 @@ namespace ts { 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; const enum Jump { @@ -332,17 +344,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const newLine = host.getNewLine(); const jsxDesugaring = host.getCompilerOptions().jsx !== JsxEmit.Preserve; const shouldEmitJsx = (s: SourceFile) => (s.languageVariant === LanguageVariant.JSX && !jsxDesugaring); + const outFile = compilerOptions.outFile || compilerOptions.out; + + 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); + if (outFile) { + emitFile(outFile); + } + else { + forEach(host.getSourceFiles(), sourceFile => { + if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { + const jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); + emitFile(jsFilePath, sourceFile); + } + }); } } else { @@ -351,8 +367,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi 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); + else if (!isDeclarationFile(targetSourceFile) && outFile) { + emitFile(outFile); } } @@ -470,11 +486,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } - function emitJavaScript(jsFilePath: string, root?: SourceFile) { - const writer = createTextWriter(newLine); + function createFileEmitter(): (jsFilePath: string, root?: SourceFile) => void { + const writer: EmitTextWriter = createTextWriter(newLine); const { write, writeTextOfNode, writeLine, increaseIndent, decreaseIndent } = writer; let currentSourceFile: SourceFile; + let currentText: string; + let currentLineMap: number[]; + let currentFileIdentifiers: Map; + let renamedDependencies: Map; + let isEs6Module: boolean; + let isCurrentFileExternalModule: boolean; + // name of an exporter function if file is a System external module // System.register([...], function () {...}) // exporting in System modules looks like: @@ -483,17 +506,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // var x;... exporter("x", x = 1) let exportFunctionForFile: string; - const generatedNameSet: Map = {}; - const nodeToGeneratedName: string[] = []; + let generatedNameSet: Map; + let nodeToGeneratedName: string[]; let computedPropertyNamesToGeneratedNames: string[]; let convertedLoopState: ConvertedLoopState; - let extendsEmitted = false; - let decorateEmitted = false; - let paramEmitted = false; - let awaiterEmitted = false; - let tempFlags = 0; + let extendsEmitted: boolean; + let decorateEmitted: boolean; + let paramEmitted: boolean; + let awaiterEmitted: boolean; + let tempFlags: TempFlags; let tempVariables: Identifier[]; let tempParameters: Identifier[]; let externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; @@ -536,10 +559,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /** Sourcemap data that will get encoded */ let sourceMapData: SourceMapData; + /** The root file passed to the emit function (if present) */ + let root: SourceFile; + /** 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, @@ -547,35 +573,86 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi [ModuleKind.CommonJS]: emitCommonJSModule, }; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } + const bundleEmitDelegates: Map<(node: SourceFile, emitRelativePathAsModuleName?: boolean) => void> = { + [ModuleKind.ES6]() {}, + [ModuleKind.AMD]: emitAMDModule, + [ModuleKind.System]: emitSystemModule, + [ModuleKind.UMD]() {}, + [ModuleKind.CommonJS]() {}, + }; - 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); + return doEmit; + + function doEmit(jsFilePath: string, rootFile?: SourceFile) { + // 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) { + forEach(host.getSourceFiles(), emitEmitHelpers); } - }); - } + forEach(host.getSourceFiles(), sourceFile => { + if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && isExternalModule(sourceFile))) { + emitSourceFile(sourceFile); + } + }); + } - writeLine(); - writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM); - return; + writeLine(); + writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); + } function emitSourceFile(sourceFile: SourceFile): void { currentSourceFile = sourceFile; + + currentText = sourceFile.text; + currentLineMap = getLineStarts(sourceFile); exportFunctionForFile = undefined; + isEs6Module = sourceFile.symbol && sourceFile.symbol.exports && !!sourceFile.symbol.exports["___esModule"]; + renamedDependencies = sourceFile.renamedDependencies; + currentFileIdentifiers = sourceFile.identifiers; + isCurrentFileExternalModule = isExternalModule(sourceFile); + emit(sourceFile); } function isUniqueName(name: string): boolean { return !resolver.hasGlobalName(name) && - !hasProperty(currentSourceFile.identifiers, name) && + !hasProperty(currentFileIdentifiers, name) && !hasProperty(generatedNameSet, name); } @@ -667,7 +744,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps() { + function initializeEmitterWithSourceMaps(jsFilePath: string, root?: SourceFile) { let sourceMapDir: string; // The directory in which sourcemap will be // Current source map file and its index in the sources list @@ -771,7 +848,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function recordSourceMapSpan(pos: number) { - const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos); + const sourceLinePos = computeLineAndCharacterOfPosition(currentLineMap, pos); // Convert the location to be one-based. sourceLinePos.line++; @@ -810,7 +887,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function recordEmitNodeStartSpan(node: Node) { // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(skipTrivia(currentSourceFile.text, node.pos)); + recordSourceMapSpan(skipTrivia(currentText, node.pos)); } function recordEmitNodeEndSpan(node: Node) { @@ -818,7 +895,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function writeTextWithSpanRecord(tokenKind: SyntaxKind, startPos: number, emitFn?: () => void) { - const tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + const tokenStartPos = ts.skipTrivia(currentText, startPos); recordSourceMapSpan(tokenStartPos); const tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); recordSourceMapSpan(tokenEndPos); @@ -912,9 +989,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi sourceMapNameIndices.pop(); }; - function writeCommentRangeWithMap(curentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) { + function writeCommentRangeWithMap(currentText: string, currentLineMap: number[], writer: EmitTextWriter, comment: CommentRange, newLine: string) { recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); + writeCommentRange(currentText, currentLineMap, writer, comment, newLine); recordSourceMapSpan(comment.end); } @@ -950,7 +1027,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } - function writeJavaScriptAndSourceMapFile(emitOutput: string, writeByteOrderMark: boolean) { + function writeJavaScriptAndSourceMapFile(emitOutput: string, jsFilePath: string, writeByteOrderMark: boolean) { encodeLastRecordedSourceMapSpan(); const sourceMapText = serializeSourceMapContents( @@ -977,7 +1054,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } // 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 @@ -1059,7 +1136,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi writeComment = writeCommentRangeWithMap; } - function writeJavaScriptFile(emitOutput: string, writeByteOrderMark: boolean) { + function writeJavaScriptFile(emitOutput: string, jsFilePath: string, writeByteOrderMark: boolean) { writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } @@ -1269,7 +1346,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // 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 getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + return getTextOfNodeFromSourceText(currentText, node); } // If we can't reach the original source text, use the canonical form if it's a number, @@ -1300,7 +1377,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // 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". - let text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + let text = 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. @@ -1772,7 +1849,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write((node).text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } write("\""); @@ -1876,7 +1953,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); const name = (declaration).propertyName || (declaration).name; - const identifier = getSourceTextOfNodeFromSourceFile(currentSourceFile, name); + const identifier = getTextOfNodeFromSourceText(currentText, name); if (languageVersion === ScriptTarget.ES3 && identifier === "default") { write(`["default"]`); } @@ -1902,7 +1979,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } @@ -1943,7 +2020,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(node.text); } else { - writeTextOfNode(currentSourceFile, node); + writeTextOfNode(currentText, node); } } @@ -2403,7 +2480,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitShorthandPropertyAssignment(node: ShorthandPropertyAssignment) { // 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 { @@ -2413,7 +2490,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); @@ -2480,11 +2557,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // 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 - let shouldEmitSpace: boolean; + let shouldEmitSpace = false; if (!indentedBeforeDot) { if (node.expression.kind === SyntaxKind.NumericLiteral) { // check if numeric literal was originally written with a dot - const text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node.expression); + const text = getTextOfNodeFromSourceText(currentText, node.expression); shouldEmitSpace = text.indexOf(tokenToString(SyntaxKind.DotToken)) < 0; } else { @@ -3815,18 +3892,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function nodeStartPositionsAreOnSameLine(node1: Node, node2: Node) { - return getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPositionFromLineMap(currentLineMap, skipTrivia(currentText, node1.pos)) === + getLineOfLocalPositionFromLineMap(currentLineMap, skipTrivia(currentText, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1: Node, node2: Node) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + getLineOfLocalPositionFromLineMap(currentLineMap, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1: Node, node2: Node) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPositionFromLineMap(currentLineMap, node1.end) === + getLineOfLocalPositionFromLineMap(currentLineMap, skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { @@ -3948,7 +4025,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi Debug.assert(!!(node.flags & NodeFlags.Default) || node.kind === SyntaxKind.ExportAssignment); // only allow export default at a source file level if (modulekind === ModuleKind.CommonJS || modulekind === ModuleKind.AMD || modulekind === ModuleKind.UMD) { - if (!currentSourceFile.symbol.exports["___esModule"]) { + if (!isEs6Module) { if (languageVersion === ScriptTarget.ES5) { // default value of configurable, enumerable, writable are `false`. write("Object.defineProperty(exports, \"__esModule\", { value: true });"); @@ -4167,15 +4244,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, /* 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 = 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 { @@ -6304,8 +6388,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * Here we check if alternative name was provided for a given moduleName and return it if possible. */ function tryRenameExternalModule(moduleName: LiteralExpression): string { - if (currentSourceFile.renamedDependencies && hasProperty(currentSourceFile.renamedDependencies, moduleName.text)) { - return `"${currentSourceFile.renamedDependencies[moduleName.text]}"`; + if (renamedDependencies && hasProperty(renamedDependencies, moduleName.text)) { + return `"${renamedDependencies[moduleName.text]}"`; } return undefined; } @@ -6467,7 +6551,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // - current file is not external module // - import declaration is top level and target is value imported by entity name if (resolver.isReferencedAliasDeclaration(node) || - (!isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + (!isCurrentFileExternalModule && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); @@ -6708,7 +6792,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function getLocalNameForExternalImport(node: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration): string { const namespaceDeclaration = getNamespaceDeclarationNode(node); if (namespaceDeclaration && !isDefaultImport(node)) { - return getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + return getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } if (node.kind === SyntaxKind.ImportDeclaration && (node).importClause) { return getGeneratedNameForNode(node); @@ -7064,7 +7148,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function isCurrentFileSystemExternalModule() { - return modulekind === ModuleKind.System && isExternalModule(currentSourceFile); + return modulekind === ModuleKind.System && isCurrentFileExternalModule; } function emitSystemModuleBody(node: SourceFile, dependencyGroups: DependencyGroup[], startIndex: number): void { @@ -7249,7 +7333,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 */}) @@ -7264,16 +7355,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]; @@ -7289,6 +7378,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}) {`); @@ -7309,7 +7404,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 @@ -7331,7 +7426,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); @@ -7347,7 +7449,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); // @@ -7360,7 +7462,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); @@ -7388,16 +7490,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(); @@ -7646,8 +7746,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 (root || (!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 @@ -7927,7 +8032,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - const leadingComments = getLeadingCommentRanges(currentSourceFile.text, + const leadingComments = getLeadingCommentRanges(currentText, lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); @@ -7947,10 +8052,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function isTripleSlashComment(comment: CommentRange) { // 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) === CharacterCodes.slash && + if (currentText.charCodeAt(comment.pos + 1) === CharacterCodes.slash && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.slash) { - const textSubStr = currentSourceFile.text.substring(comment.pos, comment.end); + currentText.charCodeAt(comment.pos + 2) === CharacterCodes.slash) { + const textSubStr = currentText.substring(comment.pos, comment.end); return textSubStr.match(fullTripleSlashReferencePathRegEx) || textSubStr.match(fullTripleSlashAMDReferencePathRegEx) ? true : false; @@ -7968,7 +8073,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { // get the leading comments from the node - return getLeadingCommentRangesOfNode(node, currentSourceFile); + return getLeadingCommentRangesOfNodeFromText(node, currentText); } } } @@ -7978,7 +8083,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // 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 === SyntaxKind.SourceFile || node.end !== node.parent.end) { - return getTrailingCommentRanges(currentSourceFile.text, node.end); + return getTrailingCommentRanges(currentText, node.end); } } } @@ -8017,10 +8122,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); } function emitTrailingComments(node: Node) { @@ -8032,7 +8137,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const trailingComments = getTrailingCommentsToEmit(node); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); + emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); } /** @@ -8045,10 +8150,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return; } - const trailingComments = getTrailingCommentRanges(currentSourceFile.text, pos); + const trailingComments = getTrailingCommentRanges(currentText, pos); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); + emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitLeadingCommentsOfPositionWorker(pos: number) { @@ -8063,17 +8168,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { // get the leading comments from the node - leadingComments = getLeadingCommentRanges(currentSourceFile.text, pos); + leadingComments = getLeadingCommentRanges(currentText, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + emitNewLineBeforeLeadingComments(currentLineMap, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); + emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAndUpdateCommentsInfo(node: TextRange) { - const currentDetachedCommentInfo = emitDetachedComments(currentSourceFile, writer, writeComment, node, newLine, compilerOptions.removeComments); + const currentDetachedCommentInfo = emitDetachedComments(currentText, currentLineMap, writer, writeComment, node, newLine, compilerOptions.removeComments); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { @@ -8086,7 +8191,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function emitShebang() { - const shebang = getShebang(currentSourceFile.text); + const shebang = getShebang(currentText); if (shebang) { write(shebang); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ab06b12318b..ac37f608417 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1,16 +1,19 @@ -/// /// +/// namespace ts { - const nodeConstructors = new Array Node>(SyntaxKind.Count); /* @internal */ export let parseTime = 0; - export function getNodeConstructor(kind: SyntaxKind): new (pos?: number, end?: number) => Node { - return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)); - } + let NodeConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; + let SourceFileConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; export function createNode(kind: SyntaxKind, pos?: number, end?: number): Node { - return new (getNodeConstructor(kind))(pos, end); + if (kind === SyntaxKind.SourceFile) { + return new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, pos, end); + } + else { + return new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, pos, end); + } } function visitNode(cbNode: (node: Node) => T, node: Node): T { @@ -437,6 +440,10 @@ namespace ts { const scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); const disallowInAndDecoratorContext = ParserContextFlags.DisallowIn | ParserContextFlags.Decorator; + // capture constructors in 'initializeState' to avoid null checks + let NodeConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; + let SourceFileConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; + let sourceFile: SourceFile; let parseDiagnostics: Diagnostic[]; let syntaxCursor: IncrementalParser.SyntaxCursor; @@ -527,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); @@ -536,7 +544,10 @@ namespace ts { return result; } - function initializeState(fileName: string, _sourceText: string, languageVersion: ScriptTarget, _syntaxCursor: IncrementalParser.SyntaxCursor) { + function initializeState(fileName: string, _sourceText: string, languageVersion: ScriptTarget, isJavaScriptFile: boolean, _syntaxCursor: IncrementalParser.SyntaxCursor) { + NodeConstructor = objectAllocator.getNodeConstructor(); + SourceFileConstructor = objectAllocator.getSourceFileConstructor(); + sourceText = _sourceText; syntaxCursor = _syntaxCursor; @@ -546,14 +557,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(allowsJsxExpressions(fileName) ? LanguageVariant.JSX : LanguageVariant.Standard); } function clearState() { @@ -572,6 +583,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); @@ -594,7 +609,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(); } @@ -657,21 +672,22 @@ namespace ts { } function createSourceFile(fileName: string, languageVersion: ScriptTarget): SourceFile { - const sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0); + // 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 + const sourceFile = new SourceFileConstructor(SyntaxKind.SourceFile, /*pos*/ 0, /* end */ sourceText.length); + nodeCount++; - sourceFile.pos = 0; - sourceFile.end = sourceText.length; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; 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 = allowsJsxExpressions(sourceFile.fileName) ? LanguageVariant.JSX : LanguageVariant.Standard; return sourceFile; } - function setContextFlag(val: Boolean, flag: ParserContextFlags) { + function setContextFlag(val: boolean, flag: ParserContextFlags) { if (val) { contextFlags |= flag; } @@ -991,12 +1007,14 @@ namespace ts { } } + // note: this function creates only node function createNode(kind: SyntaxKind, pos?: number): Node { nodeCount++; if (!(pos >= 0)) { pos = scanner.getStartPos(); } - return new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(pos, pos); + + return new NodeConstructor(kind, pos, pos); } function finishNode(node: T, end?: number): T { @@ -1069,7 +1087,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); } @@ -1079,7 +1097,7 @@ namespace ts { return parseIdentifierName(); } - function parsePropertyName(): DeclarationName { + function parsePropertyName(): PropertyName { return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ true); } @@ -1189,7 +1207,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. @@ -1979,9 +1997,7 @@ namespace ts { function parseParameterType(): TypeNode { if (parseOptional(SyntaxKind.ColonToken)) { - return token === SyntaxKind.StringLiteral - ? parseLiteralNode(/*internName*/ true) - : parseType(); + return parseType(); } return undefined; @@ -2369,6 +2385,8 @@ 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(); @@ -2399,6 +2417,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, @@ -4568,7 +4587,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) { @@ -4576,7 +4594,7 @@ namespace ts { } else { parseExpected(SyntaxKind.ColonToken); - node.propertyName = propertyName; + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseBindingElementInitializer(/*inParameter*/ false); @@ -5505,7 +5523,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(); @@ -5616,6 +5634,7 @@ namespace ts { return parseTokenNode(); } + // TODO (drosen): Parse string literal types in JSDoc as well. return parseJSDocTypeReference(); } @@ -5825,7 +5844,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(); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 4600d489c45..08321da82e9 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -53,13 +53,13 @@ namespace ts { if (getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { const failedLookupLocations: string[] = []; const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - let resolvedFileName = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + let resolvedFileName = loadNodeModuleFromFile(supportedJsExtensions, candidate, failedLookupLocations, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName }, failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedJsExtensions, 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,12 @@ namespace ts { if (baseName !== "node_modules") { const nodeModulesFolder = combinePaths(directory, "node_modules"); const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName)); - let result = loadNodeModuleFromFile(candidate, failedLookupLocations, host); + let result = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } - result = loadNodeModuleFromDirectory(candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } @@ -162,9 +162,10 @@ namespace ts { const failedLookupLocations: string[] = []; let referencedSourceFile: string; + const extensions = compilerOptions.allowNonTsExtensions ? supportedJsExtensions : supportedExtensions; while (true) { searchName = normalizePath(combinePaths(searchPath, moduleName)); - referencedSourceFile = forEach(supportedExtensions, extension => { + referencedSourceFile = forEach(extensions, extension => { if (extension === ".tsx" && !compilerOptions.jsx) { // resolve .tsx files only if jsx support is enabled // 'logical not' handles both undefined and None cases @@ -688,45 +689,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)); + } } } } @@ -833,7 +849,6 @@ namespace ts { processImportedModules(file, basePath); if (isDefaultLib) { - file.isDefaultLib = true; files.unshift(file); } else { @@ -923,6 +938,10 @@ namespace ts { } }); + if (!commonPathComponents) { // Can happen when all input files are .d.ts files + return currentDirectory; + } + return getNormalizedPathFromPathComponents(commonPathComponents); } @@ -1024,12 +1043,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 diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 4e11e0d6b99..9703ef8517b 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -580,7 +580,7 @@ namespace ts { function getCommentRanges(text: string, pos: number, trailing: boolean): CommentRange[] { let result: CommentRange[]; let collecting = trailing || pos === 0; - while (true) { + while (pos < text.length) { const ch = text.charCodeAt(pos); switch (ch) { case CharacterCodes.carriageReturn: @@ -650,6 +650,8 @@ namespace ts { } return result; } + + return result; } export function getLeadingCommentRanges(text: string, pos: number): CommentRange[] { @@ -741,7 +743,7 @@ namespace ts { } } - function scanNumber(): number { + function scanNumber(): string { const start = pos; while (isDigit(text.charCodeAt(pos))) pos++; if (text.charCodeAt(pos) === CharacterCodes.dot) { @@ -761,7 +763,7 @@ namespace ts { error(Diagnostics.Digit_expected); } } - return +(text.substring(start, end)); + return "" + +(text.substring(start, end)); } function scanOctalDigits(): number { @@ -1229,7 +1231,7 @@ namespace ts { return pos++, token = SyntaxKind.MinusToken; case CharacterCodes.dot: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = SyntaxKind.NumericLiteral; } if (text.charCodeAt(pos + 1) === CharacterCodes.dot && text.charCodeAt(pos + 2) === CharacterCodes.dot) { @@ -1343,7 +1345,7 @@ namespace ts { case CharacterCodes._7: case CharacterCodes._8: case CharacterCodes._9: - tokenValue = "" + scanNumber(); + tokenValue = scanNumber(); return token = SyntaxKind.NumericLiteral; case CharacterCodes.colon: return pos++, token = SyntaxKind.ColonToken; diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 79158cf4e9d..f560a15dfb9 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -346,9 +346,20 @@ 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; + if (!configObject) { + reportDiagnostics([result.error], /* compilerHost */ undefined); + sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + return; + } const configParseResult = parseJsonConfigFileContent(configObject, sys, getDirectoryPath(configFileName)); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors, /* compilerHost */ undefined); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f536a1e4693..8b0027c1377 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -491,6 +491,7 @@ 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 { @@ -543,7 +544,7 @@ namespace ts { // 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 @@ -587,7 +588,7 @@ namespace ts { // SyntaxKind.ShorthandPropertyAssignment // SyntaxKind.EnumMember export interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; + propertyName?: PropertyName; dotDotDotToken?: Node; name: DeclarationName; questionToken?: Node; @@ -701,7 +702,7 @@ namespace ts { } // 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. export interface StringLiteral extends LiteralExpression, TypeNode { _stringLiteralBrand: any; } @@ -773,7 +774,8 @@ namespace ts { expression?: Expression; } - export interface BinaryExpression extends Expression { + // 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; @@ -834,7 +836,7 @@ namespace ts { properties: NodeArray; } - export interface PropertyAccessExpression extends MemberExpression { + export interface PropertyAccessExpression extends MemberExpression, Declaration { expression: LeftHandSideExpression; dotToken: Node; name: Identifier; @@ -1284,8 +1286,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 +1625,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 +1825,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, @@ -1956,6 +1961,8 @@ namespace ts { target?: TypeParameter; // Instantiation target /* @internal */ mapper?: TypeMapper; // Instantiation mapper + /* @internal */ + resolvedApparentType: Type; } export const enum SignatureKind { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index aecf8ab76ba..ed7242a785e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1,4 +1,3 @@ -/// /// /* @internal */ @@ -362,6 +361,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; } @@ -421,18 +424,26 @@ namespace ts { return getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } + export function getLeadingCommentRangesOfNodeFromText(node: Node, text: string) { + return getLeadingCommentRanges(text, node.pos); + } + export function getJsDocComments(node: Node, sourceFileOfNode: SourceFile) { + return getJsDocCommentsFromText(node, sourceFileOfNode.text); + } + + export function getJsDocCommentsFromText(node: Node, text: string) { const commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ? - concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos), - getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : - getLeadingCommentRangesOfNode(node, sourceFileOfNode); + concatenate(getTrailingCommentRanges(text, node.pos), + getLeadingCommentRanges(text, node.pos)) : + getLeadingCommentRangesOfNodeFromText(node, text); return filter(commentRanges, isJsDocComment); function isJsDocComment(comment: CommentRange) { // True if the comment starts with '/**' but not if it is '/**/' - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === CharacterCodes.asterisk && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== CharacterCodes.slash; + return text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && + text.charCodeAt(comment.pos + 2) === CharacterCodes.asterisk && + text.charCodeAt(comment.pos + 3) !== CharacterCodes.slash; } } @@ -1048,6 +1059,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; @@ -1383,8 +1445,8 @@ namespace ts { export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { const simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { + if (simpleReferenceRegEx.test(comment)) { + if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -1427,6 +1489,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 @@ -1435,9 +1501,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); } /** @@ -1652,6 +1722,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) @@ -1689,7 +1760,7 @@ namespace ts { export interface EmitTextWriter { write(s: string): void; - writeTextOfNode(sourceFile: SourceFile, node: Node): void; + writeTextOfNode(text: string, node: Node): void; writeLine(): void; increaseIndent(): void; decreaseIndent(): void; @@ -1700,6 +1771,7 @@ namespace ts { getLine(): number; getColumn(): number; getIndent(): number; + reset(): void; } const indentStrings: string[] = ["", " "]; @@ -1715,11 +1787,11 @@ namespace ts { } export function createTextWriter(newLine: String): EmitTextWriter { - let output = ""; - let indent = 0; - let lineStart = true; - let lineCount = 0; - let linePos = 0; + let output: string; + let indent: number; + let lineStart: boolean; + let lineCount: number; + let linePos: number; function write(s: string) { if (s && s.length) { @@ -1731,6 +1803,14 @@ namespace ts { } } + function reset(): void { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + } + function rawWrite(s: string) { if (s !== undefined) { if (lineStart) { @@ -1760,10 +1840,12 @@ namespace ts { } } - function writeTextOfNode(sourceFile: SourceFile, node: Node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + function writeTextOfNode(text: string, node: Node) { + write(getTextOfNodeFromSourceText(text, node)); } + reset(); + return { write, rawWrite, @@ -1777,9 +1859,19 @@ namespace ts { getLine: () => lineCount + 1, getColumn: () => lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1, getText: () => output, + reset }; } + /** + * 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; @@ -1809,6 +1901,10 @@ namespace ts { return getLineAndCharacterOfPosition(currentSourceFile, pos).line; } + export function getLineOfLocalPositionFromLineMap(lineMap: number[], pos: number) { + return computeLineAndCharacterOfPosition(lineMap, pos).line; + } + export function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration { return forEach(node.members, member => { if (member.kind === SyntaxKind.Constructor && nodeIsPresent((member).body)) { @@ -1883,23 +1979,23 @@ namespace ts { }; } - export function emitNewLineBeforeLeadingComments(currentSourceFile: SourceFile, writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]) { + export function emitNewLineBeforeLeadingComments(lineMap: number[], writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]) { // 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(); } } - export function emitComments(currentSourceFile: SourceFile, writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, - writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void) { + export function emitComments(text: string, lineMap: number[], writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, + writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, comment: CommentRange, newLine: string) => void) { let emitLeadingSpace = !trailingSeparator; forEach(comments, comment => { if (emitLeadingSpace) { writer.write(" "); emitLeadingSpace = false; } - writeComment(currentSourceFile, writer, comment, newLine); + writeComment(text, lineMap, writer, comment, newLine); if (comment.hasTrailingNewLine) { writer.writeLine(); } @@ -1917,8 +2013,8 @@ namespace ts { * Detached comment is a comment at the top of file or function body that is separated from * the next statement by space. */ - export function emitDetachedComments(currentSourceFile: SourceFile, writer: EmitTextWriter, - writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void, + export function emitDetachedComments(text: string, lineMap: number[], writer: EmitTextWriter, + writeComment: (text: string, lineMap: number[], writer: EmitTextWriter, comment: CommentRange, newLine: string) => void, node: TextRange, newLine: string, removeComments: boolean) { let leadingComments: CommentRange[]; let currentDetachedCommentInfo: {nodePos: number, detachedCommentEndPos: number}; @@ -1929,12 +2025,12 @@ namespace ts { // // var x = 10; if (node.pos === 0) { - leadingComments = filter(getLeadingCommentRanges(currentSourceFile.text, node.pos), isPinnedComment); + leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedComment); } } else { // removeComments is false, just get detached as normal and bypass the process to filter comment - leadingComments = getLeadingCommentRanges(currentSourceFile.text, node.pos); + leadingComments = getLeadingCommentRanges(text, node.pos); } if (leadingComments) { @@ -1943,8 +2039,8 @@ namespace ts { for (const comment of leadingComments) { if (lastComment) { - const lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - const commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This @@ -1962,12 +2058,12 @@ namespace 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. - const lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastOrUndefined(detachedComments).end); - const nodeLine = getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.pos)); + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastOrUndefined(detachedComments).end); + const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, 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: lastOrUndefined(detachedComments).end }; } } @@ -1976,25 +2072,26 @@ namespace ts { return currentDetachedCommentInfo; function isPinnedComment(comment: CommentRange) { - return currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && - currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; + return text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && + text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; } + } - export function writeCommentRange(currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { - const firstCommentLineAndCharacter = getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - const lineCount = getLineStarts(currentSourceFile).length; + export function writeCommentRange(text: string, lineMap: number[], writer: EmitTextWriter, comment: CommentRange, newLine: string) { + if (text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { + const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, comment.pos); + const lineCount = lineMap.length; let firstCommentLineIndent: number; for (let pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { const 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 @@ -2014,7 +2111,7 @@ namespace ts { // More right indented comment */ --4 = 8 - 4 + 11 // class c { } // } - const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); if (spacesToEmit > 0) { let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); @@ -2035,47 +2132,47 @@ namespace 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)); + writer.write(text.substring(comment.pos, comment.end)); } + } - function writeTrimmedCurrentLine(pos: number, nextLineStart: number) { - const end = Math.min(comment.end, nextLineStart - 1); - const 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(); - } + function writeTrimmedCurrentLine(text: string, comment: CommentRange, writer: EmitTextWriter, newLine: string, pos: number, nextLineStart: number) { + const end = Math.min(comment.end, nextLineStart - 1); + const 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: string, pos: number, end: number) { + let currentLineIndent = 0; + for (; pos < end && isWhiteSpace(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === CharacterCodes.tab) { + // Tabs = TabSize = indent size and go to next tabStop + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); } else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); + // Single space + currentLineIndent++; } } - function calculateIndent(pos: number, end: number) { - let currentLineIndent = 0; - for (; pos < end && isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === CharacterCodes.tab) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - - return currentLineIndent; - } + return currentLineIndent; } export function modifierToFlag(token: SyntaxKind): NodeFlags { @@ -2175,12 +2272,12 @@ 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 hasJavaScriptFileExtension(fileName: string) { + return fileExtensionIs(fileName, ".js") || fileExtensionIs(fileName, ".jsx"); } - export function isTsx(fileName: string) { - return fileExtensionIs(fileName, ".tsx"); + export function allowsJsxExpressions(fileName: string) { + return fileExtensionIs(fileName, ".tsx") || fileExtensionIs(fileName, ".jsx"); } /** diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index bf8b9493829..1c8593a9e12 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -223,10 +223,22 @@ namespace FourSlash { // 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 +292,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, compilationOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions); }); // Check if no-default-lib flag is false and if so add default library @@ -2257,15 +2269,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, assertionMessage("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, assertionMessage("completion item detail text for " + name)); } } if (kind !== undefined) { - assert.equal(item.kind, kind, assertionMessage("completion item kind")); + assert.equal(item.kind, kind, assertionMessage("completion item kind for " + name)); } return; diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 934b7a0a36b..16c3b2d3488 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1169,7 +1169,7 @@ namespace Harness { } else if (isTS(file.unitName)) { const declFile = findResultCodeFile(file.unitName); - if (!findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { + if (declFile && !findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); } } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 50dbef5a410..faf0ad28eb5 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -197,7 +197,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 diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 88bcfa7ddcc..f48822f1220 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -306,7 +306,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"; @@ -346,7 +349,7 @@ class ProjectRunner extends RunnerBase { const inputFiles = ts.map(ts.filter(compilerResult.program.getSourceFiles(), sourceFile => sourceFile.fileName !== "lib.d.ts"), sourceFile => { - return { unitName: sourceFile.fileName, content: sourceFile.text }; + return { unitName: RunnerBase.removeFullPaths(sourceFile.fileName), content: sourceFile.text }; }); return Harness.Compiler.getErrorBaseline(inputFiles, compilerResult.errors); @@ -387,7 +390,7 @@ class ProjectRunner extends RunnerBase { return resolutionInfo; } - it(name + ": " + moduleNameToString(moduleKind) , () => { + it(name + ": " + moduleNameToString(moduleKind), () => { // Compile using node compilerResult = batchCompilerProjectTestCase(moduleKind); }); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 6543dc67af0..333cea2745d 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); } @@ -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); } } @@ -1316,7 +1321,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/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/services.ts b/src/services/services.ts index 1672e4ad4ff..d1c87d17239 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -174,7 +174,7 @@ namespace ts { let jsDocCompletionEntries: CompletionEntry[]; function createNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags, parent?: Node): NodeObject { - let node = new (getNodeConstructor(kind))(pos, end); + let node = new NodeObject(kind, pos, end); node.flags = flags; node.parent = parent; return node; @@ -188,6 +188,14 @@ namespace ts { public parent: Node; private _children: Node[]; + constructor(kind: SyntaxKind, pos: number, end: number) { + this.kind = kind; + this.pos = pos; + this.end = end; + this.flags = NodeFlags.None; + this.parent = undefined; + } + public getSourceFile(): SourceFile { return getSourceFileOfNode(this); } @@ -793,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; @@ -805,6 +814,10 @@ namespace ts { public imports: LiteralExpression[]; private namedDeclarations: Map; + constructor(kind: SyntaxKind, pos: number, end: number) { + super(kind, pos, end) + } + public update(newText: string, textChangeRange: TextChangeRange): SourceFile { return updateSourceFile(this, newText, textChangeRange); } @@ -1599,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 { @@ -1620,6 +1636,9 @@ namespace ts { typeAliasName = 16, parameterName = 17, docCommentTagName = 18, + jsxOpenTagName = 19, + jsxCloseTagName = 20, + jsxSelfClosingTagName = 21, } /// Language Service @@ -2112,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[]; @@ -2150,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" @@ -2164,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 }; @@ -2739,8 +2847,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 { @@ -2803,7 +2914,7 @@ namespace 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 (isJavaScript(fileName)) { + if (isSourceFileJavaScript(targetSourceFile)) { return getJavaScriptSemanticDiagnostics(targetSourceFile); } @@ -3042,7 +3153,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; @@ -3814,7 +3925,10 @@ namespace ts { let existingName: string; if (m.kind === SyntaxKind.BindingElement && (m).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 @@ -3863,22 +3977,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 @@ -3888,26 +4005,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); } } } @@ -3951,26 +4065,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; } } @@ -6607,6 +6719,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; } } @@ -6919,6 +7034,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; } } @@ -7970,18 +8102,8 @@ namespace ts { function initializeServices() { objectAllocator = { - getNodeConstructor: kind => { - function Node(pos: number, end: number) { - this.pos = pos; - this.end = end; - this.flags = NodeFlags.None; - this.parent = undefined; - } - let proto = kind === SyntaxKind.SourceFile ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - Node.prototype = proto; - return Node; - }, + getNodeConstructor: () => NodeObject, + getSourceFileConstructor: () => SourceFileObject, getSymbolConstructor: () => SymbolObject, getTypeConstructor: () => TypeObject, getSignatureConstructor: () => SignatureObject, diff --git a/src/services/shims.ts b/src/services/shims.ts index 8482cb50975..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: [], @@ -1032,7 +1033,7 @@ namespace ts { public createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim { try { if (this.documentRegistry === undefined) { - this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var hostAdapter = new LanguageServiceShimHostAdapter(host); var languageService = createLanguageService(hostAdapter, this.documentRegistry); @@ -1068,7 +1069,7 @@ namespace ts { public close(): void { // Forget all the registered shims this._shims = []; - this.documentRegistry = createDocumentRegistry(); + this.documentRegistry = undefined; } public registerShim(shim: Shim): void { 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/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/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/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/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/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 72ac4c816f9..0aa8207ff98 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -4,6 +4,7 @@ tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; on Types of property 'oneI' are incompatible. Type 'this' is not assignable to type 'I'. Type 'C' is not assignable to type 'I'. + Property 'alsoWorks' is missing in type 'C'. tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: this; }' nor type 'R' is assignable to the other. Property 'anything' is missing in type '{ oneI: this; }'. @@ -38,6 +39,7 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: this; !!! error TS2322: Types of property 'oneI' are incompatible. !!! error TS2322: Type 'this' is not assignable to type 'I'. !!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Property 'alsoWorks' is missing in type 'C'. } worksToo():R { 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/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/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/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/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/narrowTypeByInstanceof.types b/tests/baselines/reference/narrowTypeByInstanceof.types index e6a3466b88f..8bc13d12ca1 100644 --- a/tests/baselines/reference/narrowTypeByInstanceof.types +++ b/tests/baselines/reference/narrowTypeByInstanceof.types @@ -63,7 +63,7 @@ if (elementA instanceof FileMatch && elementB instanceof FileMatch) { } else if (elementA instanceof Match && elementB instanceof Match) { >elementA instanceof Match && elementB instanceof Match : boolean >elementA instanceof Match : boolean ->elementA : FileMatch | Match +>elementA : Match | FileMatch >Match : typeof Match >elementB instanceof Match : boolean >elementB : FileMatch | Match 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/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/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..2f0cd8e1230 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..2f0cd8e1230 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -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..24fb56c1fd2 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..24fb56c1fd2 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json index 6432d5ae91e..4869993ca92 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..4869993ca92 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -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/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..742acdc7a25 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..742acdc7a25 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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/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..21d6e50f28a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..21d6e50f28a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..f3b0bdd119e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..f3b0bdd119e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -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..0d6c009961b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..0d6c009961b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json index f3c86f22eb7..283c0703f90 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..283c0703f90 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -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/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..b4efe9ebb39 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..b4efe9ebb39 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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/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..51ad7ddf1b2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..51ad7ddf1b2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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/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.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..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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.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/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..b65b2477c8e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..b65b2477c8e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..9b7785a024b 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..9b7785a024b 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json index e061982b32f..2ff88c9696f 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..2ff88c9696f 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -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/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..1dbc9780b95 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..1dbc9780b95 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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/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..b33bd42f045 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..b33bd42f045 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..2de7a33388a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..2de7a33388a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..8d29a569320 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..8d29a569320 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json index 3ecf4bc4cc4..ae51d051ff0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..ae51d051ff0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -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/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..d8ff0027520 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..d8ff0027520 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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/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..cd7c4867bc3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..cd7c4867bc3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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.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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..ef77af7372e --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt index dfbdd679685..cde83785831 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt @@ -2,11 +2,11 @@ error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/Fo !!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. -==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== +==== fileC.ts (0 errors) ==== class C { } -==== FolderA/FolderB/fileB.ts (0 errors) ==== +==== fileB.ts (0 errors) ==== /// class B { public c: C; diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt index dfbdd679685..cde83785831 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt @@ -2,11 +2,11 @@ error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/Fo !!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files. -==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== +==== fileC.ts (0 errors) ==== class C { } -==== FolderA/FolderB/fileB.ts (0 errors) ==== +==== fileB.ts (0 errors) ==== /// class B { public c: C; 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..1772111176c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..1772111176c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -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..8d7c349b481 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..8d7c349b481 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json index b3e80123c04..722a6fbd4da 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..722a6fbd4da 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -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/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..f9e2736f65a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..f9e2736f65a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -16,12 +16,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/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/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..50dc5aaf60f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..50dc5aaf60f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -16,12 +16,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/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/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..2dcfc8a5a2c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..2dcfc8a5a2c 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -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..4247e9dadc2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..4247e9dadc2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json index 69a577baffd..77179246af5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..77179246af5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -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/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..8213a1478ae 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..8213a1478ae 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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/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..a5966ef08b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..a5966ef08b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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.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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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..7316c8b01c9 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..7316c8b01c9 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -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..e165908b72c 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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..ea1bbf2ba6b --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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..e165908b72c 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -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/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.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json index cc2a6c9b1aa..27485e45ad9 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -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..247f9e4f2f2 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..27485e45ad9 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -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/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..4d92e8a8951 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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..12592331fb5 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..4d92e8a8951 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -15,12 +15,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/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/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..e1f6d3c6e36 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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..42154149020 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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..e1f6d3c6e36 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -15,12 +15,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/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/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53a35eb2c84 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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; + } +==== 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/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..53fc18f86c7 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..eb358c3b79d --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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.errors.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.errors.txt new file mode 100644 index 00000000000..376cfa761b8 --- /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 --outFile. + + +!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +==== 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/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/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/thisTypeAndConstraints.js b/tests/baselines/reference/thisTypeAndConstraints.js new file mode 100644 index 00000000000..d62ebe6917c --- /dev/null +++ b/tests/baselines/reference/thisTypeAndConstraints.js @@ -0,0 +1,50 @@ +//// [thisTypeAndConstraints.ts] +class A { + self() { + return this; + } +} + +function f(x: T) { + function g(x: U) { + x = x.self(); + } + x = x.self(); +} + +class B { + foo(x: T) { + x = x.self(); + } + bar(x: U) { + x = x.self(); + } +} + + +//// [thisTypeAndConstraints.js] +var A = (function () { + function A() { + } + A.prototype.self = function () { + return this; + }; + return A; +})(); +function f(x) { + function g(x) { + x = x.self(); + } + x = x.self(); +} +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + x = x.self(); + }; + B.prototype.bar = function (x) { + x = x.self(); + }; + return B; +})(); diff --git a/tests/baselines/reference/thisTypeAndConstraints.symbols b/tests/baselines/reference/thisTypeAndConstraints.symbols new file mode 100644 index 00000000000..5f93df22c1a --- /dev/null +++ b/tests/baselines/reference/thisTypeAndConstraints.symbols @@ -0,0 +1,70 @@ +=== tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts === +class A { +>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0)) + + self() { +>self : Symbol(self, Decl(thisTypeAndConstraints.ts, 0, 9)) + + return this; +>this : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0)) + } +} + +function f(x: T) { +>f : Symbol(f, Decl(thisTypeAndConstraints.ts, 4, 1)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11)) +>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11)) + + function g(x: U) { +>g : Symbol(g, Decl(thisTypeAndConstraints.ts, 6, 31)) +>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 7, 15)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28)) +>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 7, 15)) + + x = x.self(); +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28)) +>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28)) +>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) + } + x = x.self(); +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24)) +>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24)) +>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) +} + +class B { +>B : Symbol(B, Decl(thisTypeAndConstraints.ts, 11, 1)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8)) +>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0)) + + foo(x: T) { +>foo : Symbol(foo, Decl(thisTypeAndConstraints.ts, 13, 22)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8)) + + x = x.self(); +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8)) +>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8)) +>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) + } + bar(x: U) { +>bar : Symbol(bar, Decl(thisTypeAndConstraints.ts, 16, 5)) +>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 17, 8)) +>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21)) +>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 17, 8)) + + x = x.self(); +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21)) +>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) +>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21)) +>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9)) + } +} + diff --git a/tests/baselines/reference/thisTypeAndConstraints.types b/tests/baselines/reference/thisTypeAndConstraints.types new file mode 100644 index 00000000000..af7a06e83cf --- /dev/null +++ b/tests/baselines/reference/thisTypeAndConstraints.types @@ -0,0 +1,78 @@ +=== tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts === +class A { +>A : A + + self() { +>self : () => this + + return this; +>this : this + } +} + +function f(x: T) { +>f : (x: T) => void +>T : T +>A : A +>x : T +>T : T + + function g(x: U) { +>g : (x: U) => void +>U : U +>T : T +>x : U +>U : U + + x = x.self(); +>x = x.self() : U +>x : U +>x.self() : U +>x.self : () => U +>x : U +>self : () => U + } + x = x.self(); +>x = x.self() : T +>x : T +>x.self() : T +>x.self : () => T +>x : T +>self : () => T +} + +class B { +>B : B +>T : T +>A : A + + foo(x: T) { +>foo : (x: T) => void +>x : T +>T : T + + x = x.self(); +>x = x.self() : T +>x : T +>x.self() : T +>x.self : () => T +>x : T +>self : () => T + } + bar(x: U) { +>bar : (x: U) => void +>U : U +>T : T +>x : U +>U : U + + x = x.self(); +>x = x.self() : U +>x : U +>x.self() : U +>x.self : () => U +>x : U +>self : () => U + } +} + diff --git a/tests/baselines/reference/thisTypeInClasses.errors.txt b/tests/baselines/reference/thisTypeInClasses.errors.txt deleted file mode 100644 index db2ae1b5793..00000000000 --- a/tests/baselines/reference/thisTypeInClasses.errors.txt +++ /dev/null @@ -1,57 +0,0 @@ -tests/cases/conformance/types/thisType/thisTypeInClasses.ts(4,20): error TS2526: A 'this' type is available only in a non-static member of a class or interface. - - -==== tests/cases/conformance/types/thisType/thisTypeInClasses.ts (1 errors) ==== - class C1 { - x: this; - f(x: this): this { return undefined; } - constructor(x: this) { } - ~~~~ -!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface. - } - - class C2 { - [x: string]: this; - } - - interface Foo { - x: T; - y: this; - } - - 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 { - x: this; - f(x: this): this; - } - - class C5 { - foo() { - let f1 = (x: this): this => this; - let f2 = (x: this) => this; - let f3 = (x: this) => (y: this) => this; - let f4 = (x: this) => { - let g = (y: this) => { - return () => this; - } - return g(this); - } - } - bar() { - let x1 = undefined; - let x2 = undefined as this; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/thisTypeInClasses.js b/tests/baselines/reference/thisTypeInClasses.js index 93344fa62cb..52ad452aa56 100644 --- a/tests/baselines/reference/thisTypeInClasses.js +++ b/tests/baselines/reference/thisTypeInClasses.js @@ -2,7 +2,6 @@ class C1 { x: this; f(x: this): this { return undefined; } - constructor(x: this) { } } class C2 { @@ -53,7 +52,7 @@ class C5 { //// [thisTypeInClasses.js] var C1 = (function () { - function C1(x) { + function C1() { } C1.prototype.f = function (x) { return undefined; }; return C1; diff --git a/tests/baselines/reference/thisTypeInClasses.symbols b/tests/baselines/reference/thisTypeInClasses.symbols index 04ed47b09ff..0915d6e5e6b 100644 --- a/tests/baselines/reference/thisTypeInClasses.symbols +++ b/tests/baselines/reference/thisTypeInClasses.symbols @@ -9,131 +9,128 @@ class C1 { >f : Symbol(f, Decl(thisTypeInClasses.ts, 1, 12)) >x : Symbol(x, Decl(thisTypeInClasses.ts, 2, 6)) >undefined : Symbol(undefined) - - constructor(x: this) { } ->x : Symbol(x, Decl(thisTypeInClasses.ts, 3, 16)) } class C2 { ->C2 : Symbol(C2, Decl(thisTypeInClasses.ts, 4, 1)) +>C2 : Symbol(C2, Decl(thisTypeInClasses.ts, 3, 1)) [x: string]: this; ->x : Symbol(x, Decl(thisTypeInClasses.ts, 7, 5)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 6, 5)) } interface Foo { ->Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 8, 1)) ->T : Symbol(T, Decl(thisTypeInClasses.ts, 10, 14)) +>Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 7, 1)) +>T : Symbol(T, Decl(thisTypeInClasses.ts, 9, 14)) x: T; ->x : Symbol(x, Decl(thisTypeInClasses.ts, 10, 18)) ->T : Symbol(T, Decl(thisTypeInClasses.ts, 10, 14)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 9, 18)) +>T : Symbol(T, Decl(thisTypeInClasses.ts, 9, 14)) y: this; ->y : Symbol(y, Decl(thisTypeInClasses.ts, 11, 9)) +>y : Symbol(y, Decl(thisTypeInClasses.ts, 10, 9)) } class C3 { ->C3 : Symbol(C3, Decl(thisTypeInClasses.ts, 13, 1)) +>C3 : Symbol(C3, Decl(thisTypeInClasses.ts, 12, 1)) a: this[]; ->a : Symbol(a, Decl(thisTypeInClasses.ts, 15, 10)) +>a : Symbol(a, Decl(thisTypeInClasses.ts, 14, 10)) b: [this, this]; ->b : Symbol(b, Decl(thisTypeInClasses.ts, 16, 14)) +>b : Symbol(b, Decl(thisTypeInClasses.ts, 15, 14)) c: this | Date; ->c : Symbol(c, Decl(thisTypeInClasses.ts, 17, 20)) +>c : Symbol(c, Decl(thisTypeInClasses.ts, 16, 20)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d: this & Date; ->d : Symbol(d, Decl(thisTypeInClasses.ts, 18, 19)) +>d : Symbol(d, Decl(thisTypeInClasses.ts, 17, 19)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) e: (((this))); ->e : Symbol(e, Decl(thisTypeInClasses.ts, 19, 19)) +>e : Symbol(e, Decl(thisTypeInClasses.ts, 18, 19)) f: (x: this) => this; ->f : Symbol(f, Decl(thisTypeInClasses.ts, 20, 18)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 21, 8)) +>f : Symbol(f, Decl(thisTypeInClasses.ts, 19, 18)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 20, 8)) g: new (x: this) => this; ->g : Symbol(g, Decl(thisTypeInClasses.ts, 21, 25)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 22, 12)) +>g : Symbol(g, Decl(thisTypeInClasses.ts, 20, 25)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 21, 12)) h: Foo; ->h : Symbol(h, Decl(thisTypeInClasses.ts, 22, 29)) ->Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 8, 1)) +>h : Symbol(h, Decl(thisTypeInClasses.ts, 21, 29)) +>Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 7, 1)) i: Foo this)>; ->i : Symbol(i, Decl(thisTypeInClasses.ts, 23, 17)) ->Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 8, 1)) +>i : Symbol(i, Decl(thisTypeInClasses.ts, 22, 17)) +>Foo : Symbol(Foo, Decl(thisTypeInClasses.ts, 7, 1)) j: (x: any) => x is this; ->j : Symbol(j, Decl(thisTypeInClasses.ts, 24, 32)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 25, 8)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 25, 8)) +>j : Symbol(j, Decl(thisTypeInClasses.ts, 23, 32)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 24, 8)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 24, 8)) } declare class C4 { ->C4 : Symbol(C4, Decl(thisTypeInClasses.ts, 26, 1)) +>C4 : Symbol(C4, Decl(thisTypeInClasses.ts, 25, 1)) x: this; ->x : Symbol(x, Decl(thisTypeInClasses.ts, 28, 18)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 27, 18)) f(x: this): this; ->f : Symbol(f, Decl(thisTypeInClasses.ts, 29, 12)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 30, 6)) +>f : Symbol(f, Decl(thisTypeInClasses.ts, 28, 12)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 29, 6)) } class C5 { ->C5 : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>C5 : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) foo() { ->foo : Symbol(foo, Decl(thisTypeInClasses.ts, 33, 10)) +>foo : Symbol(foo, Decl(thisTypeInClasses.ts, 32, 10)) let f1 = (x: this): this => this; ->f1 : Symbol(f1, Decl(thisTypeInClasses.ts, 35, 11)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 35, 18)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>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; ->f2 : Symbol(f2, Decl(thisTypeInClasses.ts, 36, 11)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 36, 18)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>f2 : Symbol(f2, Decl(thisTypeInClasses.ts, 35, 11)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 35, 18)) +>this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) let f3 = (x: this) => (y: this) => this; ->f3 : Symbol(f3, Decl(thisTypeInClasses.ts, 37, 11)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 37, 18)) ->y : Symbol(y, Decl(thisTypeInClasses.ts, 37, 31)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>f3 : Symbol(f3, Decl(thisTypeInClasses.ts, 36, 11)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 36, 18)) +>y : Symbol(y, Decl(thisTypeInClasses.ts, 36, 31)) +>this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) let f4 = (x: this) => { ->f4 : Symbol(f4, Decl(thisTypeInClasses.ts, 38, 11)) ->x : Symbol(x, Decl(thisTypeInClasses.ts, 38, 18)) +>f4 : Symbol(f4, Decl(thisTypeInClasses.ts, 37, 11)) +>x : Symbol(x, Decl(thisTypeInClasses.ts, 37, 18)) let g = (y: this) => { ->g : Symbol(g, Decl(thisTypeInClasses.ts, 39, 15)) ->y : Symbol(y, Decl(thisTypeInClasses.ts, 39, 21)) +>g : Symbol(g, Decl(thisTypeInClasses.ts, 38, 15)) +>y : Symbol(y, Decl(thisTypeInClasses.ts, 38, 21)) return () => this; ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) } return g(this); ->g : Symbol(g, Decl(thisTypeInClasses.ts, 39, 15)) ->this : Symbol(C5, Decl(thisTypeInClasses.ts, 31, 1)) +>g : Symbol(g, Decl(thisTypeInClasses.ts, 38, 15)) +>this : Symbol(C5, Decl(thisTypeInClasses.ts, 30, 1)) } } bar() { ->bar : Symbol(bar, Decl(thisTypeInClasses.ts, 44, 5)) +>bar : Symbol(bar, Decl(thisTypeInClasses.ts, 43, 5)) let x1 = undefined; ->x1 : Symbol(x1, Decl(thisTypeInClasses.ts, 46, 11)) +>x1 : Symbol(x1, Decl(thisTypeInClasses.ts, 45, 11)) >undefined : Symbol(undefined) let x2 = undefined as this; ->x2 : Symbol(x2, Decl(thisTypeInClasses.ts, 47, 11)) +>x2 : Symbol(x2, Decl(thisTypeInClasses.ts, 46, 11)) >undefined : Symbol(undefined) } } diff --git a/tests/baselines/reference/thisTypeInClasses.types b/tests/baselines/reference/thisTypeInClasses.types index ddfdfb277a9..512359decd9 100644 --- a/tests/baselines/reference/thisTypeInClasses.types +++ b/tests/baselines/reference/thisTypeInClasses.types @@ -9,9 +9,6 @@ class C1 { >f : (x: this) => this >x : this >undefined : undefined - - constructor(x: this) { } ->x : this } class C2 { 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/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/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index cab04365c19..1431b4b9c60 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -14,21 +14,58 @@ class C2 { class D1 extends C1 { p3: number; } +class C3 { + p4: number; +} var str: string; var num: number; var strOrNum: string | number; -var c1Orc2: C1 | C2; -str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 -num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 -str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 -num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 +var ctor1: C1 | C2; +str = ctor1 instanceof C1 && ctor1.p1; // C1 +num = ctor1 instanceof C2 && ctor1.p2; // C2 +str = ctor1 instanceof D1 && ctor1.p1; // D1 +num = ctor1 instanceof D1 && ctor1.p3; // D1 -var c2Ord1: C2 | D1; -num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 -num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 -str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 -var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 +var ctor2: C2 | D1; +num = ctor2 instanceof C2 && ctor2.p2; // C2 +num = ctor2 instanceof D1 && ctor2.p3; // D1 +str = ctor2 instanceof D1 && ctor2.p1; // D1 +var r2: D1 | C2 = ctor2 instanceof C1 && ctor2; // C2 | D1 + +var ctor3: C1 | C2; +if (ctor3 instanceof C1) { + ctor3.p1; // C1 +} +else { + ctor3.p2; // C2 +} + +var ctor4: C1 | C2 | C3; +if (ctor4 instanceof C1) { + ctor4.p1; // C1 +} +else if (ctor4 instanceof C2) { + ctor4.p2; // C2 +} +else { + ctor4.p4; // C3 +} + +var ctor5: C1 | D1 | C2; +if (ctor5 instanceof C1) { + ctor5.p1; // C1 +} +else { + ctor5.p2; // C2 +} + +var ctor6: C1 | C2 | C3; +if (ctor6 instanceof C1 || ctor6 instanceof C2) { +} +else { + ctor6.p4; // C3 +} //// [typeGuardOfFormInstanceOf.js] // A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' @@ -58,16 +95,51 @@ var D1 = (function (_super) { } return D1; })(C1); +var C3 = (function () { + function C3() { + } + return C3; +})(); var str; var num; var strOrNum; -var c1Orc2; -str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 -num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 -str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 -num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 -var c2Ord1; -num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 -num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 -str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 -var r2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 +var ctor1; +str = ctor1 instanceof C1 && ctor1.p1; // C1 +num = ctor1 instanceof C2 && ctor1.p2; // C2 +str = ctor1 instanceof D1 && ctor1.p1; // D1 +num = ctor1 instanceof D1 && ctor1.p3; // D1 +var ctor2; +num = ctor2 instanceof C2 && ctor2.p2; // C2 +num = ctor2 instanceof D1 && ctor2.p3; // D1 +str = ctor2 instanceof D1 && ctor2.p1; // D1 +var r2 = ctor2 instanceof C1 && ctor2; // C2 | D1 +var ctor3; +if (ctor3 instanceof C1) { + ctor3.p1; // C1 +} +else { + ctor3.p2; // C2 +} +var ctor4; +if (ctor4 instanceof C1) { + ctor4.p1; // C1 +} +else if (ctor4 instanceof C2) { + ctor4.p2; // C2 +} +else { + ctor4.p4; // C3 +} +var ctor5; +if (ctor5 instanceof C1) { + ctor5.p1; // C1 +} +else { + ctor5.p2; // C2 +} +var ctor6; +if (ctor6 instanceof C1 || ctor6 instanceof C2) { +} +else { + ctor6.p4; // C3 +} diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.symbols b/tests/baselines/reference/typeGuardOfFormInstanceOf.symbols index 7a48d87e963..0dd2844f6ad 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.symbols +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.symbols @@ -24,86 +24,184 @@ class D1 extends C1 { p3: number; >p3 : Symbol(p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) } +class C3 { +>C3 : Symbol(C3, Decl(typeGuardOfFormInstanceOf.ts, 14, 1)) + + p4: number; +>p4 : Symbol(p4, Decl(typeGuardOfFormInstanceOf.ts, 15, 10)) +} var str: string; ->str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 15, 3)) +>str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 18, 3)) var num: number; ->num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 16, 3)) +>num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) var strOrNum: string | number; ->strOrNum : Symbol(strOrNum, Decl(typeGuardOfFormInstanceOf.ts, 17, 3)) +>strOrNum : Symbol(strOrNum, Decl(typeGuardOfFormInstanceOf.ts, 20, 3)) -var c1Orc2: C1 | C2; ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +var ctor1: C1 | C2; +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) >C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) -str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 ->str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 15, 3)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +str = ctor1 instanceof C1 && ctor1.p1; // C1 +>str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 18, 3)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) ->c1Orc2.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) -num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 ->num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 16, 3)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +num = ctor1 instanceof C2 && ctor1.p2; // C2 +>num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) ->c1Orc2.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) -str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 ->str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 15, 3)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +str = ctor1 instanceof D1 && ctor1.p1; // D1 +>str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 18, 3)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) ->c1Orc2.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) -num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 ->num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 16, 3)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +num = ctor1 instanceof D1 && ctor1.p3; // D1 +>num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) ->c1Orc2.p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) ->c1Orc2 : Symbol(c1Orc2, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor1.p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) +>ctor1 : Symbol(ctor1, Decl(typeGuardOfFormInstanceOf.ts, 22, 3)) >p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) -var c2Ord1: C2 | D1; ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +var ctor2: C2 | D1; +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) -num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 ->num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 16, 3)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +num = ctor2 instanceof C2 && ctor2.p2; // C2 +>num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) ->c2Ord1.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +>ctor2.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) -num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 ->num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 16, 3)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +num = ctor2 instanceof D1 && ctor2.p3; // D1 +>num : Symbol(num, Decl(typeGuardOfFormInstanceOf.ts, 19, 3)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) ->c2Ord1.p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +>ctor2.p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >p3 : Symbol(D1.p3, Decl(typeGuardOfFormInstanceOf.ts, 12, 21)) -str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 ->str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 15, 3)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +str = ctor2 instanceof D1 && ctor2.p1; // D1 +>str : Symbol(str, Decl(typeGuardOfFormInstanceOf.ts, 18, 3)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) ->c2Ord1.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +>ctor2.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) -var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 ->r2 : Symbol(r2, Decl(typeGuardOfFormInstanceOf.ts, 29, 3)) +var r2: D1 | C2 = ctor2 instanceof C1 && ctor2; // C2 | D1 +>r2 : Symbol(r2, Decl(typeGuardOfFormInstanceOf.ts, 32, 3)) >D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) >C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) >C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) ->c2Ord1 : Symbol(c2Ord1, Decl(typeGuardOfFormInstanceOf.ts, 25, 3)) +>ctor2 : Symbol(ctor2, Decl(typeGuardOfFormInstanceOf.ts, 28, 3)) +var ctor3: C1 | C2; +>ctor3 : Symbol(ctor3, Decl(typeGuardOfFormInstanceOf.ts, 34, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) + +if (ctor3 instanceof C1) { +>ctor3 : Symbol(ctor3, Decl(typeGuardOfFormInstanceOf.ts, 34, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) + + ctor3.p1; // C1 +>ctor3.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor3 : Symbol(ctor3, Decl(typeGuardOfFormInstanceOf.ts, 34, 3)) +>p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +} +else { + ctor3.p2; // C2 +>ctor3.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +>ctor3 : Symbol(ctor3, Decl(typeGuardOfFormInstanceOf.ts, 34, 3)) +>p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +} + +var ctor4: C1 | C2 | C3; +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) +>C3 : Symbol(C3, Decl(typeGuardOfFormInstanceOf.ts, 14, 1)) + +if (ctor4 instanceof C1) { +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) + + ctor4.p1; // C1 +>ctor4.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +} +else if (ctor4 instanceof C2) { +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) + + ctor4.p2; // C2 +>ctor4.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +} +else { + ctor4.p4; // C3 +>ctor4.p4 : Symbol(C3.p4, Decl(typeGuardOfFormInstanceOf.ts, 15, 10)) +>ctor4 : Symbol(ctor4, Decl(typeGuardOfFormInstanceOf.ts, 42, 3)) +>p4 : Symbol(C3.p4, Decl(typeGuardOfFormInstanceOf.ts, 15, 10)) +} + +var ctor5: C1 | D1 | C2; +>ctor5 : Symbol(ctor5, Decl(typeGuardOfFormInstanceOf.ts, 53, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) +>D1 : Symbol(D1, Decl(typeGuardOfFormInstanceOf.ts, 11, 1)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) + +if (ctor5 instanceof C1) { +>ctor5 : Symbol(ctor5, Decl(typeGuardOfFormInstanceOf.ts, 53, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) + + ctor5.p1; // C1 +>ctor5.p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +>ctor5 : Symbol(ctor5, Decl(typeGuardOfFormInstanceOf.ts, 53, 3)) +>p1 : Symbol(C1.p1, Decl(typeGuardOfFormInstanceOf.ts, 6, 10)) +} +else { + ctor5.p2; // C2 +>ctor5.p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +>ctor5 : Symbol(ctor5, Decl(typeGuardOfFormInstanceOf.ts, 53, 3)) +>p2 : Symbol(C2.p2, Decl(typeGuardOfFormInstanceOf.ts, 9, 10)) +} + +var ctor6: C1 | C2 | C3; +>ctor6 : Symbol(ctor6, Decl(typeGuardOfFormInstanceOf.ts, 61, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) +>C3 : Symbol(C3, Decl(typeGuardOfFormInstanceOf.ts, 14, 1)) + +if (ctor6 instanceof C1 || ctor6 instanceof C2) { +>ctor6 : Symbol(ctor6, Decl(typeGuardOfFormInstanceOf.ts, 61, 3)) +>C1 : Symbol(C1, Decl(typeGuardOfFormInstanceOf.ts, 0, 0)) +>ctor6 : Symbol(ctor6, Decl(typeGuardOfFormInstanceOf.ts, 61, 3)) +>C2 : Symbol(C2, Decl(typeGuardOfFormInstanceOf.ts, 8, 1)) +} +else { + ctor6.p4; // C3 +>ctor6.p4 : Symbol(C3.p4, Decl(typeGuardOfFormInstanceOf.ts, 15, 10)) +>ctor6 : Symbol(ctor6, Decl(typeGuardOfFormInstanceOf.ts, 61, 3)) +>p4 : Symbol(C3.p4, Decl(typeGuardOfFormInstanceOf.ts, 15, 10)) +} diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.types b/tests/baselines/reference/typeGuardOfFormInstanceOf.types index c824e907733..6b83b57dcb5 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.types +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.types @@ -24,6 +24,12 @@ class D1 extends C1 { p3: number; >p3 : number } +class C3 { +>C3 : C3 + + p4: number; +>p4 : number +} var str: string; >str : string @@ -33,100 +39,199 @@ var num: number; var strOrNum: string | number; >strOrNum : string | number -var c1Orc2: C1 | C2; ->c1Orc2 : C1 | C2 +var ctor1: C1 | C2; +>ctor1 : C1 | C2 >C1 : C1 >C2 : C2 -str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 ->str = c1Orc2 instanceof C1 && c1Orc2.p1 : string +str = ctor1 instanceof C1 && ctor1.p1; // C1 +>str = ctor1 instanceof C1 && ctor1.p1 : string >str : string ->c1Orc2 instanceof C1 && c1Orc2.p1 : string ->c1Orc2 instanceof C1 : boolean ->c1Orc2 : C1 | C2 +>ctor1 instanceof C1 && ctor1.p1 : string +>ctor1 instanceof C1 : boolean +>ctor1 : C1 | C2 >C1 : typeof C1 ->c1Orc2.p1 : string ->c1Orc2 : C1 +>ctor1.p1 : string +>ctor1 : C1 >p1 : string -num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 ->num = c1Orc2 instanceof C2 && c1Orc2.p2 : number +num = ctor1 instanceof C2 && ctor1.p2; // C2 +>num = ctor1 instanceof C2 && ctor1.p2 : number >num : number ->c1Orc2 instanceof C2 && c1Orc2.p2 : number ->c1Orc2 instanceof C2 : boolean ->c1Orc2 : C1 | C2 +>ctor1 instanceof C2 && ctor1.p2 : number +>ctor1 instanceof C2 : boolean +>ctor1 : C1 | C2 >C2 : typeof C2 ->c1Orc2.p2 : number ->c1Orc2 : C2 +>ctor1.p2 : number +>ctor1 : C2 >p2 : number -str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 ->str = c1Orc2 instanceof D1 && c1Orc2.p1 : string +str = ctor1 instanceof D1 && ctor1.p1; // D1 +>str = ctor1 instanceof D1 && ctor1.p1 : string >str : string ->c1Orc2 instanceof D1 && c1Orc2.p1 : string ->c1Orc2 instanceof D1 : boolean ->c1Orc2 : C1 | C2 +>ctor1 instanceof D1 && ctor1.p1 : string +>ctor1 instanceof D1 : boolean +>ctor1 : C1 | C2 >D1 : typeof D1 ->c1Orc2.p1 : string ->c1Orc2 : D1 +>ctor1.p1 : string +>ctor1 : D1 >p1 : string -num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 ->num = c1Orc2 instanceof D1 && c1Orc2.p3 : number +num = ctor1 instanceof D1 && ctor1.p3; // D1 +>num = ctor1 instanceof D1 && ctor1.p3 : number >num : number ->c1Orc2 instanceof D1 && c1Orc2.p3 : number ->c1Orc2 instanceof D1 : boolean ->c1Orc2 : C1 | C2 +>ctor1 instanceof D1 && ctor1.p3 : number +>ctor1 instanceof D1 : boolean +>ctor1 : C1 | C2 >D1 : typeof D1 ->c1Orc2.p3 : number ->c1Orc2 : D1 +>ctor1.p3 : number +>ctor1 : D1 >p3 : number -var c2Ord1: C2 | D1; ->c2Ord1 : C2 | D1 +var ctor2: C2 | D1; +>ctor2 : C2 | D1 >C2 : C2 >D1 : D1 -num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 ->num = c2Ord1 instanceof C2 && c2Ord1.p2 : number +num = ctor2 instanceof C2 && ctor2.p2; // C2 +>num = ctor2 instanceof C2 && ctor2.p2 : number >num : number ->c2Ord1 instanceof C2 && c2Ord1.p2 : number ->c2Ord1 instanceof C2 : boolean ->c2Ord1 : C2 | D1 +>ctor2 instanceof C2 && ctor2.p2 : number +>ctor2 instanceof C2 : boolean +>ctor2 : C2 | D1 >C2 : typeof C2 ->c2Ord1.p2 : number ->c2Ord1 : C2 +>ctor2.p2 : number +>ctor2 : C2 >p2 : number -num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 ->num = c2Ord1 instanceof D1 && c2Ord1.p3 : number +num = ctor2 instanceof D1 && ctor2.p3; // D1 +>num = ctor2 instanceof D1 && ctor2.p3 : number >num : number ->c2Ord1 instanceof D1 && c2Ord1.p3 : number ->c2Ord1 instanceof D1 : boolean ->c2Ord1 : C2 | D1 +>ctor2 instanceof D1 && ctor2.p3 : number +>ctor2 instanceof D1 : boolean +>ctor2 : C2 | D1 >D1 : typeof D1 ->c2Ord1.p3 : number ->c2Ord1 : D1 +>ctor2.p3 : number +>ctor2 : D1 >p3 : number -str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 ->str = c2Ord1 instanceof D1 && c2Ord1.p1 : string +str = ctor2 instanceof D1 && ctor2.p1; // D1 +>str = ctor2 instanceof D1 && ctor2.p1 : string >str : string ->c2Ord1 instanceof D1 && c2Ord1.p1 : string ->c2Ord1 instanceof D1 : boolean ->c2Ord1 : C2 | D1 +>ctor2 instanceof D1 && ctor2.p1 : string +>ctor2 instanceof D1 : boolean +>ctor2 : C2 | D1 >D1 : typeof D1 ->c2Ord1.p1 : string ->c2Ord1 : D1 +>ctor2.p1 : string +>ctor2 : D1 >p1 : string -var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 +var r2: D1 | C2 = ctor2 instanceof C1 && ctor2; // C2 | D1 >r2 : D1 | C2 >D1 : D1 >C2 : C2 ->c2Ord1 instanceof C1 && c2Ord1 : D1 ->c2Ord1 instanceof C1 : boolean ->c2Ord1 : C2 | D1 +>ctor2 instanceof C1 && ctor2 : D1 +>ctor2 instanceof C1 : boolean +>ctor2 : C2 | D1 >C1 : typeof C1 ->c2Ord1 : D1 +>ctor2 : D1 +var ctor3: C1 | C2; +>ctor3 : C1 | C2 +>C1 : C1 +>C2 : C2 + +if (ctor3 instanceof C1) { +>ctor3 instanceof C1 : boolean +>ctor3 : C1 | C2 +>C1 : typeof C1 + + ctor3.p1; // C1 +>ctor3.p1 : string +>ctor3 : C1 +>p1 : string +} +else { + ctor3.p2; // C2 +>ctor3.p2 : number +>ctor3 : C2 +>p2 : number +} + +var ctor4: C1 | C2 | C3; +>ctor4 : C1 | C2 | C3 +>C1 : C1 +>C2 : C2 +>C3 : C3 + +if (ctor4 instanceof C1) { +>ctor4 instanceof C1 : boolean +>ctor4 : C1 | C2 | C3 +>C1 : typeof C1 + + ctor4.p1; // C1 +>ctor4.p1 : string +>ctor4 : C1 +>p1 : string +} +else if (ctor4 instanceof C2) { +>ctor4 instanceof C2 : boolean +>ctor4 : C2 | C3 +>C2 : typeof C2 + + ctor4.p2; // C2 +>ctor4.p2 : number +>ctor4 : C2 +>p2 : number +} +else { + ctor4.p4; // C3 +>ctor4.p4 : number +>ctor4 : C3 +>p4 : number +} + +var ctor5: C1 | D1 | C2; +>ctor5 : C1 | D1 | C2 +>C1 : C1 +>D1 : D1 +>C2 : C2 + +if (ctor5 instanceof C1) { +>ctor5 instanceof C1 : boolean +>ctor5 : C1 | D1 | C2 +>C1 : typeof C1 + + ctor5.p1; // C1 +>ctor5.p1 : string +>ctor5 : C1 +>p1 : string +} +else { + ctor5.p2; // C2 +>ctor5.p2 : number +>ctor5 : C2 +>p2 : number +} + +var ctor6: C1 | C2 | C3; +>ctor6 : C1 | C2 | C3 +>C1 : C1 +>C2 : C2 +>C3 : C3 + +if (ctor6 instanceof C1 || ctor6 instanceof C2) { +>ctor6 instanceof C1 || ctor6 instanceof C2 : boolean +>ctor6 instanceof C1 : boolean +>ctor6 : C1 | C2 | C3 +>C1 : typeof C1 +>ctor6 instanceof C2 : boolean +>ctor6 : C2 | C3 +>C2 : typeof C2 +} +else { + ctor6.p4; // C3 +>ctor6.p4 : number +>ctor6 : C3 +>p4 : number +} 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/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/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/unionTypeCallSignatures4.errors.txt b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt new file mode 100644 index 00000000000..585906a6b5a --- /dev/null +++ b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(10,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(20,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(23,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/types/union/unionTypeCallSignatures4.ts (4 errors) ==== + type F1 = (a: string, b?: string) => void; + type F2 = (a: string, b?: string, c?: string) => void; + type F3 = (a: string, ...rest: string[]) => void; + type F4 = (a: string, b?: string, ...rest: string[]) => void; + type F5 = (a: string, b: string) => void; + + var f12: F1 | F2; + f12("a"); + f12("a", "b"); + f12("a", "b", "c"); // error + ~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + var f34: F3 | F4; + f34("a"); + f34("a", "b"); + f34("a", "b", "c"); + + var f1234: F1 | F2 | F3 | F4; + f1234("a"); + f1234("a", "b"); + f1234("a", "b", "c"); // error + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + var f12345: F1 | F2 | F3 | F4 | F5; + f12345("a"); // error + ~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + f12345("a", "b"); + f12345("a", "b", "c"); // error + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures4.js b/tests/baselines/reference/unionTypeCallSignatures4.js new file mode 100644 index 00000000000..be9a45b33c9 --- /dev/null +++ b/tests/baselines/reference/unionTypeCallSignatures4.js @@ -0,0 +1,45 @@ +//// [unionTypeCallSignatures4.ts] +type F1 = (a: string, b?: string) => void; +type F2 = (a: string, b?: string, c?: string) => void; +type F3 = (a: string, ...rest: string[]) => void; +type F4 = (a: string, b?: string, ...rest: string[]) => void; +type F5 = (a: string, b: string) => void; + +var f12: F1 | F2; +f12("a"); +f12("a", "b"); +f12("a", "b", "c"); // error + +var f34: F3 | F4; +f34("a"); +f34("a", "b"); +f34("a", "b", "c"); + +var f1234: F1 | F2 | F3 | F4; +f1234("a"); +f1234("a", "b"); +f1234("a", "b", "c"); // error + +var f12345: F1 | F2 | F3 | F4 | F5; +f12345("a"); // error +f12345("a", "b"); +f12345("a", "b", "c"); // error + + +//// [unionTypeCallSignatures4.js] +var f12; +f12("a"); +f12("a", "b"); +f12("a", "b", "c"); // error +var f34; +f34("a"); +f34("a", "b"); +f34("a", "b", "c"); +var f1234; +f1234("a"); +f1234("a", "b"); +f1234("a", "b", "c"); // error +var f12345; +f12345("a"); // error +f12345("a", "b"); +f12345("a", "b", "c"); // error 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/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/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/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/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/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/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/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/typeGuardOfFormInstanceOf.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts index 233909f44aa..31514fca749 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts @@ -13,18 +13,55 @@ class C2 { class D1 extends C1 { p3: number; } +class C3 { + p4: number; +} var str: string; var num: number; var strOrNum: string | number; -var c1Orc2: C1 | C2; -str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 -num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 -str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 -num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 +var ctor1: C1 | C2; +str = ctor1 instanceof C1 && ctor1.p1; // C1 +num = ctor1 instanceof C2 && ctor1.p2; // C2 +str = ctor1 instanceof D1 && ctor1.p1; // D1 +num = ctor1 instanceof D1 && ctor1.p3; // D1 + +var ctor2: C2 | D1; +num = ctor2 instanceof C2 && ctor2.p2; // C2 +num = ctor2 instanceof D1 && ctor2.p3; // D1 +str = ctor2 instanceof D1 && ctor2.p1; // D1 +var r2: D1 | C2 = ctor2 instanceof C1 && ctor2; // C2 | D1 -var c2Ord1: C2 | D1; -num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 -num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 -str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 -var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 \ No newline at end of file +var ctor3: C1 | C2; +if (ctor3 instanceof C1) { + ctor3.p1; // C1 +} +else { + ctor3.p2; // C2 +} + +var ctor4: C1 | C2 | C3; +if (ctor4 instanceof C1) { + ctor4.p1; // C1 +} +else if (ctor4 instanceof C2) { + ctor4.p2; // C2 +} +else { + ctor4.p4; // C3 +} + +var ctor5: C1 | D1 | C2; +if (ctor5 instanceof C1) { + ctor5.p1; // C1 +} +else { + ctor5.p2; // C2 +} + +var ctor6: C1 | C2 | C3; +if (ctor6 instanceof C1 || ctor6 instanceof C2) { +} +else { + ctor6.p4; // C3 +} \ No newline at end of file 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/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/conformance/types/thisType/thisTypeAndConstraints.ts b/tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts new file mode 100644 index 00000000000..f46b251c3b2 --- /dev/null +++ b/tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts @@ -0,0 +1,21 @@ +class A { + self() { + return this; + } +} + +function f(x: T) { + function g(x: U) { + x = x.self(); + } + x = x.self(); +} + +class B { + foo(x: T) { + x = x.self(); + } + bar(x: U) { + x = x.self(); + } +} diff --git a/tests/cases/conformance/types/thisType/thisTypeInClasses.ts b/tests/cases/conformance/types/thisType/thisTypeInClasses.ts index 17dc13cf558..6c650341fbe 100644 --- a/tests/cases/conformance/types/thisType/thisTypeInClasses.ts +++ b/tests/cases/conformance/types/thisType/thisTypeInClasses.ts @@ -1,7 +1,6 @@ class C1 { x: this; f(x: this): this { return undefined; } - constructor(x: this) { } } class C2 { diff --git a/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts b/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts new file mode 100644 index 00000000000..1e27acd2083 --- /dev/null +++ b/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts @@ -0,0 +1,25 @@ +type F1 = (a: string, b?: string) => void; +type F2 = (a: string, b?: string, c?: string) => void; +type F3 = (a: string, ...rest: string[]) => void; +type F4 = (a: string, b?: string, ...rest: string[]) => void; +type F5 = (a: string, b: string) => void; + +var f12: F1 | F2; +f12("a"); +f12("a", "b"); +f12("a", "b", "c"); // error + +var f34: F3 | F4; +f34("a"); +f34("a", "b"); +f34("a", "b", "c"); + +var f1234: F1 | F2 | F3 | F4; +f1234("a"); +f1234("a", "b"); +f1234("a", "b", "c"); // error + +var f12345: F1 | F2 | F3 | F4 | F5; +f12345("a"); // error +f12345("a", "b"); +f12345("a", "b", "c"); // error 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/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/javaScriptModules12.ts b/tests/cases/fourslash/javaScriptModules12.ts new file mode 100644 index 00000000000..c391f150963 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules12.ts @@ -0,0 +1,57 @@ +/// + +// Invocations of 'require' stop top-level variables from becoming global + +// @allowNonTsExtensions: 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..8b22971009c --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules13.ts @@ -0,0 +1,26 @@ +/// + +// Assignments to 'module.exports' create an external module + +// @allowNonTsExtensions: 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..5434f94cf8d --- /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 + +// @allowNonTsExtensions: 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..ff888d99336 --- /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 + +// @allowNonTsExtensions: 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..c556f288145 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules16.ts @@ -0,0 +1,22 @@ +/// + +// Assignments to 'exports.p' define a property 'p' + +// @allowNonTsExtensions: 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..8514ed0ee18 --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules17.ts @@ -0,0 +1,18 @@ +/// + +// @allowNonTsExtensions: 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..d3117f86b3f --- /dev/null +++ b/tests/cases/fourslash/javaScriptModules18.ts @@ -0,0 +1,14 @@ +/// + +// CommonJS modules should not pollute the global namespace + +// @allowNonTsExtensions: 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/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/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/unittests/moduleResolution.ts b/tests/cases/unittests/moduleResolution.ts index a76428a62a1..c53cad5725a 100644 --- a/tests/cases/unittests/moduleResolution.ts +++ b/tests/cases/unittests/moduleResolution.ts @@ -95,8 +95,8 @@ module ts { 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); + // expect five failed lookup location - attempt to load module as file with all supported extensions + assert.equal(resolution.failedLookupLocations.length, 5); } it("module name as directory - load from typings", () => { @@ -117,6 +117,8 @@ module ts { "/a/b/foo.ts", "/a/b/foo.tsx", "/a/b/foo.d.ts", + "/a/b/foo.js", + "/a/b/foo.jsx", "/a/b/foo/index.ts", "/a/b/foo/index.tsx", ]); @@ -143,7 +145,7 @@ 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", ]) }); 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/webTestServer.ts b/tests/webTestServer.ts index 6ddc18f1344..6bd15359e3f 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 /// @@ -276,7 +276,6 @@ if ((browser && browser === 'chrome')) { console.log(`default Chrome location is unknown for platform '${os.platform()}'`); break; } - if (fs.existsSync(defaultChromePath)) { browserPath = defaultChromePath; } else {