|
|
|
@ -233,7 +233,7 @@ var ts;
|
|
|
|
|
// If changing the text in this section, be sure to test `configureNightly` too.
|
|
|
|
|
ts.versionMajorMinor = "3.7";
|
|
|
|
|
/** The version of the TypeScript compiler release */
|
|
|
|
|
ts.version = ts.versionMajorMinor + ".3";
|
|
|
|
|
ts.version = ts.versionMajorMinor + ".5";
|
|
|
|
|
})(ts || (ts = {}));
|
|
|
|
|
(function (ts) {
|
|
|
|
|
/* @internal */
|
|
|
|
@ -10760,6 +10760,10 @@ var ts;
|
|
|
|
|
return !!node && !!(node.flags & 33554432 /* JsonFile */);
|
|
|
|
|
}
|
|
|
|
|
ts.isInJsonFile = isInJsonFile;
|
|
|
|
|
function isSourceFileNotJson(file) {
|
|
|
|
|
return !isJsonSourceFile(file);
|
|
|
|
|
}
|
|
|
|
|
ts.isSourceFileNotJson = isSourceFileNotJson;
|
|
|
|
|
function isInJSDoc(node) {
|
|
|
|
|
return !!node && !!(node.flags & 4194304 /* JSDoc */);
|
|
|
|
|
}
|
|
|
|
@ -30798,7 +30802,10 @@ var ts;
|
|
|
|
|
break;
|
|
|
|
|
case 288 /* SourceFile */:
|
|
|
|
|
// this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script
|
|
|
|
|
if (thisContainer.commonJsModuleIndicator) {
|
|
|
|
|
if (ts.hasDynamicName(node)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else if (thisContainer.commonJsModuleIndicator) {
|
|
|
|
|
declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -59863,7 +59870,9 @@ var ts;
|
|
|
|
|
if (node.kind === 241 /* VariableDeclaration */ || node.kind === 190 /* BindingElement */) {
|
|
|
|
|
checkVarDeclaredNamesNotShadowed(node);
|
|
|
|
|
}
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -64522,9 +64531,11 @@ var ts;
|
|
|
|
|
node.kind === 200 /* FunctionExpression */ ||
|
|
|
|
|
node.kind === 160 /* MethodDeclaration */);
|
|
|
|
|
if (node.flags & 8388608 /* Ambient */) {
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
|
|
|
|
|
}
|
|
|
|
|
if (!node.body) {
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -87152,8 +87163,11 @@ var ts;
|
|
|
|
|
var ts;
|
|
|
|
|
(function (ts) {
|
|
|
|
|
function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
|
|
if (file && ts.isJsonSourceFile(file)) {
|
|
|
|
|
return []; // No declaration diagnostics for json for now
|
|
|
|
|
}
|
|
|
|
|
var compilerOptions = host.getCompilerOptions();
|
|
|
|
|
var result = ts.transformNodes(resolver, host, compilerOptions, file ? [file] : host.getSourceFiles(), [transformDeclarations], /*allowDtsFiles*/ false);
|
|
|
|
|
var result = ts.transformNodes(resolver, host, compilerOptions, file ? [file] : ts.filter(host.getSourceFiles(), ts.isSourceFileNotJson), [transformDeclarations], /*allowDtsFiles*/ false);
|
|
|
|
|
return result.diagnostics;
|
|
|
|
|
}
|
|
|
|
|
ts.getDeclarationDiagnostics = getDeclarationDiagnostics;
|
|
|
|
@ -88900,12 +88914,13 @@ var ts;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options));
|
|
|
|
|
var isJsonFile = ts.isJsonSourceFile(sourceFile);
|
|
|
|
|
// If json file emits to the same location skip writing it, if emitDeclarationOnly skip writing it
|
|
|
|
|
var isJsonEmittedToSameLocation = ts.isJsonSourceFile(sourceFile) &&
|
|
|
|
|
var isJsonEmittedToSameLocation = isJsonFile &&
|
|
|
|
|
ts.comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */;
|
|
|
|
|
var jsFilePath = options.emitDeclarationOnly || isJsonEmittedToSameLocation ? undefined : ownOutputFilePath;
|
|
|
|
|
var sourceMapFilePath = !jsFilePath || ts.isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options);
|
|
|
|
|
var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : undefined;
|
|
|
|
|
var declarationFilePath = (forceDtsPaths || (ts.getEmitDeclarations(options) && !isJsonFile)) ? ts.getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : undefined;
|
|
|
|
|
var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
|
|
|
|
|
return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, buildInfoPath: undefined };
|
|
|
|
|
}
|
|
|
|
@ -88946,7 +88961,7 @@ var ts;
|
|
|
|
|
}
|
|
|
|
|
/* @internal */
|
|
|
|
|
function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase) {
|
|
|
|
|
ts.Debug.assert(!ts.fileExtensionIs(inputFileName, ".d.ts" /* Dts */));
|
|
|
|
|
ts.Debug.assert(!ts.fileExtensionIs(inputFileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(inputFileName, ".json" /* Json */));
|
|
|
|
|
return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir), ".d.ts" /* Dts */);
|
|
|
|
|
}
|
|
|
|
|
ts.getOutputDeclarationFileName = getOutputDeclarationFileName;
|
|
|
|
@ -89175,12 +89190,13 @@ var ts;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var sourceFiles = ts.isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;
|
|
|
|
|
var filesForEmit = forceDtsEmit ? sourceFiles : ts.filter(sourceFiles, ts.isSourceFileNotJson);
|
|
|
|
|
// Setup and perform the transformation to retrieve declarations from the input files
|
|
|
|
|
var inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [ts.createBundle(sourceFiles, !ts.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : sourceFiles;
|
|
|
|
|
var inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [ts.createBundle(filesForEmit, !ts.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit;
|
|
|
|
|
if (emitOnlyDtsFiles && !ts.getEmitDeclarations(compilerOptions)) {
|
|
|
|
|
// Checker wont collect the linked aliases since thats only done when declaration is enabled.
|
|
|
|
|
// Do that here when emitting only dts files
|
|
|
|
|
sourceFiles.forEach(collectLinkedAliases);
|
|
|
|
|
filesForEmit.forEach(collectLinkedAliases);
|
|
|
|
|
}
|
|
|
|
|
var declarationTransform = ts.transformNodes(resolver, host, compilerOptions, inputListOrBundle, declarationTransformers, /*allowDtsFiles*/ false);
|
|
|
|
|
if (ts.length(declarationTransform.diagnostics)) {
|
|
|
|
@ -94436,7 +94452,7 @@ var ts;
|
|
|
|
|
else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) {
|
|
|
|
|
for (var _c = 0, _d = parsedRef.commandLine.fileNames; _c < _d.length; _c++) {
|
|
|
|
|
var fileName = _d[_c];
|
|
|
|
|
if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */)) {
|
|
|
|
|
if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) {
|
|
|
|
|
processSourceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames()), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -95816,8 +95832,8 @@ var ts;
|
|
|
|
|
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
|
|
|
|
}
|
|
|
|
|
function getProjectReferenceRedirectProject(fileName) {
|
|
|
|
|
// Ignore dts
|
|
|
|
|
if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.fileExtensionIs(fileName, ".d.ts" /* Dts */)) {
|
|
|
|
|
// Ignore dts or any json files
|
|
|
|
|
if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) || ts.fileExtensionIs(fileName, ".json" /* Json */)) {
|
|
|
|
|
return undefined;
|
|
|
|
|
}
|
|
|
|
|
// If this file is produced by a referenced project, we need to rewrite it to
|
|
|
|
@ -95871,7 +95887,7 @@ var ts;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) {
|
|
|
|
|
if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */)) {
|
|
|
|
|
if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) {
|
|
|
|
|
var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames());
|
|
|
|
|
mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName);
|
|
|
|
|
}
|
|
|
|
@ -98831,7 +98847,7 @@ var ts;
|
|
|
|
|
var match = str.match(/\//g);
|
|
|
|
|
return match ? match.length : 0;
|
|
|
|
|
}
|
|
|
|
|
function comparePathsByNumberOfDirectrorySeparators(a, b) {
|
|
|
|
|
function comparePathsByNumberOfDirectorySeparators(a, b) {
|
|
|
|
|
return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
@ -98878,13 +98894,28 @@ var ts;
|
|
|
|
|
});
|
|
|
|
|
if (pathsInDirectory) {
|
|
|
|
|
if (pathsInDirectory.length > 1) {
|
|
|
|
|
pathsInDirectory.sort(comparePathsByNumberOfDirectrorySeparators);
|
|
|
|
|
pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators);
|
|
|
|
|
}
|
|
|
|
|
sortedPaths.push.apply(sortedPaths, pathsInDirectory);
|
|
|
|
|
}
|
|
|
|
|
var newDirectory = ts.getDirectoryPath(directory);
|
|
|
|
|
if (newDirectory === directory)
|
|
|
|
|
return out_directory_1 = directory, "break";
|
|
|
|
|
directory = newDirectory;
|
|
|
|
|
out_directory_1 = directory;
|
|
|
|
|
};
|
|
|
|
|
for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0; directory = ts.getDirectoryPath(directory)) {
|
|
|
|
|
_loop_17(directory);
|
|
|
|
|
var out_directory_1;
|
|
|
|
|
for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) {
|
|
|
|
|
var state_7 = _loop_17(directory);
|
|
|
|
|
directory = out_directory_1;
|
|
|
|
|
if (state_7 === "break")
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (allFileNames.size) {
|
|
|
|
|
var remainingPaths = ts.arrayFrom(allFileNames.values());
|
|
|
|
|
if (remainingPaths.length > 1)
|
|
|
|
|
remainingPaths.sort(comparePathsByNumberOfDirectorySeparators);
|
|
|
|
|
sortedPaths.push.apply(sortedPaths, remainingPaths);
|
|
|
|
|
}
|
|
|
|
|
return sortedPaths;
|
|
|
|
|
}
|
|
|
|
|