From 32210356e7ef145d01d82a0f2042262e804cc8a3 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 17 Jun 2021 00:00:02 +0000 Subject: [PATCH] Bump version to 4.3.4 and LKG --- lib/tsc.js | 53 ++++++++++--------------- lib/tsserver.js | 79 +++++++++++++------------------------ lib/tsserverlibrary.d.ts | 1 + lib/tsserverlibrary.js | 70 +++++++++++--------------------- lib/typescript.d.ts | 1 + lib/typescript.js | 66 +++++++++++-------------------- lib/typescriptServices.d.ts | 1 + lib/typescriptServices.js | 66 +++++++++++-------------------- lib/typingsInstaller.js | 53 ++++++++++--------------- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 11 files changed, 142 insertions(+), 252 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 676a6234c8d91..d11299cf5462f 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.3"; - ts.version = "4.3.3"; + ts.version = "4.3.4"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { @@ -13497,56 +13497,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -32857,9 +32844,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -96307,7 +96292,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -96389,13 +96374,14 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); program.backupState(); var declDiagnostics; var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); }; var outputFiles = []; - var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers).emitResult; + var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; if (declDiagnostics) { program.restoreState(); (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step); @@ -96472,6 +96458,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -96486,7 +96473,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; diff --git a/lib/tsserver.js b/lib/tsserver.js index 6ff08da17dfb1..66a3b91b10740 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -96,7 +96,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17321,56 +17321,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40305,9 +40292,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116658,7 +116643,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116743,6 +116728,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116753,7 +116739,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -116835,6 +116821,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -116850,7 +116837,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -120743,9 +120730,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127171,9 +127156,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127208,10 +127191,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); @@ -165367,9 +165347,7 @@ var ts; var span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); var lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); var lineText = scriptInfo.getSnapshot().getText(lineSpan.start, ts.textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); - return __assign(__assign({ file: fileName }, span), { lineText: lineText, - isWriteAccess: isWriteAccess, - isDefinition: isDefinition }); + return __assign(__assign({ file: fileName }, span), { lineText: lineText, isWriteAccess: isWriteAccess, isDefinition: isDefinition }); } function isCompletionEntryData(data) { return data === undefined || data && typeof data === "object" @@ -166301,10 +166279,8 @@ var ts; var WorkerSession = /** @class */ (function (_super) { __extends(WorkerSession, _super); function WorkerSession(host, webHost, options, logger, cancellationToken, hrtime) { - var _this = _super.call(this, __assign(__assign({ host: host, - cancellationToken: cancellationToken }, options), { typingsInstaller: server.nullTypingsInstaller, byteLength: ts.notImplemented, // Formats the message text in send of Session which is overriden in this class so not needed - hrtime: hrtime, - logger: logger, canUseEvents: false })) || this; + var _this = _super.call(this, __assign(__assign({ host: host, cancellationToken: cancellationToken }, options), { typingsInstaller: server.nullTypingsInstaller, byteLength: ts.notImplemented, // Formats the message text in send of Session which is overriden in this class so not needed + hrtime: hrtime, logger: logger, canUseEvents: false })) || this; _this.webHost = webHost; return _this; } @@ -167805,8 +167781,7 @@ var ts; var typingsInstaller = disableAutomaticTypingAcquisition ? undefined : new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event); - _this = _super.call(this, __assign(__assign({ host: host, - cancellationToken: cancellationToken }, options), { typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: logger, canUseEvents: true, typesMapLocation: typesMapLocation })) || this; + _this = _super.call(this, __assign(__assign({ host: host, cancellationToken: cancellationToken }, options), { typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: logger, canUseEvents: true, typesMapLocation: typesMapLocation })) || this; _this.eventPort = eventPort; if (_this.canUseEvents && _this.eventPort) { var s_1 = net.connect({ port: _this.eventPort }, function () { diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 6195d669a8306..d6750c44d0a2e 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index f4f612b263875..bddccf9e0108f 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); @@ -165561,9 +165541,7 @@ var ts; var span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); var lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); var lineText = scriptInfo.getSnapshot().getText(lineSpan.start, ts.textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); - return __assign(__assign({ file: fileName }, span), { lineText: lineText, - isWriteAccess: isWriteAccess, - isDefinition: isDefinition }); + return __assign(__assign({ file: fileName }, span), { lineText: lineText, isWriteAccess: isWriteAccess, isDefinition: isDefinition }); } function isCompletionEntryData(data) { return data === undefined || data && typeof data === "object" diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index b86a3a29970a4..0cae15013d02c 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/typescript.js b/lib/typescript.js index b3f80f1a315b2..59842e00c5ec4 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 2d44d601a4731..af981316e9455 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 78539cc744019..cf1c925cc6e5e 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 859392ce380af..5aa1daffbbe5c 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -85,7 +85,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17310,56 +17310,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40294,9 +40281,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116647,7 +116632,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116732,6 +116717,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116742,7 +116728,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -116824,6 +116810,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -116839,7 +116826,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; diff --git a/package.json b/package.json index 0f515e9766e5d..a5eeae7d13e0b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.3.3", + "version": "4.3.4", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 8d3e8d5c8a4d7..ed8388e45b195 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - export const version = "4.3.3" as string; + export const version = "4.3.4" as string; /** * Type of objects whose values are all of the same type.