Merge branch 'master' into issue3979

This commit is contained in:
zhengbli 2015-08-19 14:05:01 -07:00
commit 04c54f80bb
550 changed files with 9792 additions and 7062 deletions

View File

@ -141,7 +141,9 @@ var harnessSources = harnessCoreSources.concat([
"session.ts",
"versionCache.ts",
"convertToBase64.ts",
"transpile.ts"
"transpile.ts",
"reuseProgramStructure.ts",
"cachingInServerLSHost.ts"
].map(function (f) {
return path.join(unittestsDirectory, f);
})).concat([

View File

@ -1450,6 +1450,7 @@ declare namespace ts {
function getTrailingCommentRanges(text: string, pos: number): CommentRange[];
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant: ts.LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
}
declare namespace ts {
function getDefaultLibFileName(options: CompilerOptions): string;

View File

@ -965,7 +965,9 @@ namespace ts {
// Escape the name in the "require(...)" clause to ensure we find the right symbol.
let moduleName = escapeIdentifier(moduleReferenceLiteral.text);
if (!moduleName) return;
if (!moduleName) {
return;
}
let isRelative = isExternalModuleNameRelative(moduleName);
if (!isRelative) {
let symbol = getSymbol(globals, "\"" + moduleName + "\"", SymbolFlags.ValueModule);
@ -973,20 +975,9 @@ namespace ts {
return symbol;
}
}
let fileName: string;
let sourceFile: SourceFile;
while (true) {
fileName = normalizePath(combinePaths(searchPath, moduleName));
sourceFile = forEach(supportedExtensions, extension => host.getSourceFile(fileName + extension));
if (sourceFile || isRelative) {
break;
}
let parentPath = getDirectoryPath(searchPath);
if (parentPath === searchPath) {
break;
}
searchPath = parentPath;
}
let fileName = getResolvedModuleFileName(getSourceFile(location), moduleReferenceLiteral.text);
let sourceFile = fileName && host.getSourceFile(fileName);
if (sourceFile) {
if (sourceFile.symbol) {
return sourceFile.symbol;
@ -2175,10 +2166,13 @@ namespace ts {
function collectLinkedAliases(node: Identifier): Node[] {
let exportSymbol: Symbol;
if (node.parent && node.parent.kind === SyntaxKind.ExportAssignment) {
exportSymbol = resolveName(node.parent, node.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, node);
exportSymbol = resolveName(node.parent, node.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, Diagnostics.Cannot_find_name_0, node);
}
else if (node.parent.kind === SyntaxKind.ExportSpecifier) {
exportSymbol = getTargetOfExportSpecifier(<ExportSpecifier>node.parent);
let exportSpecifier = <ExportSpecifier>node.parent;
exportSymbol = (<ExportDeclaration>exportSpecifier.parent.parent).moduleSpecifier ?
getExternalModuleMember(<ExportDeclaration>exportSpecifier.parent.parent, exportSpecifier) :
resolveEntityName(exportSpecifier.propertyName || exportSpecifier.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias);
}
let result: Node[] = [];
if (exportSymbol) {
@ -13328,7 +13322,7 @@ namespace ts {
}
}
else {
if (languageVersion >= ScriptTarget.ES6) {
if (languageVersion >= ScriptTarget.ES6 && !isInAmbientContext(node)) {
// Import equals declaration is deprecated in es6 or above
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead);
}
@ -13851,7 +13845,11 @@ namespace ts {
}
break;
}
if (introducesArgumentsExoticObject(location)) {
copySymbol(argumentsSymbol, meaning);
}
memberFlags = location.flags;
location = location.parent;
}

View File

@ -24,6 +24,7 @@ namespace ts {
set,
contains,
remove,
clear,
forEachValue: forEachValueInMap
};
@ -51,6 +52,10 @@ namespace ts {
function normalizeKey(key: string) {
return getCanonicalFileName(normalizeSlashes(key));
}
function clear() {
files = {};
}
}
export const enum Comparison {
@ -716,7 +721,7 @@ namespace ts {
/**
* List of supported extensions in order of file resolution precedence.
*/
export const supportedExtensions = [".tsx", ".ts", ".d.ts"];
export const supportedExtensions = [".ts", ".tsx", ".d.ts"];
const extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
export function removeFileExtension(path: string): string {

View File

@ -163,7 +163,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
let writeComment = writeCommentRange;
/** Emit a node */
let emit = emitNodeWithoutSourceMap;
let emit = emitNodeWithCommentsAndWithoutSourcemap;
/** Called just before starting emit of a node */
let emitStart = function (node: Node) { };
@ -687,9 +687,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
}
}
function emitNodeWithCommentsAndWithSourcemap(node: Node) {
emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap);
}
writeEmittedFiles = writeJavaScriptAndSourceMapFile;
emit = emitNodeWithSourceMap;
emit = emitNodeWithCommentsAndWithSourcemap;
emitStart = recordEmitNodeStartSpan;
emitEnd = recordEmitNodeEndSpan;
emitToken = writeTextWithSpanRecord;
@ -2126,7 +2130,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
write(".");
emitNodeWithoutSourceMap(node.right);
emit(node.right);
}
function emitEntityNameAsExpression(node: EntityName, useFallback: boolean) {
@ -2818,7 +2822,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitNodeWithoutSourceMap(counter);
write(" < ");
emitNodeWithoutSourceMap(rhsReference);
emitNodeWithCommentsAndWithoutSourcemap(rhsReference);
write(".length");
emitEnd(node.initializer);
@ -2853,7 +2857,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
else {
// The following call does not include the initializer, so we have
// to emit it separately.
emitNodeWithoutSourceMap(declaration);
emitNodeWithCommentsAndWithoutSourcemap(declaration);
write(" = ");
emitNodeWithoutSourceMap(rhsIterationValue);
}
@ -2876,7 +2880,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined);
}
else {
emitNodeWithoutSourceMap(assignmentExpression);
emitNodeWithCommentsAndWithoutSourcemap(assignmentExpression);
}
}
emitEnd(node.initializer);
@ -3032,7 +3036,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write("exports.");
}
}
emitNodeWithoutSourceMap(node.name);
emitNodeWithCommentsAndWithoutSourcemap(node.name);
emitEnd(node.name);
}
@ -3078,7 +3082,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write("default");
}
else {
emitNodeWithoutSourceMap(node.name);
emitNodeWithCommentsAndWithoutSourcemap(node.name);
}
write(`", `);
emitDeclarationName(node);
@ -3116,7 +3120,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitStart(specifier.name);
emitContainingModuleName(specifier);
write(".");
emitNodeWithoutSourceMap(specifier.name);
emitNodeWithCommentsAndWithoutSourcemap(specifier.name);
emitEnd(specifier.name);
write(" = ");
emitExpressionIdentifier(name);
@ -3131,7 +3135,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
writeLine();
emitStart(specifier.name);
write(`${exportFunctionForFile}("`);
emitNodeWithoutSourceMap(specifier.name);
emitNodeWithCommentsAndWithoutSourcemap(specifier.name);
write(`", `);
emitExpressionIdentifier(specifier.propertyName || specifier.name);
write(")");
@ -3176,7 +3180,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
if (exportChanged) {
write(`${exportFunctionForFile}("`);
emitNodeWithoutSourceMap(name);
emitNodeWithCommentsAndWithoutSourcemap(name);
write(`", `);
}
@ -3408,7 +3412,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
if (exportChanged) {
write(`${exportFunctionForFile}("`);
emitNodeWithoutSourceMap(node.name);
emitNodeWithCommentsAndWithoutSourcemap(node.name);
write(`", `);
}
@ -3564,9 +3568,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitEnd(parameter);
write(" { ");
emitStart(parameter);
emitNodeWithoutSourceMap(paramName);
emitNodeWithCommentsAndWithoutSourcemap(paramName);
write(" = ");
emitNodeWithoutSourceMap(initializer);
emitNodeWithCommentsAndWithoutSourcemap(initializer);
emitEnd(parameter);
write("; }");
}
@ -3589,7 +3593,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitLeadingComments(restParam);
emitStart(restParam);
write("var ");
emitNodeWithoutSourceMap(restParam.name);
emitNodeWithCommentsAndWithoutSourcemap(restParam.name);
write(" = [];");
emitEnd(restParam);
emitTrailingComments(restParam);
@ -3610,7 +3614,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
increaseIndent();
writeLine();
emitStart(restParam);
emitNodeWithoutSourceMap(restParam.name);
emitNodeWithCommentsAndWithoutSourcemap(restParam.name);
write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];");
emitEnd(restParam);
decreaseIndent();
@ -3631,7 +3635,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
function emitDeclarationName(node: Declaration) {
if (node.name) {
emitNodeWithoutSourceMap(node.name);
emitNodeWithCommentsAndWithoutSourcemap(node.name);
}
else {
write(getGeneratedNameForNode(node));
@ -3675,6 +3679,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitLeadingComments(node);
}
emitStart(node);
// For targeting below es6, emit functions-like declaration including arrow function using function keyword.
// When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead
if (!shouldEmitAsArrowFunction(node)) {
@ -3700,6 +3705,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.FunctionDeclaration && node.parent === currentSourceFile && node.name) {
emitExportMemberAssignments((<FunctionDeclaration>node).name);
}
emitEnd(node);
if (node.kind !== SyntaxKind.MethodDeclaration && node.kind !== SyntaxKind.MethodSignature) {
emitTrailingComments(node);
}
@ -4055,10 +4062,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitMemberAccessForPropertyName(memberName: DeclarationName) {
// TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here.
// This does not emit source map because it is emitted by caller as caller
// is aware how the property name changes to the property access
// eg. public x = 10; becomes this.x and static x = 10 becomes className.x
if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) {
write("[");
emitNodeWithoutSourceMap(memberName);
emitNodeWithCommentsAndWithoutSourcemap(memberName);
write("]");
}
else if (memberName.kind === SyntaxKind.ComputedPropertyName) {
@ -4066,7 +4075,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
else {
write(".");
emitNodeWithoutSourceMap(memberName);
emitNodeWithCommentsAndWithoutSourcemap(memberName);
}
}
@ -4134,10 +4143,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitMemberAccessForPropertyName((<MethodDeclaration>member).name);
emitEnd((<MethodDeclaration>member).name);
write(" = ");
emitStart(member);
emitFunctionDeclaration(<MethodDeclaration>member);
emitEnd(member);
emitEnd(member);
write(";");
emitTrailingComments(member);
}
@ -5343,13 +5350,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitExportMemberAssignments(<Identifier>node.name);
}
}
/*
* Some bundlers (SystemJS builder) sometimes want to rename dependencies.
* 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]}"`
}
return undefined;
}
function emitRequire(moduleName: Expression) {
if (moduleName.kind === SyntaxKind.StringLiteral) {
write("require(");
emitStart(moduleName);
emitLiteral(<LiteralExpression>moduleName);
emitEnd(moduleName);
let text = tryRenameExternalModule(<LiteralExpression>moduleName);
if (text) {
write(text);
}
else {
emitStart(moduleName);
emitLiteral(<LiteralExpression>moduleName);
emitEnd(moduleName);
}
emitToken(SyntaxKind.CloseParenToken, moduleName.end);
}
else {
@ -5563,11 +5587,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitStart(specifier);
emitContainingModuleName(specifier);
write(".");
emitNodeWithoutSourceMap(specifier.name);
emitNodeWithCommentsAndWithoutSourcemap(specifier.name);
write(" = ");
write(generatedName);
write(".");
emitNodeWithoutSourceMap(specifier.propertyName || specifier.name);
emitNodeWithCommentsAndWithoutSourcemap(specifier.propertyName || specifier.name);
write(";");
emitEnd(specifier);
}
@ -5590,7 +5614,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
else {
if (!node.exportClause || resolver.isValueAliasDeclaration(node)) {
emitStart(node);
write("export ");
if (node.exportClause) {
// export { x, y, ... }
@ -5603,10 +5626,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
if (node.moduleSpecifier) {
write(" from ");
emitNodeWithoutSourceMap(node.moduleSpecifier);
emit(node.moduleSpecifier);
}
write(";");
emitEnd(node);
}
}
}
@ -5620,13 +5642,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
if (needsComma) {
write(", ");
}
emitStart(specifier);
if (specifier.propertyName) {
emitNodeWithoutSourceMap(specifier.propertyName);
emit(specifier.propertyName);
write(" as ");
}
emitNodeWithoutSourceMap(specifier.name);
emitEnd(specifier);
emit(specifier.name);
needsComma = true;
}
}
@ -5752,7 +5772,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
function getExternalModuleNameText(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration): string {
let moduleName = getExternalModuleName(importNode);
if (moduleName.kind === SyntaxKind.StringLiteral) {
return getLiteralText(<LiteralExpression>moduleName);
return tryRenameExternalModule(<LiteralExpression>moduleName) || getLiteralText(<LiteralExpression>moduleName);
}
return undefined;
@ -5913,7 +5933,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
writeLine();
write("'");
if (node.kind === SyntaxKind.Identifier) {
emitNodeWithoutSourceMap(node);
emitNodeWithCommentsAndWithoutSourcemap(node);
}
else {
emitDeclarationName(<Declaration>node);
@ -6211,9 +6231,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
let e = (<ExportDeclaration>entry).exportClause.elements[i];
write(`"`);
emitNodeWithoutSourceMap(e.name);
emitNodeWithCommentsAndWithoutSourcemap(e.name);
write(`": ${parameterName}["`);
emitNodeWithoutSourceMap(e.propertyName || e.name);
emitNodeWithCommentsAndWithoutSourcemap(e.propertyName || e.name);
write(`"]`);
}
decreaseIndent();
@ -6317,10 +6337,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
groupIndices[text] = dependencyGroups.length;
dependencyGroups.push([externalImports[i]]);
}
if (i !== 0) {
write(", ");
}
write(text);
}
write(`], function(${exportFunctionForFile}) {`);
@ -6669,28 +6690,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitLeadingComments(node.endOfFileToken);
}
function emitNodeWithoutSourceMap(node: Node): void {
if (!node) {
return;
}
function emitNodeWithCommentsAndWithoutSourcemap(node: Node): void {
emitNodeConsideringCommentsOption(node, emitNodeWithoutSourceMap);
}
if (node.flags & NodeFlags.Ambient) {
return emitOnlyPinnedOrTripleSlashComments(node);
}
function emitNodeConsideringCommentsOption(node: Node, emitNodeConsideringSourcemap: (node: Node) => void): void {
if (node) {
if (node.flags & NodeFlags.Ambient) {
return emitOnlyPinnedOrTripleSlashComments(node);
}
let emitComments = shouldEmitLeadingAndTrailingComments(node);
if (emitComments) {
emitLeadingComments(node);
}
if (isSpecializedCommentHandling(node)) {
// This is the node that will handle its own comments and sourcemap
return emitNodeWithoutSourceMap(node);
}
emitJavaScriptWorker(node);
let emitComments = shouldEmitLeadingAndTrailingComments(node);
if (emitComments) {
emitLeadingComments(node);
}
if (emitComments) {
emitTrailingComments(node);
emitNodeConsideringSourcemap(node);
if (emitComments) {
emitTrailingComments(node);
}
}
}
function shouldEmitLeadingAndTrailingComments(node: Node) {
function emitNodeWithoutSourceMap(node: Node): void {
if (node) {
emitJavaScriptWorker(node);
}
}
function isSpecializedCommentHandling(node: Node): boolean {
switch (node.kind) {
// All of these entities are emitted in a specialized fashion. As such, we allow
// the specialized methods for each to handle the comments on the nodes.
@ -6700,8 +6734,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ExportAssignment:
return false;
return true;
}
}
function shouldEmitLeadingAndTrailingComments(node: Node) {
switch (node.kind) {
case SyntaxKind.VariableStatement:
return shouldEmitLeadingAndTrailingCommentsForVariableStatement(<VariableStatement>node);
@ -6716,6 +6754,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
return shouldEmitEnumDeclaration(<EnumDeclaration>node);
}
// If the node is emitted in specialized fashion, dont emit comments as this node will handle
// emitting comments when emitting itself
Debug.assert(!isSpecializedCommentHandling(node));
// If this is the expression body of an arrow function that we're down-leveling,
// then we don't want to emit comments when we emit the body. It will have already
// been taken care of when we emitted the 'return' statement for the function

View File

@ -8,6 +8,9 @@ namespace ts {
/* @internal */ export let ioWriteTime = 0;
/** The version of the TypeScript compiler release */
let emptyArray: any[] = [];
export const version = "1.6.0";
export function findConfigFile(searchPath: string): string {
@ -25,6 +28,62 @@ namespace ts {
}
return undefined;
}
export function resolveTripleslashReference(moduleName: string, containingFile: string): string {
let basePath = getDirectoryPath(containingFile);
let referencedFileName = isRootedDiskPath(moduleName) ? moduleName : combinePaths(basePath, moduleName);
return normalizePath(referencedFileName);
}
export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModule {
// TODO: use different resolution strategy based on compiler options
return legacyNameResolver(moduleName, containingFile, compilerOptions, host);
}
function legacyNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModule {
// module names that contain '!' are used to reference resources and are not resolved to actual files on disk
if (moduleName.indexOf('!') != -1) {
return { resolvedFileName: undefined, failedLookupLocations: [] };
}
let searchPath = getDirectoryPath(containingFile);
let searchName: string;
let failedLookupLocations: string[] = [];
let referencedSourceFile: string;
while (true) {
searchName = normalizePath(combinePaths(searchPath, moduleName));
referencedSourceFile = forEach(supportedExtensions, extension => {
if (extension === ".tsx" && !compilerOptions.jsx) {
// resolve .tsx files only if jsx support is enabled
// 'logical not' handles both undefined and None cases
return undefined;
}
let candidate = searchName + extension;
if (host.fileExists(candidate)) {
return candidate;
}
else {
failedLookupLocations.push(candidate);
}
});
if (referencedSourceFile) {
break;
}
let parentPath = getDirectoryPath(searchPath);
if (parentPath === searchPath) {
break;
}
searchPath = parentPath;
}
return { resolvedFileName: referencedSourceFile, failedLookupLocations };
}
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost {
let currentDirectory: string;
@ -92,7 +151,8 @@ namespace ts {
}
const newLine = getNewLineCharacter(options);
return {
getSourceFile,
getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)),
@ -100,7 +160,9 @@ namespace ts {
getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()),
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
getCanonicalFileName,
getNewLine: () => newLine
getNewLine: () => newLine,
fileExists: fileName => sys.fileExists(fileName),
readFile: fileName => sys.readFile(fileName)
};
}
@ -143,7 +205,7 @@ namespace ts {
}
}
export function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program {
export function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program {
let program: Program;
let files: SourceFile[] = [];
let diagnostics = createDiagnosticCollection();
@ -158,24 +220,56 @@ namespace ts {
let start = new Date().getTime();
host = host || createCompilerHost(options);
// initialize resolveModuleNameWorker only if noResolve is false
let resolveModuleNamesWorker: (moduleNames: string[], containingFile: string) => string[];
if (!options.noResolve) {
resolveModuleNamesWorker = host.resolveModuleNames;
if (!resolveModuleNamesWorker) {
resolveModuleNamesWorker = (moduleNames, containingFile) => {
return map(moduleNames, moduleName => {
let moduleResolution = resolveModuleName(moduleName, containingFile, options, host);
return moduleResolution.resolvedFileName;
});
}
}
}
let filesByName = createFileMap<SourceFile>(fileName => host.getCanonicalFileName(fileName));
forEach(rootNames, name => processRootFile(name, /*isDefaultLib:*/ false));
// Do not process the default library if:
// - The '--noLib' flag is used.
// - A 'no-default-lib' reference comment is encountered in
// processing the root files.
if (!skipDefaultLib) {
processRootFile(host.getDefaultLibFileName(options), /*isDefaultLib:*/ true);
if (oldProgram) {
// check properties that can affect structure of the program or module resolution strategy
// if any of these properties has changed - structure cannot be reused
let oldOptions = oldProgram.getCompilerOptions();
if ((oldOptions.module !== options.module) ||
(oldOptions.noResolve !== options.noResolve) ||
(oldOptions.target !== options.target) ||
(oldOptions.noLib !== options.noLib) ||
(oldOptions.jsx !== options.jsx)) {
oldProgram = undefined;
}
}
if (!tryReuseStructureFromOldProgram()) {
forEach(rootNames, name => processRootFile(name, false));
// Do not process the default library if:
// - The '--noLib' flag is used.
// - A 'no-default-lib' reference comment is encountered in
// processing the root files.
if (!skipDefaultLib) {
processRootFile(host.getDefaultLibFileName(options), true);
}
}
verifyCompilerOptions();
// unconditionally set oldProgram to undefined to prevent it from being captured in closure
oldProgram = undefined;
programTime += new Date().getTime() - start;
program = {
getRootFileNames: () => rootNames,
getSourceFile: getSourceFile,
getSourceFiles: () => files,
getCompilerOptions: () => options,
@ -211,6 +305,82 @@ namespace ts {
return classifiableNames;
}
function tryReuseStructureFromOldProgram(): boolean {
if (!oldProgram) {
return false;
}
Debug.assert(!oldProgram.structureIsReused);
// there is an old program, check if we can reuse its structure
let oldRootNames = oldProgram.getRootFileNames();
if (!arrayIsEqualTo(oldRootNames, rootNames)) {
return false;
}
// check if program source files has changed in the way that can affect structure of the program
let newSourceFiles: SourceFile[] = [];
for (let oldSourceFile of oldProgram.getSourceFiles()) {
let newSourceFile = host.getSourceFile(oldSourceFile.fileName, options.target);
if (!newSourceFile) {
return false;
}
if (oldSourceFile !== newSourceFile) {
if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
// value of no-default-lib has changed
// this will affect if default library is injected into the list of files
return false;
}
// check tripleslash references
if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
// tripleslash references has changed
return false;
}
// check imports
collectExternalModuleReferences(newSourceFile);
if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
// imports has changed
return false;
}
if (resolveModuleNamesWorker) {
let moduleNames = map(newSourceFile.imports, name => name.text);
let resolutions = resolveModuleNamesWorker(moduleNames, newSourceFile.fileName);
// ensure that module resolution results are still correct
for (let i = 0; i < moduleNames.length; ++i) {
let oldResolution = getResolvedModuleFileName(oldSourceFile, moduleNames[i]);
if (oldResolution !== resolutions[i]) {
return false;
}
}
}
// pass the cache of module resolutions from the old source file
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
}
else {
// file has no changes - use it as is
newSourceFile = oldSourceFile;
}
// if file has passed all checks it should be safe to reuse it
newSourceFiles.push(newSourceFile);
}
// update fileName -> file mapping
for (let file of newSourceFiles) {
filesByName.set(file.fileName, file);
}
files = newSourceFiles;
oldProgram.structureIsReused = true;
return true;
}
function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost {
return {
getCanonicalFileName: fileName => host.getCanonicalFileName(fileName),
@ -370,16 +540,66 @@ namespace ts {
function processRootFile(fileName: string, isDefaultLib: boolean) {
processSourceFile(normalizePath(fileName), isDefaultLib);
}
function fileReferenceIsEqualTo(a: FileReference, b: FileReference): boolean {
return a.fileName === b.fileName;
}
function moduleNameIsEqualTo(a: LiteralExpression, b: LiteralExpression): boolean {
return a.text === b.text;
}
function collectExternalModuleReferences(file: SourceFile): void {
if (file.imports) {
return;
}
let imports: LiteralExpression[];
for (let node of file.statements) {
switch (node.kind) {
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ExportDeclaration:
let moduleNameExpr = getExternalModuleName(node);
if (!moduleNameExpr || moduleNameExpr.kind !== SyntaxKind.StringLiteral) {
break;
}
if (!(<LiteralExpression>moduleNameExpr).text) {
break;
}
(imports || (imports = [])).push(<LiteralExpression>moduleNameExpr);
break;
case SyntaxKind.ModuleDeclaration:
if ((<ModuleDeclaration>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((<ModuleDeclaration>node).body, node => {
if (isExternalModuleImportEqualsDeclaration(node) &&
getExternalModuleImportEqualsDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
let moduleName = <LiteralExpression>getExternalModuleImportEqualsDeclarationExpression(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.
if (moduleName) {
(imports || (imports = [])).push(moduleName);
}
}
});
}
break;
}
}
file.imports = imports || emptyArray;
}
function processSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number) {
let start: number;
let length: number;
let diagnosticArgument: string[];
if (refEnd !== undefined && refPos !== undefined) {
start = refPos;
length = refEnd - refPos;
}
let diagnostic: DiagnosticMessage;
if (hasExtension(fileName)) {
if (!options.allowNonTsExtensions && !forEach(supportedExtensions, extension => fileExtensionIs(host.getCanonicalFileName(fileName), extension))) {
@ -411,8 +631,8 @@ namespace ts {
}
if (diagnostic) {
if (refFile) {
diagnostics.add(createFileDiagnostic(refFile, start, length, diagnostic, ...diagnosticArgument));
if (refFile !== undefined && refEnd !== undefined && refPos !== undefined) {
diagnostics.add(createFileDiagnostic(refFile, refPos, refEnd - refPos, diagnostic, ...diagnosticArgument));
}
else {
diagnostics.add(createCompilerDiagnostic(diagnostic, ...diagnosticArgument));
@ -421,7 +641,7 @@ namespace ts {
}
// Get source file from normalized fileName
function findSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refStart?: number, refLength?: number): SourceFile {
function findSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number): SourceFile {
let canonicalName = host.getCanonicalFileName(normalizeSlashes(fileName));
if (filesByName.contains(canonicalName)) {
// We've already looked for this file, use cached result
@ -436,8 +656,8 @@ namespace ts {
// We haven't looked for this file, do so now and cache result
let file = host.getSourceFile(fileName, options.target, hostErrorMessage => {
if (refFile) {
diagnostics.add(createFileDiagnostic(refFile, refStart, refLength,
if (refFile !== undefined && refPos !== undefined && refEnd !== undefined) {
diagnostics.add(createFileDiagnostic(refFile, refPos, refEnd - refPos,
Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));
}
else {
@ -473,8 +693,13 @@ namespace ts {
if (file && host.useCaseSensitiveFileNames()) {
let sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName;
if (canonicalName !== sourceFileName) {
diagnostics.add(createFileDiagnostic(refFile, refStart, refLength,
Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName));
if (refFile !== undefined && refPos !== undefined && refEnd !== undefined) {
diagnostics.add(createFileDiagnostic(refFile, refPos, refEnd - refPos,
Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName));
}
else {
diagnostics.add(createCompilerDiagnostic(Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName));
}
}
}
return file;
@ -483,60 +708,35 @@ namespace ts {
function processReferencedFiles(file: SourceFile, basePath: string) {
forEach(file.referencedFiles, ref => {
let referencedFileName = isRootedDiskPath(ref.fileName) ? ref.fileName : combinePaths(basePath, ref.fileName);
processSourceFile(normalizePath(referencedFileName), /* isDefaultLib */ false, file, ref.pos, ref.end);
let referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName);
processSourceFile(referencedFileName, /* isDefaultLib */ false, file, ref.pos, ref.end);
});
}
function processImportedModules(file: SourceFile, basePath: string) {
forEach(file.statements, node => {
if (node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration || node.kind === SyntaxKind.ExportDeclaration) {
let moduleNameExpr = getExternalModuleName(node);
if (moduleNameExpr && moduleNameExpr.kind === SyntaxKind.StringLiteral) {
let moduleNameText = (<LiteralExpression>moduleNameExpr).text;
if (moduleNameText) {
let searchPath = basePath;
let searchName: string;
while (true) {
searchName = normalizePath(combinePaths(searchPath, moduleNameText));
if (forEach(supportedExtensions, extension => findModuleSourceFile(searchName + extension, moduleNameExpr))) {
break;
}
let parentPath = getDirectoryPath(searchPath);
if (parentPath === searchPath) {
break;
}
searchPath = parentPath;
}
}
function processImportedModules(file: SourceFile, basePath: string) {
collectExternalModuleReferences(file);
if (file.imports.length) {
file.resolvedModules = {};
let oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
let moduleNames = map(file.imports, name => name.text);
let resolutions = resolveModuleNamesWorker(moduleNames, file.fileName);
for (let i = 0; i < file.imports.length; ++i) {
let resolution = resolutions[i];
setResolvedModuleName(file, moduleNames[i], resolution);
if (resolution) {
findModuleSourceFile(resolution, file.imports[i]);
}
}
else if (node.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>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((<ModuleDeclaration>node).body, node => {
if (isExternalModuleImportEqualsDeclaration(node) &&
getExternalModuleImportEqualsDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
let nameLiteral = <LiteralExpression>getExternalModuleImportEqualsDeclarationExpression(node);
let moduleName = nameLiteral.text;
if (moduleName) {
// TypeScript 1.0 spec (April 2014): 12.1.6
// An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules
// only through top - level external module names. Relative external module names are not permitted.
let searchName = normalizePath(combinePaths(basePath, moduleName));
forEach(supportedExtensions, extension => findModuleSourceFile(searchName + extension, nameLiteral));
}
}
});
}
});
}
}
else {
// no imports - drop cached module resolutions
file.resolvedModules = undefined;
}
return;
function findModuleSourceFile(fileName: string, nameLiteral: Expression) {
return findSourceFile(fileName, /* isDefaultLib */ false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
return findSourceFile(fileName, /* isDefaultLib */ false, file, nameLiteral.pos, nameLiteral.end);
}
}

View File

@ -672,7 +672,6 @@ namespace ts {
ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion);
}
/* @internal */
// Creates a scanner over a (possibly unspecified) range of a piece of text.
export function createScanner(languageVersion: ScriptTarget,
skipTrivia: boolean,

View File

@ -334,7 +334,7 @@ namespace ts {
if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
return getWScriptSystem();
}
else if (typeof process !== "undefined" && process.nextTick && !process.browser) {
else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") {
// process and process.nextTick checks if current environment is node-like
// process.browser check excludes webpack and browserify
return getNodeSystem();

View File

@ -9,6 +9,7 @@ namespace ts {
contains(fileName: string): boolean;
remove(fileName: string): void;
forEachValue(f: (v: T) => void): void;
clear(): void;
}
export interface TextRange {
@ -1243,6 +1244,10 @@ namespace ts {
moduleName: string;
referencedFiles: FileReference[];
languageVariant: LanguageVariant;
// this map is used by transpiler to supply alternative names for dependencies (i.e. in case of bundling)
/* @internal */
renamedDependencies?: Map<string>;
/**
* lib.d.ts should have a reference comment like
@ -1275,8 +1280,12 @@ namespace ts {
// Stores a line map for the file.
// This field should never be used directly to obtain line map, use getLineMap function instead.
/* @internal */ lineMap: number[];
/* @internal */ classifiableNames?: Map<string>;
// Stores a mapping 'external module reference text' -> 'resolved file name' | undefined
// It is used to resolve module names in the checker.
// Content of this fiels should never be used directly - use getResolvedModuleFileName/setResolvedModuleFileName functions instead
/* @internal */ resolvedModules: Map<string>;
/* @internal */ imports: LiteralExpression[];
}
export interface ScriptReferenceHost {
@ -1285,7 +1294,7 @@ namespace ts {
getCurrentDirectory(): string;
}
export interface ParseConfigHost {
export interface ParseConfigHost extends ModuleResolutionHost {
readDirectory(rootDir: string, extension: string, exclude: string[]): string[];
}
@ -1303,6 +1312,12 @@ namespace ts {
}
export interface Program extends ScriptReferenceHost {
/**
* Get a list of root file names that were passed to a 'createProgram'
*/
getRootFileNames(): string[]
/**
* Get a list of files in the program
*/
@ -1343,6 +1358,9 @@ namespace ts {
/* @internal */ getIdentifierCount(): number;
/* @internal */ getSymbolCount(): number;
/* @internal */ getTypeCount(): number;
// For testing purposes only.
/* @internal */ structureIsReused?: boolean;
}
export interface SourceMapSpan {
@ -2229,9 +2247,23 @@ namespace ts {
byteOrderMark = 0xFEFF,
tab = 0x09, // \t
verticalTab = 0x0B, // \v
}
export interface ModuleResolutionHost {
fileExists(fileName: string): boolean;
// readFile function is used to read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json'
// to determine location of bundled typings for node module
readFile(fileName: string): string;
}
export interface ResolvedModule {
resolvedFileName: string;
failedLookupLocations: string[];
}
export type ModuleNameResolver = (moduleName: string, containingFile: string, options: CompilerOptions, host: ModuleResolutionHost) => ResolvedModule;
export interface CompilerHost {
export interface CompilerHost extends ModuleResolutionHost {
getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
getCancellationToken?(): CancellationToken;
getDefaultLibFileName(options: CompilerOptions): string;
@ -2240,6 +2272,15 @@ namespace ts {
getCanonicalFileName(fileName: string): string;
useCaseSensitiveFileNames(): boolean;
getNewLine(): string;
/*
* CompilerHost must either implement resolveModuleNames (in case if it wants to be completely in charge of
* module name resolution) or provide implementation for methods from ModuleResolutionHost (in this case compiler
* will appply built-in module resolution logic and use members of ModuleResolutionHost to ask host specific questions).
* If resolveModuleNames is implemented then implementation for members from ModuleResolutionHost can be just
* 'throw new Error("NotImplemented")'
*/
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
}
export interface TextSpan {

View File

@ -80,6 +80,41 @@ namespace ts {
return node.end - node.pos;
}
export function arrayIsEqualTo<T>(arr1: T[], arr2: T[], comparer?: (a: T, b: T) => boolean): boolean {
if (!arr1 || !arr2) {
return arr1 === arr2;
}
if (arr1.length !== arr2.length) {
return false;
}
for (let i = 0; i < arr1.length; ++i) {
let equals = comparer ? comparer(arr1[i], arr2[i]) : arr1[i] === arr2[i];
if (!equals) {
return false;
}
}
return true;
}
export function hasResolvedModuleName(sourceFile: SourceFile, moduleNameText: string): boolean {
return sourceFile.resolvedModules && hasProperty(sourceFile.resolvedModules, moduleNameText);
}
export function getResolvedModuleFileName(sourceFile: SourceFile, moduleNameText: string): string {
return hasResolvedModuleName(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined;
}
export function setResolvedModuleName(sourceFile: SourceFile, moduleNameText: string, resolvedFileName: string): void {
if (!sourceFile.resolvedModules) {
sourceFile.resolvedModules = {};
}
sourceFile.resolvedModules[moduleNameText] = resolvedFileName;
}
// Returns true if this node contains a parse error anywhere underneath it.
export function containsParseError(node: Node): boolean {
aggregateChildData(node);
@ -205,7 +240,7 @@ namespace ts {
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
// all non-alphanumeric characters with underscores
export function makeIdentifierFromModuleName(moduleName: string): string {
return getBaseFileName(moduleName).replace(/\W/g, "_");
return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
}
export function isBlockOrCatchScoped(declaration: Declaration) {
@ -385,7 +420,10 @@ namespace ts {
}
export function getJsDocComments(node: Node, sourceFileOfNode: SourceFile) {
let commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ? concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos), getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) : getLeadingCommentRangesOfNode(node, sourceFileOfNode);
let commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ?
concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos),
getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) :
getLeadingCommentRangesOfNode(node, sourceFileOfNode);
return filter(commentRanges, isJsDocComment);
function isJsDocComment(comment: CommentRange) {
@ -603,6 +641,20 @@ namespace ts {
return false;
}
export function introducesArgumentsExoticObject(node: Node) {
switch (node.kind) {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
case SyntaxKind.Constructor:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.FunctionExpression:
return true;
}
return false;
}
export function isFunctionBlock(node: Node) {
return node && node.kind === SyntaxKind.Block && isFunctionLike(node.parent);
}

View File

@ -285,7 +285,9 @@ module FourSlash {
case FourSlashTestType.Native:
return new Harness.LanguageService.NativeLanugageServiceAdapter(cancellationToken, compilationOptions);
case FourSlashTestType.Shims:
return new Harness.LanguageService.ShimLanugageServiceAdapter(cancellationToken, compilationOptions);
return new Harness.LanguageService.ShimLanugageServiceAdapter(/*preprocessToResolve*/ false, cancellationToken, compilationOptions);
case FourSlashTestType.ShimsWithPreprocess:
return new Harness.LanguageService.ShimLanugageServiceAdapter(/*preprocessToResolve*/ true, cancellationToken, compilationOptions);
case FourSlashTestType.Server:
return new Harness.LanguageService.ServerLanugageServiceAdapter(cancellationToken, compilationOptions);
default:

View File

@ -5,6 +5,7 @@
const enum FourSlashTestType {
Native,
Shims,
ShimsWithPreprocess,
Server
}
@ -23,6 +24,10 @@ class FourSlashRunner extends RunnerBase {
this.basePath = "tests/cases/fourslash/shims";
this.testSuiteName = "fourslash-shims";
break;
case FourSlashTestType.ShimsWithPreprocess:
this.basePath = 'tests/cases/fourslash/shims-pp';
this.testSuiteName = 'fourslash-shims-pp';
break;
case FourSlashTestType.Server:
this.basePath = "tests/cases/fourslash/server";
this.testSuiteName = "fourslash-server";

View File

@ -868,6 +868,29 @@ module Harness {
}
};
inputFiles.forEach(register);
function getSourceFile(fn: string, languageVersion: ts.ScriptTarget) {
fn = ts.normalizePath(fn);
if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) {
return filemap[getCanonicalFileName(fn)];
}
else if (currentDirectory) {
let canonicalAbsolutePath = getCanonicalFileName(ts.getNormalizedAbsolutePath(fn, currentDirectory));
return Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(canonicalAbsolutePath)) ? filemap[canonicalAbsolutePath] : undefined;
}
else if (fn === fourslashFileName) {
let tsFn = "tests/cases/fourslash/" + fourslashFileName;
fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, Harness.IO.readFile(tsFn), scriptTarget);
return fourslashSourceFile;
}
else {
if (fn === defaultLibFileName) {
return languageVersion === ts.ScriptTarget.ES6 ? defaultES6LibSourceFile : defaultLibSourceFile;
}
// Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC
return undefined;
}
}
let newLine =
newLineKind === ts.NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed :
@ -876,33 +899,14 @@ module Harness {
return {
getCurrentDirectory,
getSourceFile: (fn, languageVersion) => {
fn = ts.normalizePath(fn);
if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) {
return filemap[getCanonicalFileName(fn)];
}
else if (currentDirectory) {
let canonicalAbsolutePath = getCanonicalFileName(ts.getNormalizedAbsolutePath(fn, currentDirectory));
return Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(canonicalAbsolutePath)) ? filemap[canonicalAbsolutePath] : undefined;
}
else if (fn === fourslashFileName) {
let tsFn = "tests/cases/fourslash/" + fourslashFileName;
fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, Harness.IO.readFile(tsFn), scriptTarget);
return fourslashSourceFile;
}
else {
if (fn === defaultLibFileName) {
return languageVersion === ts.ScriptTarget.ES6 ? defaultES6LibSourceFile : defaultLibSourceFile;
}
// Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC
return undefined;
}
},
getSourceFile,
getDefaultLibFileName: options => defaultLibFileName,
writeFile,
getCanonicalFileName,
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
getNewLine: () => newLine
getNewLine: () => newLine,
fileExists: fileName => getSourceFile(fileName, ts.ScriptTarget.ES5) !== undefined,
readFile: (fileName: string): string => { throw new Error("NotYetImplemented"); }
};
}

View File

@ -203,9 +203,35 @@ module Harness.LanguageService {
/// Shim adapter
class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost, ts.CoreServicesShimHost {
private nativeHost: NativeLanguageServiceHost;
constructor(cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
public getModuleResolutionsForFile: (fileName: string)=> string;
constructor(preprocessToResolve: boolean, cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
super(cancellationToken, options);
this.nativeHost = new NativeLanguageServiceHost(cancellationToken, options);
if (preprocessToResolve) {
let compilerOptions = this.nativeHost.getCompilationSettings()
let moduleResolutionHost: ts.ModuleResolutionHost = {
fileExists: fileName => this.getScriptInfo(fileName) !== undefined,
readFile: fileName => {
let scriptInfo = this.getScriptInfo(fileName);
return scriptInfo && scriptInfo.content;
}
};
this.getModuleResolutionsForFile = (fileName) => {
let scriptInfo = this.getScriptInfo(fileName);
let preprocessInfo = ts.preProcessFile(scriptInfo.content, /*readImportFiles*/ true);
let imports: ts.Map<string> = {};
for (let module of preprocessInfo.importedFiles) {
let resolutionInfo = ts.resolveModuleName(module.fileName, fileName, compilerOptions, moduleResolutionHost);
if (resolutionInfo.resolvedFileName) {
imports[module.fileName] = resolutionInfo.resolvedFileName;
}
}
return JSON.stringify(imports);
}
}
}
getFilenames(): string[] { return this.nativeHost.getFilenames(); }
@ -229,7 +255,11 @@ module Harness.LanguageService {
readDirectory(rootDir: string, extension: string): string {
throw new Error("NYI");
}
fileExists(fileName: string) { return this.getScriptInfo(fileName) !== undefined; }
readFile(fileName: string) {
let snapshot = this.nativeHost.getScriptSnapshot(fileName);
return snapshot && snapshot.getText(0, snapshot.getLength());
}
log(s: string): void { this.nativeHost.log(s); }
trace(s: string): void { this.nativeHost.trace(s); }
error(s: string): void { this.nativeHost.error(s); }
@ -399,8 +429,8 @@ module Harness.LanguageService {
export class ShimLanugageServiceAdapter implements LanguageServiceAdapter {
private host: ShimLanguageServiceHost;
private factory: ts.TypeScriptServicesFactory;
constructor(cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
this.host = new ShimLanguageServiceHost(cancellationToken, options);
constructor(preprocessToResolve: boolean, cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
this.host = new ShimLanguageServiceHost(preprocessToResolve, cancellationToken, options);
this.factory = new TypeScript.Services.TypeScriptServicesFactory();
}
getHost() { return this.host; }
@ -419,6 +449,7 @@ module Harness.LanguageService {
let convertResult: ts.PreProcessedFileInfo = {
referencedFiles: [],
importedFiles: [],
ambientExternalModules: [],
isLibFile: shimResult.isLibFile
};

View File

@ -191,7 +191,9 @@ class ProjectRunner extends RunnerBase {
getCurrentDirectory,
getCanonicalFileName: Harness.Compiler.getCanonicalFileName,
useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,
getNewLine: () => ts.sys.newLine
getNewLine: () => ts.sys.newLine,
fileExists: fileName => getSourceFile(fileName, ts.ScriptTarget.ES5) !== undefined,
readFile: fileName => Harness.IO.readFile(fileName)
};
}
}

View File

@ -68,7 +68,10 @@ if (testConfigFile !== "") {
case "fourslash-shims":
runners.push(new FourSlashRunner(FourSlashTestType.Shims));
break;
case "fourslash-server":
case 'fourslash-shims-pp':
runners.push(new FourSlashRunner(FourSlashTestType.ShimsWithPreprocess));
break;
case 'fourslash-server':
runners.push(new FourSlashRunner(FourSlashTestType.Server));
break;
case "fourslash-generated":
@ -98,6 +101,7 @@ if (runners.length === 0) {
// language services
runners.push(new FourSlashRunner(FourSlashTestType.Native));
runners.push(new FourSlashRunner(FourSlashTestType.Shims));
runners.push(new FourSlashRunner(FourSlashTestType.ShimsWithPreprocess));
runners.push(new FourSlashRunner(FourSlashTestType.Server));
// runners.push(new GeneratedFourslashRunner());
}

8
src/lib/core.d.ts vendored
View File

@ -324,9 +324,9 @@ interface String {
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A String object or string literal that represents the regular expression
* @param replaceValue A function that returns the replacement text.
* @param replacer A function that returns the replacement text.
*/
replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string;
replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
/**
* Replaces text in a string, using a regular expression or search string.
@ -338,9 +338,9 @@ interface String {
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
* @param replaceValue A function that returns the replacement text.
* @param replacer A function that returns the replacement text.
*/
replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
/**
* Finds the first substring match in a regular expression search.

120
src/lib/es6.d.ts vendored
View File

@ -87,8 +87,8 @@ interface SymbolConstructor {
split: symbol;
/**
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
* abstract operation.
* A method that converts an object to a corresponding primitive value.
* Called by the ToPrimitive abstract operation.
*/
toPrimitive: symbol;
@ -98,8 +98,8 @@ interface SymbolConstructor {
*/
toStringTag: symbol;
/**
* An Object whose own property names are property names that are excluded from the with
/**
* An Object whose own property names are property names that are excluded from the 'with'
* environment bindings of the associated objects.
*/
unscopables: symbol;
@ -170,16 +170,19 @@ interface ObjectConstructor {
}
interface Function {
/**
* Returns a new function object that is identical to the argument object in all ways except
* for its identity and the value of its HomeObject internal slot.
*/
toMethod(newHome: Object): Function;
/**
* Returns the name of the function. Function names are read-only and can not be changed.
*/
name: string;
/**
* Determines whether the given value inherits from this function if this function was used
* as a constructor function.
*
* A constructor function can control which objects are recognized as its instances by
* 'instanceof' by overriding this method.
*/
[Symbol.hasInstance](value: any): boolean;
}
interface NumberConstructor {
@ -252,6 +255,20 @@ interface Array<T> {
/** Iterator */
[Symbol.iterator](): IterableIterator<T>;
/**
* Returns an object whose properties have the value 'true'
* when they will be absent when used in a 'with' statement.
*/
[Symbol.unscopables](): {
copyWithin: boolean;
entries: boolean;
fill: boolean;
find: boolean;
findIndex: boolean;
keys: boolean;
values: boolean;
};
/**
* Returns an array of key, value pairs for every entry in the array
*/
@ -614,37 +631,76 @@ interface Math {
[Symbol.toStringTag]: string;
}
interface Date {
/**
* Converts a Date object to a string.
*/
[Symbol.toPrimitive](hint: "default"): string;
/**
* Converts a Date object to a string.
*/
[Symbol.toPrimitive](hint: "string"): string;
/**
* Converts a Date object to a number.
*/
[Symbol.toPrimitive](hint: "number"): number;
/**
* Converts a Date object to a string or number.
*
* @param hint The strings "number", "string", or "default" to specify what primitive to return.
*
* @throws {TypeError} If 'hint' was given something other than "number", "string", or "default".
* @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
*/
[Symbol.toPrimitive](hint: string): string | number;
}
interface RegExp {
/**
* Matches a string with a regular expression, and returns an array containing the results of
/**
* Matches a string with this regular expression, and returns an array containing the results of
* that search.
* @param string A string to search within.
*/
match(string: string): string[];
[Symbol.match](string: string): RegExpMatchArray;
/**
* Replaces text in a string, using a regular expression.
* @param searchValue A String object or string literal that represents the regular expression
* Replaces text in a string, using this regular expression.
* @param string A String object or string literal whose contents matching against
* this regular expression will be replaced
* @param replaceValue A String object or string literal containing the text to replace for every
* successful match of rgExp in stringObj.
* successful match of this regular expression.
*/
replace(string: string, replaceValue: string): string;
search(string: string): number;
[Symbol.replace](string: string, replaceValue: string): string;
/**
* Returns an Array object into which substrings of the result of converting string to a String
* have been stored. The substrings are determined by searching from left to right for matches
* of the this value regular expression; these occurrences are not part of any substring in the
* returned array, but serve to divide up the String value.
*
* If the regular expression that contains capturing parentheses, then each time separator is
* matched the results (including any undefined results) of the capturing parentheses are spliced.
* @param string string value to split
* @param limit if not undefined, the output array is truncated so that it contains no more
* than limit elements.
* Replaces text in a string, using this regular expression.
* @param string A String object or string literal whose contents matching against
* this regular expression will be replaced
* @param replacer A function that returns the replacement text.
*/
split(string: string, limit?: number): string[];
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
/**
* Finds the position beginning first substring match in a regular expression search
* using this regular expression.
*
* @param string The string to search within.
*/
[Symbol.search](string: string): number;
/**
* Returns an array of substrings that were delimited by strings in the original input that
* match against this regular expression.
*
* If the regular expression contains capturing parentheses, then each time this
* regular expression matches, the results (including any undefined results) of the
* capturing parentheses are spliced.
*
* @param string string value to split
* @param limit if not undefined, the output array is truncated so that it contains no more
* than 'limit' elements.
*/
[Symbol.split](string: string, limit?: number): string[];
/**
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
@ -673,6 +729,10 @@ interface RegExp {
unicode: boolean;
}
interface RegExpConstructor {
[Symbol.species](): RegExpConstructor;
}
interface Map<K, V> {
clear(): void;
delete(key: K): boolean;

View File

@ -78,15 +78,76 @@ namespace ts.server {
return this.snap().getChangeRange(oldSnapshot);
}
}
interface TimestampedResolvedModule extends ResolvedModule {
lastCheckTime: number;
}
export class LSHost implements ts.LanguageServiceHost {
ls: ts.LanguageService = null;
compilationSettings: ts.CompilerOptions;
filenameToScript: ts.Map<ScriptInfo> = {};
roots: ScriptInfo[] = [];
private resolvedModuleNames: ts.FileMap<Map<TimestampedResolvedModule>>;
private moduleResolutionHost: ts.ModuleResolutionHost;
constructor(public host: ServerHost, public project: Project) {
this.resolvedModuleNames = ts.createFileMap<Map<TimestampedResolvedModule>>(ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames))
this.moduleResolutionHost = {
fileExists: fileName => this.fileExists(fileName),
readFile: fileName => this.host.readFile(fileName)
}
}
resolveModuleNames(moduleNames: string[], containingFile: string): string[] {
let currentResolutionsInFile = this.resolvedModuleNames.get(containingFile);
let newResolutions: Map<TimestampedResolvedModule> = {};
let resolvedFileNames: string[] = [];
let compilerOptions = this.getCompilationSettings();
for (let moduleName of moduleNames) {
// check if this is a duplicate entry in the list
let resolution = lookUp(newResolutions, moduleName);
if (!resolution) {
let existingResolution = currentResolutionsInFile && ts.lookUp(currentResolutionsInFile, moduleName);
if (moduleResolutionIsValid(existingResolution)) {
// ok, it is safe to use existing module resolution results
resolution = existingResolution;
}
else {
resolution = <TimestampedResolvedModule>resolveModuleName(moduleName, containingFile, compilerOptions, this.moduleResolutionHost);
resolution.lastCheckTime = Date.now();
newResolutions[moduleName] = resolution;
}
}
ts.Debug.assert(resolution !== undefined);
resolvedFileNames.push(resolution.resolvedFileName);
}
// replace old results with a new one
this.resolvedModuleNames.set(containingFile, newResolutions);
return resolvedFileNames;
function moduleResolutionIsValid(resolution: TimestampedResolvedModule): boolean {
if (!resolution) {
return false;
}
if (resolution.resolvedFileName) {
// TODO: consider checking failedLookupLocations
// TODO: use lastCheckTime to track expiration for module name resolution
return true;
}
// consider situation if we have no candidate locations as valid resolution.
// after all there is no point to invalidate it if we have no idea where to look for the module.
return resolution.failedLookupLocations.length === 0;
}
}
getDefaultLibFileName() {
var nodeModuleBinDir = ts.getDirectoryPath(ts.normalizePath(this.host.getExecutingFilePath()));
@ -102,6 +163,8 @@ namespace ts.server {
setCompilationSettings(opt: ts.CompilerOptions) {
this.compilationSettings = opt;
// conservatively assume that changing compiler options might affect module resolution strategy
this.resolvedModuleNames.clear();
}
lineAffectsRefs(filename: string, line: number) {
@ -137,6 +200,7 @@ namespace ts.server {
removeReferencedFile(info: ScriptInfo) {
if (!info.isOpen) {
this.filenameToScript[info.fileName] = undefined;
this.resolvedModuleNames.remove(info.fileName);
}
}

View File

@ -428,6 +428,7 @@ namespace ts.formatting {
case SyntaxKind.ConditionalExpression:
case SyntaxKind.ArrayBindingPattern:
case SyntaxKind.ObjectBindingPattern:
case SyntaxKind.JsxElement:
return true;
}
return false;

View File

@ -73,7 +73,7 @@ namespace ts {
}
/**
* Represents an immutable snapshot of a script at a specified time.Once acquired, the
* Represents an immutable snapshot of a script at a specified time.Once acquired, the
* snapshot is observably immutable. i.e. the same calls with the same parameters will return
* the same values.
*/
@ -85,9 +85,9 @@ namespace ts {
getLength(): number;
/**
* Gets the TextChangeRange that describe how the text changed between this text and
* Gets the TextChangeRange that describe how the text changed between this text and
* an older version. This information is used by the incremental parser to determine
* what sections of the script need to be re-parsed. 'undefined' can be returned if the
* what sections of the script need to be re-parsed. 'undefined' can be returned if the
* change range cannot be determined. However, in that case, incremental parsing will
* not happen and the entire document will be re - parsed.
*/
@ -125,6 +125,7 @@ namespace ts {
export interface PreProcessedFileInfo {
referencedFiles: FileReference[];
importedFiles: FileReference[];
ambientExternalModules: string[];
isLibFile: boolean
}
@ -275,8 +276,8 @@ namespace ts {
let children = this.getChildren(sourceFile);
let child = lastOrUndefined(children);
if (!child) {
return undefined;
if (!child) {
return undefined;
}
return child.kind < SyntaxKind.FirstNode ? child : child.getLastToken(sourceFile);
@ -336,10 +337,10 @@ namespace ts {
ts.forEach(declarations, (declaration, indexOfDeclaration) => {
// Make sure we are collecting doc comment from declaration once,
// In case of union property there might be same declaration multiple times
// In case of union property there might be same declaration multiple times
// which only varies in type parameter
// Eg. let a: Array<string> | Array<number>; a.length
// The property length will have two declarations of property length coming
// The property length will have two declarations of property length coming
// from Array<T> - Array<string> and Array<number>
if (indexOf(declarations, declaration) === indexOfDeclaration) {
let sourceFileOfDeclaration = getSourceFileOfNode(declaration);
@ -361,7 +362,7 @@ namespace ts {
// If this is dotted module name, get the doc comments from the parent
while (declaration.kind === SyntaxKind.ModuleDeclaration && declaration.parent.kind === SyntaxKind.ModuleDeclaration) {
declaration = <ModuleDeclaration>declaration.parent;
}
}
// Get the cleaned js doc comment text from the declaration
ts.forEach(getJsDocCommentTextRange(
@ -381,7 +382,7 @@ namespace ts {
jsDocComment => {
return {
pos: jsDocComment.pos + "/*".length, // Consume /* from the comment
end: jsDocComment.end - "*/".length // Trim off comment end indicator
end: jsDocComment.end - "*/".length // Trim off comment end indicator
};
});
}
@ -486,7 +487,7 @@ namespace ts {
pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount);
blankLineCount = 0;
}
else if (!isInParamTag && docComments.length) {
else if (!isInParamTag && docComments.length) {
// This is blank line when there is text already parsed
blankLineCount++;
}
@ -502,7 +503,7 @@ namespace ts {
if (isParamTag(pos, end, sourceFile)) {
let blankLineCount = 0;
let recordedParamTag = false;
// Consume leading spaces
// Consume leading spaces
pos = consumeWhiteSpaces(pos + paramTag.length);
if (pos >= end) {
break;
@ -560,7 +561,7 @@ namespace ts {
while (pos < end) {
let ch = sourceFile.text.charCodeAt(pos);
// at line break, set this comment line text and go to next line
// at line break, set this comment line text and go to next line
if (isLineBreak(ch)) {
if (paramHelpString) {
pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount);
@ -626,7 +627,7 @@ namespace ts {
paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character;
}
// Now consume white spaces max
// Now consume white spaces max
let startOfLinePos = pos;
pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin);
if (pos >= end) {
@ -761,7 +762,8 @@ namespace ts {
public languageVariant: LanguageVariant;
public identifiers: Map<string>;
public nameTable: Map<string>;
public resolvedModules: Map<string>;
public imports: LiteralExpression[];
private namedDeclarations: Map<Declaration[]>;
public update(newText: string, textChangeRange: TextChangeRange): SourceFile {
@ -974,6 +976,13 @@ namespace ts {
trace? (s: string): void;
error? (s: string): void;
useCaseSensitiveFileNames? (): boolean;
/*
* LS host can optionally implement this method if it wants to be completely in charge of module name resolution.
* if implementation is omitted then language service will use built-in module resolution logic and get answers to
* host specific questions using 'getScriptSnapshot'.
*/
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
}
//
@ -990,17 +999,17 @@ namespace ts {
// diagnostics present for the program level, and not just 'options' diagnostics.
getCompilerOptionsDiagnostics(): Diagnostic[];
/**
/**
* @deprecated Use getEncodedSyntacticClassifications instead.
*/
getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
/**
/**
* @deprecated Use getEncodedSemanticClassifications instead.
*/
getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
// Encoded as triples of [start, length, ClassificationType].
// Encoded as triples of [start, length, ClassificationType].
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
@ -1228,7 +1237,7 @@ namespace ts {
* Represents a single signature to show in signature help.
* The id is used for subsequent calls into the language service to ask questions about the
* signature help item in the context of any documents that have been updated. i.e. after
* an edit has happened, while signature help is still active, the host can ask important
* an edit has happened, while signature help is still active, the host can ask important
* questions like 'what parameter is the user currently contained within?'.
*/
export interface SignatureHelpItem {
@ -1282,8 +1291,8 @@ namespace ts {
/** The text to display in the editor for the collapsed region. */
bannerText: string;
/**
* Whether or not this region should be automatically collapsed when
/**
* Whether or not this region should be automatically collapsed when
* the 'Collapse to Definitions' command is invoked.
*/
autoCollapse: boolean;
@ -1364,18 +1373,18 @@ namespace ts {
}
/**
* The document registry represents a store of SourceFile objects that can be shared between
* The document registry represents a store of SourceFile objects that can be shared between
* multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
* of files in the context.
* SourceFile objects account for most of the memory usage by the language service. Sharing
* the same DocumentRegistry instance between different instances of LanguageService allow
* for more efficient memory utilization since all projects will share at least the library
* of files in the context.
* SourceFile objects account for most of the memory usage by the language service. Sharing
* the same DocumentRegistry instance between different instances of LanguageService allow
* for more efficient memory utilization since all projects will share at least the library
* file (lib.d.ts).
*
* A more advanced use of the document registry is to serialize sourceFile objects to disk
* A more advanced use of the document registry is to serialize sourceFile objects to disk
* and re-hydrate them when needed.
*
* To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
* To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
* to all subsequent createLanguageService calls.
*/
export interface DocumentRegistry {
@ -1385,7 +1394,7 @@ namespace ts {
* the SourceFile if was not found in the registry.
*
* @param fileName The name of the file requested
* @param compilationSettings Some compilation settings like target affects the
* @param compilationSettings Some compilation settings like target affects the
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings.
* @parm scriptSnapshot Text of the file. Only used if the file was not found
@ -1405,10 +1414,10 @@ namespace ts {
* to get an updated SourceFile.
*
* @param fileName The name of the file requested
* @param compilationSettings Some compilation settings like target affects the
* @param compilationSettings Some compilation settings like target affects the
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
* multiple copies of the same file for different compilation settings.
* @param scriptSnapshot Text of the file.
* @param scriptSnapshot Text of the file.
* @param version Current version of the file.
*/
updateDocument(
@ -1580,7 +1589,7 @@ namespace ts {
sourceFile: SourceFile;
// The number of language services that this source file is referenced in. When no more
// language services are referencing the file, then the file can be removed from the
// language services are referencing the file, then the file can be removed from the
// registry.
languageServiceRefCount: number;
owners: string[];
@ -1635,8 +1644,8 @@ namespace ts {
};
}
// Cache host information about scrip Should be refreshed
// at each language service public entry point, since we don't know when
// Cache host information about scrip Should be refreshed
// at each language service public entry point, since we don't know when
// set of scripts handled by the host changes.
class HostCache {
private fileNameToEntry: FileMap<HostFileInformation>;
@ -1715,8 +1724,8 @@ namespace ts {
}
class SyntaxTreeCache {
// For our syntactic only features, we also keep a cache of the syntax tree for the
// currently edited file.
// For our syntactic only features, we also keep a cache of the syntax tree for the
// currently edited file.
private currentFileName: string;
private currentFileVersion: string;
private currentFileScriptSnapshot: IScriptSnapshot;
@ -1761,20 +1770,21 @@ namespace ts {
sourceFile.version = version;
sourceFile.scriptSnapshot = scriptSnapshot;
}
export interface TranspileOptions {
compilerOptions?: CompilerOptions;
fileName?: string;
reportDiagnostics?: boolean;
moduleName?: string;
renamedDependencies?: Map<string>;
}
export interface TranspileOutput {
outputText: string;
diagnostics?: Diagnostic[];
sourceMapText?: string;
}
/*
* This function will compile source text from 'input' argument using specified compiler options.
* If not options are provided - it will use a set of default compiler options.
@ -1784,7 +1794,7 @@ namespace ts {
* - noLib = true
* - noResolve = true
*/
export function transpileModule(input: string, transpileOptions?: TranspileOptions): TranspileOutput {
export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput {
let options = transpileOptions.compilerOptions ? clone(transpileOptions.compilerOptions) : getDefaultCompilerOptions();
options.isolatedModules = true;
@ -1792,7 +1802,7 @@ namespace ts {
// Filename can be non-ts file.
options.allowNonTsExtensions = true;
// We are not returning a sourceFile for lib file when asked by the program,
// We are not returning a sourceFile for lib file when asked by the program,
// so pass --noLib to avoid reporting a file not found error.
options.noLib = true;
@ -1807,12 +1817,13 @@ namespace ts {
sourceFile.moduleName = transpileOptions.moduleName;
}
sourceFile.renamedDependencies = transpileOptions.renamedDependencies;
let newLine = getNewLineCharacter(options);
// Output
let outputText: string;
let sourceMapText: string;
// Create a compilerHost object to allow the compiler to read and write files
let compilerHost: CompilerHost = {
getSourceFile: (fileName, target) => fileName === inputFileName ? sourceFile : undefined,
@ -1830,11 +1841,14 @@ namespace ts {
useCaseSensitiveFileNames: () => false,
getCanonicalFileName: fileName => fileName,
getCurrentDirectory: () => "",
getNewLine: () => newLine
getNewLine: () => newLine,
// these two methods should never be called in transpile scenarios since 'noResolve' is set to 'true'
fileExists: (fileName): boolean => { throw new Error("Should never be called."); },
readFile: (fileName): string => { throw new Error("Should never be called."); }
};
let program = createProgram([inputFileName], options, compilerHost);
let diagnostics: Diagnostic[];
if (transpileOptions.reportDiagnostics) {
diagnostics = [];
@ -1846,11 +1860,11 @@ namespace ts {
Debug.assert(outputText !== undefined, "Output generation failed");
return { outputText, diagnostics, sourceMapText };
return { outputText, diagnostics, sourceMapText };
}
/*
* This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result.
* This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result.
*/
export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string {
let output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName });
@ -1871,19 +1885,19 @@ namespace ts {
export let disableIncrementalParsing = false;
export function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile {
// If we were given a text change range, and our version or open-ness changed, then
// If we were given a text change range, and our version or open-ness changed, then
// incrementally parse this file.
if (textChangeRange) {
if (version !== sourceFile.version) {
// Once incremental parsing is ready, then just call into this function.
if (!disableIncrementalParsing) {
let newText: string;
// grab the fragment from the beginning of the original text to the beginning of the span
let prefix = textChangeRange.span.start !== 0
? sourceFile.text.substr(0, textChangeRange.span.start)
: "";
// grab the fragment from the end of the span till the end of the original text
let suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length
? sourceFile.text.substr(textSpanEnd(textChangeRange.span))
@ -1897,10 +1911,10 @@ namespace ts {
// it was actual edit, fetch the fragment of new text that correspond to new span
let changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);
// combine prefix, changed text and suffix
newText = prefix && suffix
newText = prefix && suffix
? prefix + changedText + suffix
: prefix
? (prefix + changedText)
? (prefix + changedText)
: (changedText + suffix);
}
@ -1928,7 +1942,7 @@ namespace ts {
return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents:*/ true);
}
function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string {
export function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string {
return useCaseSensitivefileNames
? ((fileName) => fileName)
: ((fileName) => fileName.toLowerCase());
@ -1942,7 +1956,7 @@ namespace ts {
let getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames);
function getKeyFromCompilationSettings(settings: CompilerOptions): string {
return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString()
return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx;
}
function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): FileMap<DocumentRegistryEntry> {
@ -2006,7 +2020,7 @@ namespace ts {
bucket.set(fileName, entry);
}
else {
// We have an entry for this file. However, it may be for a different version of
// We have an entry for this file. However, it may be for a different version of
// the script snapshot. If so, update it appropriately. Otherwise, we can just
// return it as is.
if (entry.sourceFile.version !== version) {
@ -2051,6 +2065,7 @@ namespace ts {
export function preProcessFile(sourceText: string, readImportFiles = true): PreProcessedFileInfo {
let referencedFiles: FileReference[] = [];
let importedFiles: FileReference[] = [];
let ambientExternalModules: string[];
let isNoDefaultLib = false;
function processTripleSlashDirectives(): void {
@ -2068,6 +2083,13 @@ namespace ts {
});
}
function recordAmbientExternalModule(): void {
if (!ambientExternalModules) {
ambientExternalModules = [];
}
ambientExternalModules.push(scanner.getTokenValue());
}
function recordModuleName() {
let importPath = scanner.getTokenValue();
let pos = scanner.getTokenPos();
@ -2093,7 +2115,18 @@ namespace ts {
// export {a as b} from "mod"
while (token !== SyntaxKind.EndOfFileToken) {
if (token === SyntaxKind.ImportKeyword) {
if (token === SyntaxKind.DeclareKeyword) {
// declare module "mod"
token = scanner.scan();
if (token === SyntaxKind.ModuleKeyword) {
token = scanner.scan();
if (token === SyntaxKind.StringLiteral) {
recordAmbientExternalModule();
continue;
}
}
}
else if (token === SyntaxKind.ImportKeyword) {
token = scanner.scan();
if (token === SyntaxKind.StringLiteral) {
// import "mod";
@ -2101,7 +2134,7 @@ namespace ts {
continue;
}
else {
if (token === SyntaxKind.Identifier) {
if (token === SyntaxKind.Identifier || isKeyword(token)) {
token = scanner.scan();
if (token === SyntaxKind.FromKeyword) {
token = scanner.scan();
@ -2158,7 +2191,7 @@ namespace ts {
token = scanner.scan();
if (token === SyntaxKind.AsKeyword) {
token = scanner.scan();
if (token === SyntaxKind.Identifier) {
if (token === SyntaxKind.Identifier || isKeyword(token)) {
token = scanner.scan();
if (token === SyntaxKind.FromKeyword) {
token = scanner.scan();
@ -2214,7 +2247,7 @@ namespace ts {
processImport();
}
processTripleSlashDirectives();
return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib };
return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules };
}
/// Helpers
@ -2521,18 +2554,22 @@ namespace ts {
return;
}
// IMPORTANT - It is critical from this moment onward that we do not check
// IMPORTANT - It is critical from this moment onward that we do not check
// cancellation tokens. We are about to mutate source files from a previous program
// instance. If we cancel midway through, we may end up in an inconsistent state where
// the program points to old source files that have been invalidated because of
// the program points to old source files that have been invalidated because of
// incremental parsing.
let oldSettings = program && program.getCompilerOptions();
let newSettings = hostCache.compilationSettings();
let changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target;
let changesInCompilationSettingsAffectSyntax = oldSettings &&
(oldSettings.target !== newSettings.target ||
oldSettings.module !== newSettings.module ||
oldSettings.noResolve !== newSettings.noResolve ||
oldSettings.jsx !== newSettings.jsx);
// Now create a new compiler
let newProgram = createProgram(hostCache.getRootFileNames(), newSettings, {
let compilerHost: CompilerHost = {
getSourceFile: getOrCreateSourceFile,
getCancellationToken: () => cancellationToken,
getCanonicalFileName,
@ -2540,10 +2577,26 @@ namespace ts {
getNewLine: () => getNewLineOrDefaultFromHost(host),
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
writeFile: (fileName, data, writeByteOrderMark) => { },
getCurrentDirectory: () => host.getCurrentDirectory()
});
getCurrentDirectory: () => host.getCurrentDirectory(),
fileExists: (fileName): boolean => {
// stub missing host functionality
Debug.assert(!host.resolveModuleNames);
return hostCache.getOrCreateEntry(fileName) !== undefined;
},
readFile: (fileName): string => {
// stub missing host functionality
let entry = hostCache.getOrCreateEntry(fileName);
return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength());
}
};
// Release any files we have acquired in the old program but are
if (host.resolveModuleNames) {
compilerHost.resolveModuleNames = (moduleNames, containingFile) => host.resolveModuleNames(moduleNames, containingFile)
}
let newProgram = createProgram(hostCache.getRootFileNames(), newSettings, compilerHost, program);
// Release any files we have acquired in the old program but are
// not part of the new program.
if (program) {
let oldSourceFiles = program.getSourceFiles();
@ -2561,7 +2614,7 @@ namespace ts {
program = newProgram;
// Make sure all the nodes in the program are both bound, and have their parent
// Make sure all the nodes in the program are both bound, and have their parent
// pointers set property.
program.getTypeChecker();
return;
@ -2583,7 +2636,7 @@ namespace ts {
// Check if the old program had this file already
let oldSourceFile = program && program.getSourceFile(fileName);
if (oldSourceFile) {
// We already had a source file for this file name. Go to the registry to
// We already had a source file for this file name. Go to the registry to
// ensure that we get the right up to date version of it. We need this to
// address the following 'race'. Specifically, say we have the following:
//
@ -2594,15 +2647,15 @@ namespace ts {
// LS2
//
// Each LS has a reference to file 'foo.ts' at version 1. LS2 then updates
// it's version of 'foo.ts' to version 2. This will cause LS2 and the
// DocumentRegistry to have version 2 of the document. HOwever, LS1 will
// it's version of 'foo.ts' to version 2. This will cause LS2 and the
// DocumentRegistry to have version 2 of the document. HOwever, LS1 will
// have version 1. And *importantly* this source file will be *corrupt*.
// The act of creating version 2 of the file irrevocably damages the version
// 1 file.
//
// So, later when we call into LS1, we need to make sure that it doesn't use
// it's source file any more, and instead defers to DocumentRegistry to get
// either version 1, version 2 (or some other version) depending on what the
// either version 1, version 2 (or some other version) depending on what the
// host says should be used.
return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version);
}
@ -2668,7 +2721,7 @@ namespace ts {
/**
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
* If '-d' enabled, report both semantic and emitter errors
* If '-d' enabled, report both semantic and emitter errors
*/
function getSemanticDiagnostics(fileName: string): Diagnostic[] {
synchronizeHostData();
@ -2676,7 +2729,7 @@ namespace ts {
let targetSourceFile = getValidSourceFile(fileName);
// For JavaScript files, we don't want to report the normal typescript semantic errors.
// Instead, we just report errors for using TypeScript-only constructs from within a
// Instead, we just report errors for using TypeScript-only constructs from within a
// JavaScript file.
if (isJavaScript(fileName)) {
return getJavaScriptSemanticDiagnostics(targetSourceFile);
@ -3056,7 +3109,7 @@ namespace ts {
}
if (isJavaScriptFile && type.flags & TypeFlags.Union) {
// In javascript files, for union types, we don't just get the members that
// In javascript files, for union types, we don't just get the members that
// the individual types have in common, we also include all the members that
// each individual type has. This is because we're going to add all identifiers
// anyways. So we might as well elevate the members that were at least part
@ -3111,10 +3164,10 @@ namespace ts {
// aggregating completion candidates. This is achieved in 'getScopeNode'
// by finding the first node that encompasses a position, accounting for whether a node
// is "complete" to decide whether a position belongs to the node.
//
//
// However, at the end of an identifier, we are interested in the scope of the identifier
// itself, but fall outside of the identifier. For instance:
//
//
// xyz => x$
//
// the cursor is outside of both the 'x' and the arrow function 'xyz => x',
@ -3141,7 +3194,7 @@ namespace ts {
/// TODO filter meaning based on the current context
let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
return true;
}
@ -3279,7 +3332,7 @@ namespace ts {
let rootDeclaration = getRootDeclaration(objectLikeContainer.parent);
if (isVariableLike(rootDeclaration)) {
// We don't want to complete using the type acquired by the shape
// We don't want to complete using the type acquired by the shape
// of the binding pattern; we are only interested in types acquired
// through type declaration or inference.
if (rootDeclaration.initializer || rootDeclaration.type) {
@ -3416,7 +3469,6 @@ namespace ts {
parent.kind === SyntaxKind.JsxExpression &&
parent.parent &&
(parent.parent.kind === SyntaxKind.JsxAttribute)) {
return <JsxOpeningLikeElement>parent.parent.parent;
}
@ -3463,16 +3515,16 @@ namespace ts {
containingNodeKind === SyntaxKind.FunctionDeclaration || // function A<T, |
containingNodeKind === SyntaxKind.InterfaceDeclaration || // interface A<T, |
containingNodeKind === SyntaxKind.ArrayBindingPattern; // var [x, y|
case SyntaxKind.DotToken:
return containingNodeKind === SyntaxKind.ArrayBindingPattern; // var [.|
case SyntaxKind.ColonToken:
return containingNodeKind === SyntaxKind.BindingElement; // var {x :html|
case SyntaxKind.OpenBracketToken:
return containingNodeKind === SyntaxKind.ArrayBindingPattern; // var [x|
case SyntaxKind.OpenParenToken:
return containingNodeKind === SyntaxKind.CatchClause ||
isFunction(containingNodeKind);
@ -3624,7 +3676,7 @@ namespace ts {
return filter(contextualMemberSymbols, m => !lookUp(existingMemberNames, m.name));
}
/**
* Filters out completion suggestions from 'symbols' according to existing JSX attributes.
*
@ -3707,7 +3759,7 @@ namespace ts {
}
function createCompletionEntry(symbol: Symbol, location: Node): CompletionEntry {
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
// We would like to only show things that can be added after a dot, so for instance numeric properties can
// not be accessed with a dot (a.1 <- invalid)
let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true, location);
@ -3715,10 +3767,10 @@ namespace ts {
return undefined;
}
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
// really we should consider passing the meaning for the node so that we don't report
// that a suggestion for a value is an interface. We COULD also just do what
// that a suggestion for a value is an interface. We COULD also just do what
// 'getSymbolModifiers' does, which is to use the first declaration.
// Use a 'sortText' of 0' so that all symbol completion entries come before any other
@ -3764,8 +3816,8 @@ namespace ts {
// Find the symbol with the matching entry name.
let target = program.getCompilerOptions().target;
// We don't need to perform character checks here because we're only comparing the
// name against 'entryName' (which is known to be good), not building a new
// We don't need to perform character checks here because we're only comparing the
// name against 'entryName' (which is known to be good), not building a new
// completion entry.
let symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false, location) === entryName ? s : undefined);
@ -3780,7 +3832,7 @@ namespace ts {
};
}
}
// Didn't find a symbol with this name. See if we can find a keyword instead.
let keywordCompletion = forEach(keywordCompletions, c => c.name === entryName);
if (keywordCompletion) {
@ -3856,7 +3908,7 @@ namespace ts {
Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method));
});
if (!unionPropertyKind) {
// If this was union of all methods,
// If this was union of all methods,
//make sure it has call signatures before we can label it as method
let typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
@ -3930,7 +3982,7 @@ namespace ts {
let allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!contains(allSignatures, signature.target || signature)) {
// Get the first signature if there
// Get the first signature if there
signature = allSignatures.length ? allSignatures[0] : undefined;
}
@ -4306,7 +4358,7 @@ namespace ts {
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
// Just add all the declarations.
// Just add all the declarations.
forEach(declarations, declaration => {
result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName));
});
@ -4417,7 +4469,7 @@ namespace ts {
// Because name in short-hand property assignment has two different meanings: property name and property value,
// using go-to-definition at such position should go to the variable declaration of the property value rather than
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
@ -4483,7 +4535,7 @@ namespace ts {
if (results) {
let sourceFile = getCanonicalFileName(normalizeSlashes(fileName));
// Get occurrences only supports reporting occurrences for the file queried. So
// Get occurrences only supports reporting occurrences for the file queried. So
// filter down to that list.
results = filter(results, r => getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile);
}
@ -4710,7 +4762,7 @@ namespace ts {
if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) {
return parent;
}
// A throw-statement is only owned by a try-statement if the try-statement has
// a catch clause, and if the throw-statement occurs within the try block.
if (parent.kind === SyntaxKind.TryStatement) {
@ -4804,7 +4856,7 @@ namespace ts {
return undefined;
}
}
else {
else {
// unsupported modifier
return undefined;
}
@ -5400,13 +5452,13 @@ namespace ts {
// If we are past the end, stop looking
if (position > end) break;
// We found a match. Make sure it's not part of a larger word (i.e. the char
// We found a match. Make sure it's not part of a larger word (i.e. the char
// before and after it have to be a non-identifier char).
let endPosition = position + symbolNameLength;
if ((position === 0 || !isIdentifierPart(text.charCodeAt(position - 1), ScriptTarget.Latest)) &&
(endPosition === sourceLength || !isIdentifierPart(text.charCodeAt(endPosition), ScriptTarget.Latest))) {
// Found a real match. Keep searching.
// Found a real match. Keep searching.
positions.push(position);
}
position = text.indexOf(symbolName, position + symbolNameLength + 1);
@ -5473,9 +5525,9 @@ namespace ts {
return false;
}
/** Search within node "container" for references for a search value, where the search value is defined as a
/** Search within node "container" for references for a search value, where the search value is defined as a
* tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
* searchLocation: a node where the search value
* searchLocation: a node where the search value
*/
function getReferencesInNode(container: Node,
searchSymbol: Symbol,
@ -5501,7 +5553,7 @@ namespace ts {
let referenceLocation = getTouchingPropertyName(sourceFile, position);
if (!isValidReferencePosition(referenceLocation, searchText)) {
// This wasn't the start of a token. Check to see if it might be a
// This wasn't the start of a token. Check to see if it might be a
// match in a comment or string if that's what the caller is asking
// for.
if ((findInStrings && isInString(sourceFile, position)) ||
@ -5826,7 +5878,7 @@ namespace ts {
}
}
// If the reference location is in an object literal, try to get the contextual type for the
// If the reference location is in an object literal, try to get the contextual type for the
// object literal, lookup the property symbol in the contextual type, and use this symbol to
// compare to our searchSymbol
if (isNameOfPropertyAssignment(referenceLocation)) {
@ -5843,7 +5895,7 @@ namespace ts {
return rootSymbol;
}
// Finally, try all properties with the same name in any type the containing type extended or implemented, and
// Finally, try all properties with the same name in any type the containing type extended or implemented, and
// see if any is in the list
if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
let result: Symbol[] = [];
@ -6194,7 +6246,7 @@ namespace ts {
}
else if (isNameOfModuleDeclaration(nodeForStartPos)) {
// If this is name of a module declarations, check if this is right side of dotted module name
// If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of
// If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of
// Then this name is name from dotted module
if (nodeForStartPos.parent.parent.kind === SyntaxKind.ModuleDeclaration &&
(<ModuleDeclaration>nodeForStartPos.parent.parent).body === nodeForStartPos.parent) {
@ -6237,7 +6289,7 @@ namespace ts {
// been canceled. That would be an enormous amount of chattyness, along with the all
// the overhead of marshalling the data to/from the host. So instead we pick a few
// reasonable node kinds to bother checking on. These node kinds represent high level
// constructs that we would expect to see commonly, but just at a far less frequent
// constructs that we would expect to see commonly, but just at a far less frequent
// interval.
//
// For example, in checker.ts (around 750k) we only have around 600 of these constructs.
@ -6310,7 +6362,7 @@ namespace ts {
*/
function hasValueSideModule(symbol: Symbol): boolean {
return forEach(symbol.declarations, declaration => {
return declaration.kind === SyntaxKind.ModuleDeclaration &&
return declaration.kind === SyntaxKind.ModuleDeclaration &&
getModuleInstanceState(declaration) === ModuleInstanceState.Instantiated;
});
}
@ -6431,8 +6483,8 @@ namespace ts {
// Only bother with the trivia if it at least intersects the span of interest.
if (isComment(kind)) {
classifyComment(token, kind, start, width);
// Classifying a comment might cause us to reuse the trivia scanner
// Classifying a comment might cause us to reuse the trivia scanner
// (because of jsdoc comments). So after we classify the comment make
// sure we set the scanner position back to where it needs to be.
triviaScanner.setTextPos(end);
@ -6483,7 +6535,7 @@ namespace ts {
for (let tag of docComment.tags) {
// As we walk through each tag, classify the portion of text from the end of
// the last tag (or the start of the entire doc comment) as 'comment'.
// the last tag (or the start of the entire doc comment) as 'comment'.
if (tag.pos !== pos) {
pushCommentRange(pos, tag.pos - pos);
}
@ -6545,7 +6597,7 @@ namespace ts {
}
function classifyDisabledMergeCode(text: string, start: number, end: number) {
// Classify the line that the ======= marker is on as a comment. Then just lex
// Classify the line that the ======= marker is on as a comment. Then just lex
// all further tokens and add them to the result.
for (var i = start; i < end; i++) {
if (isLineBreak(text.charCodeAt(i))) {
@ -6588,7 +6640,7 @@ namespace ts {
}
}
// for accurate classification, the actual token should be passed in. however, for
// for accurate classification, the actual token should be passed in. however, for
// cases like 'disabled merge code' classification, we just get the token kind and
// classify based on that instead.
function classifyTokenType(tokenKind: SyntaxKind, token?: Node): ClassificationType {
@ -6875,11 +6927,11 @@ namespace ts {
}
function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] {
// Note: while getting todo comments seems like a syntactic operation, we actually
// Note: while getting todo comments seems like a syntactic operation, we actually
// treat it as a semantic operation here. This is because we expect our host to call
// this on every single file. If we treat this syntactically, then that will cause
// us to populate and throw away the tree in our syntax tree cache for each file. By
// treating this as a semantic operation, we can access any tree without throwing
// treating this as a semantic operation, we can access any tree without throwing
// anything away.
synchronizeHostData();
@ -6909,7 +6961,7 @@ namespace ts {
// 0) The full match for the entire regexp.
// 1) The preamble to the message portion.
// 2) The message portion.
// 3...N) The descriptor that was matched - by index. 'undefined' for each
// 3...N) The descriptor that was matched - by index. 'undefined' for each
// descriptor that didn't match. an actual value if it did match.
//
// i.e. 'undefined' in position 3 above means TODO(jason) didn't match.
@ -6935,7 +6987,7 @@ namespace ts {
}
Debug.assert(descriptor !== undefined);
// We don't want to match something like 'TODOBY', so we make sure a non
// We don't want to match something like 'TODOBY', so we make sure a non
// letter/digit follows the match.
if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) {
continue;
@ -6987,11 +7039,11 @@ namespace ts {
// (?:(TODO\(jason\))|(HACK))
//
// Note that the outermost group is *not* a capture group, but the innermost groups
// *are* capture groups. By capturing the inner literals we can determine after
// *are* capture groups. By capturing the inner literals we can determine after
// matching which descriptor we are dealing with.
let literals = "(?:" + map(descriptors, d => "(" + escapeRegExp(d.text) + ")").join("|") + ")";
// After matching a descriptor literal, the following regexp matches the rest of the
// After matching a descriptor literal, the following regexp matches the rest of the
// text up to the end of the line (or */).
let endOfLineOrEndOfComment = /(?:$|\*\/)/.source
let messageRemainder = /(?:.*?)/.source
@ -7174,7 +7226,7 @@ namespace ts {
/// We do not have a full parser support to know when we should parse a regex or not
/// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where
/// we have a series of divide operator. this list allows us to be more accurate by ruling out
/// we have a series of divide operator. this list allows us to be more accurate by ruling out
/// locations where a regexp cannot exist.
let noRegexTable: boolean[] = [];
noRegexTable[SyntaxKind.Identifier] = true;
@ -7220,7 +7272,7 @@ namespace ts {
keyword2 === SyntaxKind.ConstructorKeyword ||
keyword2 === SyntaxKind.StaticKeyword) {
// Allow things like "public get", "public constructor" and "public static".
// Allow things like "public get", "public constructor" and "public static".
// These are all legal.
return true;
}
@ -7291,7 +7343,7 @@ namespace ts {
function getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult {
return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text);
}
// If there is a syntactic classifier ('syntacticClassifierAbsent' is false),
// we will be more conservative in order to avoid conflicting with the syntactic classifier.
function getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications {
@ -7353,12 +7405,12 @@ namespace ts {
// token. So the classification will go back to being an identifier. The moment the user
// types again, number will become a keyword, then an identifier, etc. etc.
//
// To try to avoid this problem, we avoid classifying contextual keywords as keywords
// To try to avoid this problem, we avoid classifying contextual keywords as keywords
// when the user is potentially typing something generic. We just can't do a good enough
// job at the lexical level, and so well leave it up to the syntactic classifier to make
// the determination.
//
// In order to determine if the user is potentially typing something generic, we use a
// In order to determine if the user is potentially typing something generic, we use a
// weak heuristic where we track < and > tokens. It's a weak heuristic, but should
// work well enough in practice.
let angleBracketStack = 0;
@ -7376,7 +7428,7 @@ namespace ts {
token = SyntaxKind.Identifier;
}
else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) {
// We have two keywords in a row. Only treat the second as a keyword if
// We have two keywords in a row. Only treat the second as a keyword if
// it's a sequence that could legally occur in the language. Otherwise
// treat it as an identifier. This way, if someone writes "private var"
// we recognize that 'var' is actually an identifier here.
@ -7384,7 +7436,7 @@ namespace ts {
}
else if (lastNonTriviaToken === SyntaxKind.Identifier &&
token === SyntaxKind.LessThanToken) {
// Could be the start of something generic. Keep track of that by bumping
// Could be the start of something generic. Keep track of that by bumping
// up the current count of generic contexts we may be in.
angleBracketStack++;
}
@ -7399,7 +7451,7 @@ namespace ts {
token === SyntaxKind.BooleanKeyword ||
token === SyntaxKind.SymbolKeyword) {
if (angleBracketStack > 0 && !syntacticClassifierAbsent) {
// If it looks like we're could be in something generic, don't classify this
// If it looks like we're could be in something generic, don't classify this
// as a keyword. We may just get overwritten by the syntactic classifier,
// causing a noisy experience for the user.
token = SyntaxKind.Identifier;
@ -7507,8 +7559,8 @@ namespace ts {
}
if (start === 0 && offset > 0) {
// We're classifying the first token, and this was a case where we prepended
// text. We should consider the start of this token to be at the start of
// We're classifying the first token, and this was a case where we prepended
// text. We should consider the start of this token to be at the start of
// the original text.
start += offset;
}
@ -7631,11 +7683,11 @@ namespace ts {
/// getDefaultLibraryFilePath
declare let __dirname: string;
/**
* Get the path of the default library files (lib.d.ts) as distributed with the typescript
* node package.
* The functionality is not supported if the ts module is consumed outside of a node module.
* The functionality is not supported if the ts module is consumed outside of a node module.
*/
export function getDefaultLibFilePath(options: CompilerOptions): string {
// Check __dirname is defined and that we are on a node.js system.

View File

@ -60,10 +60,12 @@ namespace ts {
getNewLine?(): string;
getProjectVersion?(): string;
useCaseSensitiveFileNames?(): boolean;
getModuleResolutionsForFile?(fileName: string): string;
}
/** Public interface of the the of a config service shim instance.*/
export interface CoreServicesShimHost extends Logger {
export interface CoreServicesShimHost extends Logger, ModuleResolutionHost {
/**
* Returns a JSON-encoded value of the type: string[]
*
@ -270,8 +272,18 @@ namespace ts {
private files: string[];
private loggingEnabled = false;
private tracingEnabled = false;
public resolveModuleNames: (moduleName: string[], containingFile: string) => string[];
constructor(private shimHost: LanguageServiceShimHost) {
// if shimHost is a COM object then property check will become method call with no arguments.
// 'in' does not have this effect.
if ("getModuleResolutionsForFile" in this.shimHost) {
this.resolveModuleNames = (moduleNames: string[], containingFile: string) => {
let resolutionsInFile = <Map<string>>JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile));
return map(moduleNames, name => lookUp(resolutionsInFile, name));
};
}
}
public log(s: string): void {
@ -410,6 +422,14 @@ namespace ts {
}
return JSON.parse(encoded);
}
public fileExists(fileName: string): boolean {
return this.shimHost.fileExists(fileName);
}
public readFile(fileName: string): string {
return this.shimHost.readFile(fileName);
}
}
function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any, logPerformance: boolean): any {
@ -918,6 +938,13 @@ namespace ts {
private forwardJSONCall(actionDescription: string, action: () => any): any {
return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);
}
public resolveModuleName(fileName: string, moduleName: string, compilerOptionsJson: string): string {
return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => {
let compilerOptions = <CompilerOptions>JSON.parse(compilerOptionsJson);
return resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host);
});
}
public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string {
return this.forwardJSONCall(
@ -927,6 +954,7 @@ namespace ts {
var convertResult = {
referencedFiles: <IFileReference[]>[],
importedFiles: <IFileReference[]>[],
ambientExternalModules: result.ambientExternalModules,
isLibFile: result.isLibFile
};

View File

@ -0,0 +1,23 @@
//// [tests/cases/compiler/commonjsSafeImport.ts] ////
//// [10_lib.ts]
export function Foo() {}
//// [main.ts]
import { Foo } from './10_lib';
Foo();
//// [10_lib.js]
function Foo() { }
exports.Foo = Foo;
//// [main.js]
var _10_lib_1 = require('./10_lib');
_10_lib_1.Foo();
//// [10_lib.d.ts]
export declare function Foo(): void;
//// [main.d.ts]

View File

@ -0,0 +1,12 @@
=== tests/cases/compiler/10_lib.ts ===
export function Foo() {}
>Foo : Symbol(Foo, Decl(10_lib.ts, 0, 0))
=== tests/cases/compiler/main.ts ===
import { Foo } from './10_lib';
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))
Foo();
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))

View File

@ -0,0 +1,13 @@
=== tests/cases/compiler/10_lib.ts ===
export function Foo() {}
>Foo : () => void
=== tests/cases/compiler/main.ts ===
import { Foo } from './10_lib';
>Foo : () => void
Foo();
>Foo() : void
>Foo : () => void

View File

@ -1,2 +1,2 @@
//// [computedPropertyNamesSourceMap2_ES5.js.map]
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"}
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC,GAAT;QACIA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"}

View File

@ -28,26 +28,28 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
2 > ^^^
3 > ^^^^^^^
4 > ^
5 > ^^^->
5 > ^^^
1->{
>
2 > [
3 > "hello"
4 > ]
5 >
1->Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0)
3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0)
5 >Emitted(2, 19) Source(2, 5) + SourceIndex(0)
---
>>> debugger;
1->^^^^^^^^
1 >^^^^^^^^
2 > ^^^^^^^^
3 > ^
1->() {
1 >["hello"]() {
>
2 > debugger
3 > ;
1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"])
1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"])
2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (["hello"])
3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) name (["hello"])
---

File diff suppressed because one or more lines are too long

View File

@ -10,8 +10,7 @@ sourceFile:contextualTyping.ts
-------------------------------------------------------------------
>>>// CONTEXT: Class property declaration
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >// DEFAULT INTERFACES
>interface IFoo {
> n: number;
@ -24,21 +23,23 @@ sourceFile:contextualTyping.ts
> foo: IFoo;
>}
>
>// CONTEXT: Class property declaration
>
2 >
3 >// CONTEXT: Class property declaration
1 >Emitted(1, 1) Source(14, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(13, 1) + SourceIndex(0)
3 >Emitted(1, 39) Source(13, 39) + SourceIndex(0)
2 >// CONTEXT: Class property declaration
1 >Emitted(1, 1) Source(13, 1) + SourceIndex(0)
2 >Emitted(1, 39) Source(13, 39) + SourceIndex(0)
---
>>>var C1T5 = (function () {
>>> function C1T5() {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0)
---
>>> function C1T5() {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
---
>>> this.foo = function (i) {
1->^^^^^^^^
@ -127,17 +128,13 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Module property declaration
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>// CONTEXT: Module property declaration
>
2 >
3 >// CONTEXT: Module property declaration
1->Emitted(10, 1) Source(21, 1) + SourceIndex(0)
2 >Emitted(10, 1) Source(20, 1) + SourceIndex(0)
3 >Emitted(10, 40) Source(20, 40) + SourceIndex(0)
2 >// CONTEXT: Module property declaration
1->Emitted(10, 1) Source(20, 1) + SourceIndex(0)
2 >Emitted(10, 40) Source(20, 40) + SourceIndex(0)
---
>>>var C2T5;
1 >
@ -257,66 +254,65 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Variable declaration
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^->
1->
>
>// CONTEXT: Variable declaration
>
2 >
3 >// CONTEXT: Variable declaration
1->Emitted(17, 1) Source(28, 1) + SourceIndex(0)
2 >Emitted(17, 1) Source(27, 1) + SourceIndex(0)
3 >Emitted(17, 33) Source(27, 33) + SourceIndex(0)
2 >// CONTEXT: Variable declaration
1->Emitted(17, 1) Source(27, 1) + SourceIndex(0)
2 >Emitted(17, 33) Source(27, 33) + SourceIndex(0)
---
>>>var c3t1 = (function (s) { return s; });
1->^^^^
2 > ^^^^
3 > ^^^
4 > ^
5 > ^^^^^^^^^^
6 > ^
7 > ^^^^
8 > ^^^^^^
9 > ^
10> ^
11> ^
12> ^
13> ^
14> ^
15> ^
1->
2 >^^^^
3 > ^^^^
4 > ^^^
5 > ^
6 > ^^^^^^^^^^
7 > ^
8 > ^^^^
9 > ^^^^^^
10> ^
11> ^
12> ^
13> ^
14> ^
15> ^
16> ^
1->
>var
2 > c3t1
3 > : (s: string) => string =
4 > (
5 > function(
6 > s
7 > ) {
8 > return
9 >
10> s
11>
12>
13> }
14> )
15> ;
1->Emitted(18, 5) Source(28, 5) + SourceIndex(0)
2 >Emitted(18, 9) Source(28, 9) + SourceIndex(0)
3 >Emitted(18, 12) Source(28, 35) + SourceIndex(0)
4 >Emitted(18, 13) Source(28, 36) + SourceIndex(0)
5 >Emitted(18, 23) Source(28, 45) + SourceIndex(0)
6 >Emitted(18, 24) Source(28, 46) + SourceIndex(0)
7 >Emitted(18, 28) Source(28, 50) + SourceIndex(0)
8 >Emitted(18, 34) Source(28, 56) + SourceIndex(0)
9 >Emitted(18, 35) Source(28, 57) + SourceIndex(0)
10>Emitted(18, 36) Source(28, 58) + SourceIndex(0)
11>Emitted(18, 37) Source(28, 58) + SourceIndex(0)
12>Emitted(18, 38) Source(28, 59) + SourceIndex(0)
13>Emitted(18, 39) Source(28, 60) + SourceIndex(0)
14>Emitted(18, 40) Source(28, 61) + SourceIndex(0)
15>Emitted(18, 41) Source(28, 62) + SourceIndex(0)
>
2 >var
3 > c3t1
4 > : (s: string) => string =
5 > (
6 > function(
7 > s
8 > ) {
9 > return
10>
11> s
12>
13>
14> }
15> )
16> ;
1->Emitted(18, 1) Source(28, 1) + SourceIndex(0)
2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0)
3 >Emitted(18, 9) Source(28, 9) + SourceIndex(0)
4 >Emitted(18, 12) Source(28, 35) + SourceIndex(0)
5 >Emitted(18, 13) Source(28, 36) + SourceIndex(0)
6 >Emitted(18, 23) Source(28, 45) + SourceIndex(0)
7 >Emitted(18, 24) Source(28, 46) + SourceIndex(0)
8 >Emitted(18, 28) Source(28, 50) + SourceIndex(0)
9 >Emitted(18, 34) Source(28, 56) + SourceIndex(0)
10>Emitted(18, 35) Source(28, 57) + SourceIndex(0)
11>Emitted(18, 36) Source(28, 58) + SourceIndex(0)
12>Emitted(18, 37) Source(28, 58) + SourceIndex(0)
13>Emitted(18, 38) Source(28, 59) + SourceIndex(0)
14>Emitted(18, 39) Source(28, 60) + SourceIndex(0)
15>Emitted(18, 40) Source(28, 61) + SourceIndex(0)
16>Emitted(18, 41) Source(28, 62) + SourceIndex(0)
---
>>>var c3t2 = ({
1 >
@ -945,27 +941,28 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Class property assignment
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>// CONTEXT: Class property assignment
>
2 >
3 >// CONTEXT: Class property assignment
1->Emitted(40, 1) Source(56, 1) + SourceIndex(0)
2 >Emitted(40, 1) Source(55, 1) + SourceIndex(0)
3 >Emitted(40, 38) Source(55, 38) + SourceIndex(0)
2 >// CONTEXT: Class property assignment
1->Emitted(40, 1) Source(55, 1) + SourceIndex(0)
2 >Emitted(40, 38) Source(55, 38) + SourceIndex(0)
---
>>>var C4T5 = (function () {
>>> function C4T5() {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >^^^^^^^^^^^^^^^^^^^^^^->
1 >
>class C4T5 {
>
1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0)
---
>>> function C4T5() {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->class C4T5 {
> foo: (i: number, s: string) => string;
>
1 >Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
1->Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
---
>>> this.foo = function (i, s) {
1->^^^^^^^^
@ -1070,17 +1067,13 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Module property assignment
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>// CONTEXT: Module property assignment
>
2 >
3 >// CONTEXT: Module property assignment
1->Emitted(49, 1) Source(66, 1) + SourceIndex(0)
2 >Emitted(49, 1) Source(65, 1) + SourceIndex(0)
3 >Emitted(49, 39) Source(65, 39) + SourceIndex(0)
2 >// CONTEXT: Module property assignment
1->Emitted(49, 1) Source(65, 1) + SourceIndex(0)
2 >Emitted(49, 39) Source(65, 39) + SourceIndex(0)
---
>>>var C5T5;
1 >
@ -1209,30 +1202,29 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Variable assignment
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>// CONTEXT: Variable assignment
>
2 >
3 >// CONTEXT: Variable assignment
1->Emitted(56, 1) Source(74, 1) + SourceIndex(0)
2 >Emitted(56, 1) Source(73, 1) + SourceIndex(0)
3 >Emitted(56, 32) Source(73, 32) + SourceIndex(0)
2 >// CONTEXT: Variable assignment
1->Emitted(56, 1) Source(73, 1) + SourceIndex(0)
2 >Emitted(56, 32) Source(73, 32) + SourceIndex(0)
---
>>>var c6t5;
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >^^^^
3 > ^^^^
4 > ^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>var
2 > c6t5: (n: number) => IFoo
3 > ;
1 >Emitted(57, 5) Source(74, 5) + SourceIndex(0)
2 >Emitted(57, 9) Source(74, 30) + SourceIndex(0)
3 >Emitted(57, 10) Source(74, 31) + SourceIndex(0)
>
2 >var
3 > c6t5: (n: number) => IFoo
4 > ;
1 >Emitted(57, 1) Source(74, 1) + SourceIndex(0)
2 >Emitted(57, 5) Source(74, 5) + SourceIndex(0)
3 >Emitted(57, 9) Source(74, 30) + SourceIndex(0)
4 >Emitted(57, 10) Source(74, 31) + SourceIndex(0)
---
>>>c6t5 = function (n) { return ({}); };
1->
@ -1284,30 +1276,29 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Array index assignment
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
>
>// CONTEXT: Array index assignment
>
2 >
3 >// CONTEXT: Array index assignment
1 >Emitted(59, 1) Source(78, 1) + SourceIndex(0)
2 >Emitted(59, 1) Source(77, 1) + SourceIndex(0)
3 >Emitted(59, 35) Source(77, 35) + SourceIndex(0)
2 >// CONTEXT: Array index assignment
1 >Emitted(59, 1) Source(77, 1) + SourceIndex(0)
2 >Emitted(59, 35) Source(77, 35) + SourceIndex(0)
---
>>>var c7t2;
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^^^^^->
1 >
2 >^^^^
3 > ^^^^
4 > ^
5 > ^^^^^^^^^^^^^->
1 >
>var
2 > c7t2: IFoo[]
3 > ;
1 >Emitted(60, 5) Source(78, 5) + SourceIndex(0)
2 >Emitted(60, 9) Source(78, 17) + SourceIndex(0)
3 >Emitted(60, 10) Source(78, 18) + SourceIndex(0)
>
2 >var
3 > c7t2: IFoo[]
4 > ;
1 >Emitted(60, 1) Source(78, 1) + SourceIndex(0)
2 >Emitted(60, 5) Source(78, 5) + SourceIndex(0)
3 >Emitted(60, 9) Source(78, 17) + SourceIndex(0)
4 >Emitted(60, 10) Source(78, 18) + SourceIndex(0)
---
>>>c7t2[0] = ({ n: 1 });
1->
@ -2140,31 +2131,30 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Function call
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>// CONTEXT: Function call
>
2 >
3 >// CONTEXT: Function call
1->Emitted(85, 1) Source(146, 1) + SourceIndex(0)
2 >Emitted(85, 1) Source(145, 1) + SourceIndex(0)
3 >Emitted(85, 26) Source(145, 26) + SourceIndex(0)
2 >// CONTEXT: Function call
1->Emitted(85, 1) Source(145, 1) + SourceIndex(0)
2 >Emitted(85, 26) Source(145, 26) + SourceIndex(0)
---
>>>function c9t5(f) { }
1 >^^^^^^^^^^^^^^
2 > ^
3 > ^^^^
4 > ^
1 >
2 >^^^^^^^^^^^^^^
3 > ^
4 > ^^^^
5 > ^
1 >
>function c9t5(
2 > f: (n: number) => IFoo
3 > ) {
4 > }
1 >Emitted(86, 15) Source(146, 15) + SourceIndex(0)
2 >Emitted(86, 16) Source(146, 37) + SourceIndex(0)
3 >Emitted(86, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
4 >Emitted(86, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
>
2 >function c9t5(
3 > f: (n: number) => IFoo
4 > ) {
5 > }
1 >Emitted(86, 1) Source(146, 1) + SourceIndex(0)
2 >Emitted(86, 15) Source(146, 15) + SourceIndex(0)
3 >Emitted(86, 16) Source(146, 37) + SourceIndex(0)
4 >Emitted(86, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
5 >Emitted(86, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
---
>>>;
1 >
@ -2236,107 +2226,107 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Return statement
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
>
>// CONTEXT: Return statement
>
2 >
3 >// CONTEXT: Return statement
1->Emitted(91, 1) Source(152, 1) + SourceIndex(0)
2 >Emitted(91, 1) Source(151, 1) + SourceIndex(0)
3 >Emitted(91, 29) Source(151, 29) + SourceIndex(0)
2 >// CONTEXT: Return statement
1->Emitted(91, 1) Source(151, 1) + SourceIndex(0)
2 >Emitted(91, 29) Source(151, 29) + SourceIndex(0)
---
>>>var c10t5 = function () { return function (n) { return ({}); }; };
1->^^^^
2 > ^^^^^
3 > ^^^
4 > ^^^^^^^^^^^^^^
5 > ^^^^^^
6 > ^
7 > ^^^^^^^^^^
8 > ^
9 > ^^^^
10> ^^^^^^
11> ^
12> ^
13> ^^
14> ^
15> ^
16> ^
17> ^
18> ^
19> ^
20> ^
21> ^
1->
2 >^^^^
3 > ^^^^^
4 > ^^^
5 > ^^^^^^^^^^^^^^
6 > ^^^^^^
7 > ^
8 > ^^^^^^^^^^
9 > ^
10> ^^^^
11> ^^^^^^
12> ^
13> ^
14> ^^
15> ^
16> ^
17> ^
18> ^
19> ^
20> ^
21> ^
22> ^
1->
>var
2 > c10t5
3 > : () => (n: number) => IFoo =
4 > function() {
5 > return
6 >
7 > function(
8 > n
9 > ) {
10> return
11> <IFoo>
12> (
13> {}
14> )
15>
16>
17> }
18>
19>
20> }
21> ;
1->Emitted(92, 5) Source(152, 5) + SourceIndex(0)
2 >Emitted(92, 10) Source(152, 10) + SourceIndex(0)
3 >Emitted(92, 13) Source(152, 40) + SourceIndex(0)
4 >Emitted(92, 27) Source(152, 53) + SourceIndex(0)
5 >Emitted(92, 33) Source(152, 59) + SourceIndex(0)
6 >Emitted(92, 34) Source(152, 60) + SourceIndex(0)
7 >Emitted(92, 44) Source(152, 69) + SourceIndex(0)
8 >Emitted(92, 45) Source(152, 70) + SourceIndex(0)
9 >Emitted(92, 49) Source(152, 74) + SourceIndex(0)
10>Emitted(92, 55) Source(152, 80) + SourceIndex(0)
11>Emitted(92, 56) Source(152, 87) + SourceIndex(0)
12>Emitted(92, 57) Source(152, 88) + SourceIndex(0)
13>Emitted(92, 59) Source(152, 90) + SourceIndex(0)
14>Emitted(92, 60) Source(152, 91) + SourceIndex(0)
15>Emitted(92, 61) Source(152, 91) + SourceIndex(0)
16>Emitted(92, 62) Source(152, 92) + SourceIndex(0)
17>Emitted(92, 63) Source(152, 93) + SourceIndex(0)
18>Emitted(92, 64) Source(152, 93) + SourceIndex(0)
19>Emitted(92, 65) Source(152, 94) + SourceIndex(0)
20>Emitted(92, 66) Source(152, 95) + SourceIndex(0)
21>Emitted(92, 67) Source(152, 96) + SourceIndex(0)
>
2 >var
3 > c10t5
4 > : () => (n: number) => IFoo =
5 > function() {
6 > return
7 >
8 > function(
9 > n
10> ) {
11> return
12> <IFoo>
13> (
14> {}
15> )
16>
17>
18> }
19>
20>
21> }
22> ;
1->Emitted(92, 1) Source(152, 1) + SourceIndex(0)
2 >Emitted(92, 5) Source(152, 5) + SourceIndex(0)
3 >Emitted(92, 10) Source(152, 10) + SourceIndex(0)
4 >Emitted(92, 13) Source(152, 40) + SourceIndex(0)
5 >Emitted(92, 27) Source(152, 53) + SourceIndex(0)
6 >Emitted(92, 33) Source(152, 59) + SourceIndex(0)
7 >Emitted(92, 34) Source(152, 60) + SourceIndex(0)
8 >Emitted(92, 44) Source(152, 69) + SourceIndex(0)
9 >Emitted(92, 45) Source(152, 70) + SourceIndex(0)
10>Emitted(92, 49) Source(152, 74) + SourceIndex(0)
11>Emitted(92, 55) Source(152, 80) + SourceIndex(0)
12>Emitted(92, 56) Source(152, 87) + SourceIndex(0)
13>Emitted(92, 57) Source(152, 88) + SourceIndex(0)
14>Emitted(92, 59) Source(152, 90) + SourceIndex(0)
15>Emitted(92, 60) Source(152, 91) + SourceIndex(0)
16>Emitted(92, 61) Source(152, 91) + SourceIndex(0)
17>Emitted(92, 62) Source(152, 92) + SourceIndex(0)
18>Emitted(92, 63) Source(152, 93) + SourceIndex(0)
19>Emitted(92, 64) Source(152, 93) + SourceIndex(0)
20>Emitted(92, 65) Source(152, 94) + SourceIndex(0)
21>Emitted(92, 66) Source(152, 95) + SourceIndex(0)
22>Emitted(92, 67) Source(152, 96) + SourceIndex(0)
---
>>>// CONTEXT: Newing a class
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1 >
>
>// CONTEXT: Newing a class
>
2 >
3 >// CONTEXT: Newing a class
1 >Emitted(93, 1) Source(155, 1) + SourceIndex(0)
2 >Emitted(93, 1) Source(154, 1) + SourceIndex(0)
3 >Emitted(93, 27) Source(154, 27) + SourceIndex(0)
2 >// CONTEXT: Newing a class
1 >Emitted(93, 1) Source(154, 1) + SourceIndex(0)
2 >Emitted(93, 27) Source(154, 27) + SourceIndex(0)
---
>>>var C11t5 = (function () {
1->
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
1->
>
1->Emitted(94, 1) Source(155, 1) + SourceIndex(0)
---
>>> function C11t5(f) {
1->^^^^
2 > ^^^^^^^^^^^^^^^
3 > ^
1->
>class C11t5 {
1->class C11t5 {
2 > constructor(
3 > f: (n: number) => IFoo
1->Emitted(95, 5) Source(155, 15) + SourceIndex(0) name (C11t5)
@ -2448,66 +2438,65 @@ sourceFile:contextualTyping.ts
---
>>>// CONTEXT: Type annotated expression
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^->
1 >
>
>// CONTEXT: Type annotated expression
>
2 >
3 >// CONTEXT: Type annotated expression
1 >Emitted(101, 1) Source(159, 1) + SourceIndex(0)
2 >Emitted(101, 1) Source(158, 1) + SourceIndex(0)
3 >Emitted(101, 38) Source(158, 38) + SourceIndex(0)
2 >// CONTEXT: Type annotated expression
1 >Emitted(101, 1) Source(158, 1) + SourceIndex(0)
2 >Emitted(101, 38) Source(158, 38) + SourceIndex(0)
---
>>>var c12t1 = (function (s) { return s; });
1->^^^^
2 > ^^^^^
3 > ^^^
4 > ^
5 > ^^^^^^^^^^
6 > ^
7 > ^^^^
8 > ^^^^^^
9 > ^
10> ^
11> ^
12> ^
13> ^
14> ^
15> ^
1->
2 >^^^^
3 > ^^^^^
4 > ^^^
5 > ^
6 > ^^^^^^^^^^
7 > ^
8 > ^^^^
9 > ^^^^^^
10> ^
11> ^
12> ^
13> ^
14> ^
15> ^
16> ^
1->
>var
2 > c12t1
3 > = <(s: string) => string>
4 > (
5 > function(
6 > s
7 > ) {
8 > return
9 >
10> s
11>
12>
13> }
14> )
15> ;
1->Emitted(102, 5) Source(159, 5) + SourceIndex(0)
2 >Emitted(102, 10) Source(159, 10) + SourceIndex(0)
3 >Emitted(102, 13) Source(159, 37) + SourceIndex(0)
4 >Emitted(102, 14) Source(159, 38) + SourceIndex(0)
5 >Emitted(102, 24) Source(159, 47) + SourceIndex(0)
6 >Emitted(102, 25) Source(159, 48) + SourceIndex(0)
7 >Emitted(102, 29) Source(159, 52) + SourceIndex(0)
8 >Emitted(102, 35) Source(159, 58) + SourceIndex(0)
9 >Emitted(102, 36) Source(159, 59) + SourceIndex(0)
10>Emitted(102, 37) Source(159, 60) + SourceIndex(0)
11>Emitted(102, 38) Source(159, 60) + SourceIndex(0)
12>Emitted(102, 39) Source(159, 61) + SourceIndex(0)
13>Emitted(102, 40) Source(159, 62) + SourceIndex(0)
14>Emitted(102, 41) Source(159, 63) + SourceIndex(0)
15>Emitted(102, 42) Source(159, 64) + SourceIndex(0)
>
2 >var
3 > c12t1
4 > = <(s: string) => string>
5 > (
6 > function(
7 > s
8 > ) {
9 > return
10>
11> s
12>
13>
14> }
15> )
16> ;
1->Emitted(102, 1) Source(159, 1) + SourceIndex(0)
2 >Emitted(102, 5) Source(159, 5) + SourceIndex(0)
3 >Emitted(102, 10) Source(159, 10) + SourceIndex(0)
4 >Emitted(102, 13) Source(159, 37) + SourceIndex(0)
5 >Emitted(102, 14) Source(159, 38) + SourceIndex(0)
6 >Emitted(102, 24) Source(159, 47) + SourceIndex(0)
7 >Emitted(102, 25) Source(159, 48) + SourceIndex(0)
8 >Emitted(102, 29) Source(159, 52) + SourceIndex(0)
9 >Emitted(102, 35) Source(159, 58) + SourceIndex(0)
10>Emitted(102, 36) Source(159, 59) + SourceIndex(0)
11>Emitted(102, 37) Source(159, 60) + SourceIndex(0)
12>Emitted(102, 38) Source(159, 60) + SourceIndex(0)
13>Emitted(102, 39) Source(159, 61) + SourceIndex(0)
14>Emitted(102, 40) Source(159, 62) + SourceIndex(0)
15>Emitted(102, 41) Source(159, 63) + SourceIndex(0)
16>Emitted(102, 42) Source(159, 64) + SourceIndex(0)
---
>>>var c12t2 = ({
1 >

View File

@ -0,0 +1,30 @@
//// [tests/cases/compiler/declarationEmit_exportAssignment.ts] ////
//// [utils.ts]
export function foo() { }
export function bar() { }
export interface Buzz { }
//// [index.ts]
import {foo} from "utils";
export = foo;
//// [utils.js]
function foo() { }
exports.foo = foo;
function bar() { }
exports.bar = bar;
//// [index.js]
var utils_1 = require("utils");
module.exports = utils_1.foo;
//// [utils.d.ts]
export declare function foo(): void;
export declare function bar(): void;
export interface Buzz {
}
//// [index.d.ts]
import { foo } from "utils";
export = foo;

View File

@ -0,0 +1,18 @@
=== tests/cases/compiler/utils.ts ===
export function foo() { }
>foo : Symbol(foo, Decl(utils.ts, 0, 0))
export function bar() { }
>bar : Symbol(bar, Decl(utils.ts, 1, 25))
export interface Buzz { }
>Buzz : Symbol(Buzz, Decl(utils.ts, 2, 25))
=== tests/cases/compiler/index.ts ===
import {foo} from "utils";
>foo : Symbol(foo, Decl(index.ts, 0, 8))
export = foo;
>foo : Symbol(foo, Decl(index.ts, 0, 8))

View File

@ -0,0 +1,18 @@
=== tests/cases/compiler/utils.ts ===
export function foo() { }
>foo : () => void
export function bar() { }
>bar : () => void
export interface Buzz { }
>Buzz : Buzz
=== tests/cases/compiler/index.ts ===
import {foo} from "utils";
>foo : () => void
export = foo;
>foo : () => void

View File

@ -0,0 +1,35 @@
//// [tests/cases/compiler/declarationEmit_exportDeclaration.ts] ////
//// [utils.ts]
export function foo() { }
export function bar() { }
export interface Buzz { }
//// [index.ts]
import {foo, bar, Buzz} from "utils";
foo();
let obj: Buzz;
export {bar};
//// [utils.js]
function foo() { }
exports.foo = foo;
function bar() { }
exports.bar = bar;
//// [index.js]
var utils_1 = require("utils");
exports.bar = utils_1.bar;
utils_1.foo();
var obj;
//// [utils.d.ts]
export declare function foo(): void;
export declare function bar(): void;
export interface Buzz {
}
//// [index.d.ts]
import { bar } from "utils";
export { bar };

View File

@ -0,0 +1,27 @@
=== tests/cases/compiler/utils.ts ===
export function foo() { }
>foo : Symbol(foo, Decl(utils.ts, 0, 0))
export function bar() { }
>bar : Symbol(bar, Decl(utils.ts, 1, 25))
export interface Buzz { }
>Buzz : Symbol(Buzz, Decl(utils.ts, 2, 25))
=== tests/cases/compiler/index.ts ===
import {foo, bar, Buzz} from "utils";
>foo : Symbol(foo, Decl(index.ts, 0, 8))
>bar : Symbol(bar, Decl(index.ts, 0, 12))
>Buzz : Symbol(Buzz, Decl(index.ts, 0, 17))
foo();
>foo : Symbol(foo, Decl(index.ts, 0, 8))
let obj: Buzz;
>obj : Symbol(obj, Decl(index.ts, 3, 3))
>Buzz : Symbol(Buzz, Decl(index.ts, 0, 17))
export {bar};
>bar : Symbol(bar, Decl(index.ts, 4, 8))

View File

@ -0,0 +1,28 @@
=== tests/cases/compiler/utils.ts ===
export function foo() { }
>foo : () => void
export function bar() { }
>bar : () => void
export interface Buzz { }
>Buzz : Buzz
=== tests/cases/compiler/index.ts ===
import {foo, bar, Buzz} from "utils";
>foo : () => void
>bar : () => void
>Buzz : any
foo();
>foo() : void
>foo : () => void
let obj: Buzz;
>obj : Buzz
>Buzz : Buzz
export {bar};
>bar : () => void

View File

@ -1,2 +1,2 @@
//// [emitBOM.js.map]
{"version":3,"file":"emitBOM.js","sourceRoot":"","sources":["emitBOM.ts"],"names":[],"mappings":"AAEA,AADA,6DAA6D;IACzD,CAAC,CAAC"}
{"version":3,"file":"emitBOM.js","sourceRoot":"","sources":["emitBOM.ts"],"names":[],"mappings":"AACA,6DAA6D;AAC7D,IAAI,CAAC,CAAC"}

View File

@ -10,28 +10,27 @@ sourceFile:emitBOM.ts
-------------------------------------------------------------------
>>>// JS and d.ts output should have a BOM but not the sourcemap
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
>// JS and d.ts output should have a BOM but not the sourcemap
>
2 >
3 >// JS and d.ts output should have a BOM but not the sourcemap
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
3 >Emitted(1, 62) Source(2, 62) + SourceIndex(0)
2 >// JS and d.ts output should have a BOM but not the sourcemap
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 62) Source(2, 62) + SourceIndex(0)
---
>>>var x;
1 >^^^^
2 > ^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >^^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>var
2 > x
3 > ;
1 >Emitted(2, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(2, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(2, 7) Source(3, 7) + SourceIndex(0)
>
2 >var
3 > x
4 > ;
1 >Emitted(2, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(2, 6) Source(3, 6) + SourceIndex(0)
4 >Emitted(2, 7) Source(3, 7) + SourceIndex(0)
---
>>>//# sourceMappingURL=emitBOM.js.map

View File

@ -0,0 +1,23 @@
//// [tests/cases/compiler/es6ImportEqualsDeclaration2.ts] ////
//// [server.d.ts]
declare module "other" {
export class C { }
}
declare module "server" {
import events = require("other"); // Ambient declaration, no error expected.
module S {
export var a: number;
}
export = S; // Ambient declaration, no error expected.
}
//// [client.ts]
import {a} from "server";
//// [client.js]

View File

@ -0,0 +1,26 @@
=== tests/cases/compiler/server.d.ts ===
declare module "other" {
export class C { }
>C : Symbol(C, Decl(server.d.ts, 1, 24))
}
declare module "server" {
import events = require("other"); // Ambient declaration, no error expected.
>events : Symbol(events, Decl(server.d.ts, 5, 25))
module S {
>S : Symbol(S, Decl(server.d.ts, 6, 37))
export var a: number;
>a : Symbol(a, Decl(server.d.ts, 9, 18))
}
export = S; // Ambient declaration, no error expected.
>S : Symbol(S, Decl(server.d.ts, 6, 37))
}
=== tests/cases/compiler/client.ts ===
import {a} from "server";
>a : Symbol(a, Decl(client.ts, 0, 8))

View File

@ -0,0 +1,26 @@
=== tests/cases/compiler/server.d.ts ===
declare module "other" {
export class C { }
>C : C
}
declare module "server" {
import events = require("other"); // Ambient declaration, no error expected.
>events : typeof events
module S {
>S : typeof S
export var a: number;
>a : number
}
export = S; // Ambient declaration, no error expected.
>S : typeof S
}
=== tests/cases/compiler/client.ts ===
import {a} from "server";
>a : number

View File

@ -0,0 +1,30 @@
EmitSkipped: false
FileName : tests/cases/fourslash/shims-pp/inputFile1.js
var x = 5;
var Bar = (function () {
function Bar() {
}
return Bar;
})();
FileName : tests/cases/fourslash/shims-pp/inputFile1.d.ts
declare var x: number;
declare class Bar {
x: string;
y: number;
}
EmitSkipped: false
FileName : tests/cases/fourslash/shims-pp/inputFile2.js
var x1 = "hello world";
var Foo = (function () {
function Foo() {
}
return Foo;
})();
FileName : tests/cases/fourslash/shims-pp/inputFile2.d.ts
declare var x1: string;
declare class Foo {
x: string;
y: number;
}

View File

@ -8,7 +8,7 @@ regexMatchList.forEach(match => ''.replace(match, ''));
>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3))
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23))
>''.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63))
>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63))
>''.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 98), Decl(lib.d.ts, 350, 63))
>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 98), Decl(lib.d.ts, 350, 63))
>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23))

View File

@ -14,9 +14,9 @@ regexMatchList.forEach(match => ''.replace(match, ''));
>match => ''.replace(match, '') : (match: string) => string
>match : string
>''.replace(match, '') : string
>''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
>''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>'' : string
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>match : string
>'' : string

View File

@ -1,2 +1,2 @@
//// [out-flag.js.map]
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;;IACpBA;IAYAC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAEf,oBAAoB;AACpB;IAAAA;IAYAC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}

View File

@ -19,25 +19,26 @@ sourceFile:out-flag.ts
---
>>>// my class comments
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^->
1->
>
>// my class comments
>
2 >
3 >// my class comments
1->Emitted(2, 1) Source(4, 1) + SourceIndex(0)
2 >Emitted(2, 1) Source(3, 1) + SourceIndex(0)
3 >Emitted(2, 21) Source(3, 21) + SourceIndex(0)
2 >// my class comments
1->Emitted(2, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(2, 21) Source(3, 21) + SourceIndex(0)
---
>>>var MyClass = (function () {
1->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
>
1->Emitted(3, 1) Source(4, 1) + SourceIndex(0)
---
>>> function MyClass() {
1->^^^^
2 > ^^->
1->
>
1->
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (MyClass)
---
>>> }

View File

@ -14,9 +14,9 @@ module Bugs {
var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) {
>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7))
>message.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63))
>message.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 98), Decl(lib.d.ts, 350, 63))
>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16))
>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63))
>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 98), Decl(lib.d.ts, 350, 63))
>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55))
>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61))

View File

@ -15,9 +15,9 @@ module Bugs {
var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) {
>result : string
>message.replace(/\{(\d+)\}/g, function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; }) : string
>message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
>message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>message : string
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/\{(\d+)\}/g : RegExp
>function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any
>match : string

View File

@ -1,6 +1,6 @@
error TS6053: File 'a.ts' not found.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.tsx', '.ts', '.d.ts'.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.tsx', '.ts', '.d.ts'.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.

View File

@ -1,6 +1,6 @@
error TS6053: File 'a.ts' not found.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.tsx', '.ts', '.d.ts'.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.tsx', '.ts', '.d.ts'.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.

View File

@ -325,17 +325,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -347,23 +342,26 @@ sourceFile:../test.ts
2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -324,17 +324,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -346,23 +341,26 @@ sourceFile:../test.ts
2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -325,17 +325,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -347,23 +342,26 @@ sourceFile:../test.ts
2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -324,17 +324,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -346,23 +341,26 @@ sourceFile:../test.ts
2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -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;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,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"}
{"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"}

View File

@ -319,17 +319,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(3, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -341,23 +336,26 @@ sourceFile:../test.ts
2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1)
2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1)
3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1)
4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1)
5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
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)
---
>>>var c1 = (function () {
1->

View File

@ -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;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,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"}
{"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"}

View File

@ -318,17 +318,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(3, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -340,23 +335,26 @@ sourceFile:../test.ts
2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1)
2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1)
3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1)
4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1)
5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
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)
---
>>>var c1 = (function () {
1->

View File

@ -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;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,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"}
{"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"}

View File

@ -319,17 +319,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(3, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -341,23 +336,26 @@ sourceFile:../test.ts
2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1)
2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1)
3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1)
4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1)
5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
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)
---
>>>var c1 = (function () {
1->

View File

@ -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;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,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"}
{"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"}

View File

@ -318,17 +318,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(3, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
---
>>>/// <reference path='ref/m2.ts'/>
1->
@ -340,23 +335,26 @@ sourceFile:../test.ts
2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1)
2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1)
3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1)
4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1)
5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
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)
---
>>>var c1 = (function () {
1->

View File

@ -296,17 +296,12 @@ sourceFile:../../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -318,23 +313,26 @@ sourceFile:../../test.ts
2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -296,17 +296,12 @@ sourceFile:../../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -318,23 +313,26 @@ sourceFile:../../test.ts
2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -296,17 +296,12 @@ sourceFile:../../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -318,23 +313,26 @@ sourceFile:../../test.ts
2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -296,17 +296,12 @@ sourceFile:../../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -318,23 +313,26 @@ sourceFile:../../test.ts
2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0)
2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0)
3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0)
4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0)
5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0)
6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,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"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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"}

View File

@ -284,17 +284,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(21, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2)
3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(21, 1) Source(1, 1) + SourceIndex(2)
2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -306,23 +301,26 @@ sourceFile:../test.ts
2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2)
2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2)
3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2)
4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2)
5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2)
3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2)
4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2)
5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2)
6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,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"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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"}

View File

@ -284,17 +284,12 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->/// <reference path='ref/m1.ts'/>
>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(21, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2)
3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(21, 1) Source(1, 1) + SourceIndex(2)
2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2)
---
>>>/// <reference path='../outputdir_multifolder_ref/m2.ts'/>
1->
@ -306,23 +301,26 @@ sourceFile:../test.ts
2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2)
2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2)
3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2)
4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2)
5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2)
3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2)
4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2)
5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2)
6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2)
---
>>>var c1 = (function () {
1->

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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;ACPD,AADA,6BAA6B;IACzB,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"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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,6BAA6B;AAC7B,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"}

View File

@ -147,34 +147,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1->Emitted(11, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 >/// <reference path='m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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;ACPD,AADA,6BAA6B;IACzB,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"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;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,6BAA6B;AAC7B,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"}

View File

@ -147,34 +147,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->/// <reference path='m1.ts'/>
>
2 >
3 >/// <reference path='m1.ts'/>
1->Emitted(11, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 >/// <reference path='m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
---
>>>var c1 = (function () {
1->

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='ref/m1.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='ref/m1.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='ref/m1.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -153,34 +153,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1 >
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >/// <reference path='ref/m1.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 >/// <reference path='ref/m1.ts'/>
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0)
4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0)
5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0)
6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0)
---
>>>var c1 = (function () {
1->

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}
{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"}

View File

@ -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;ACPD,AADA,iCAAiC;IAC7B,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"}
{"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,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"}

View File

@ -147,34 +147,33 @@ sourceFile:../test.ts
-------------------------------------------------------------------
>>>/// <reference path='ref/m1.ts'/>
1->
2 >
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->/// <reference path='ref/m1.ts'/>
>
2 >
3 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1)
3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 >/// <reference path='ref/m1.ts'/>
1->Emitted(11, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1)
---
>>>var a1 = 10;
1 >^^^^
2 > ^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^->
1 >
>var
2 > a1
3 > =
4 > 10
5 > ;
1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
2 >^^^^
3 > ^^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^->
1 >
>
2 >var
3 > a1
4 > =
5 > 10
6 > ;
1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1)
2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1)
3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1)
4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1)
5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1)
6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1)
---
>>>var c1 = (function () {
1->

View File

@ -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;ACPD,AADA,iCAAiC;IAC7B,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"}
{"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,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"}

Some files were not shown because too many files have changed in this diff Show More