Update LKG.

This commit is contained in:
Daniel Rosenwasser
2019-07-16 11:44:31 -07:00
parent 05204c7650
commit f6c393c931
10 changed files with 2310 additions and 2180 deletions
+5 -5
View File
@@ -2532,7 +2532,7 @@ declare namespace ts.server.protocol {
string = "string"
}
interface TypeAcquisition {
export interface TypeAcquisition {
enableAutoDiscovery?: boolean;
enable?: boolean;
include?: string[];
@@ -2540,7 +2540,7 @@ declare namespace ts.server.protocol {
[option: string]: string[] | boolean | undefined;
}
interface FileExtensionInfo {
export interface FileExtensionInfo {
extension: string;
isMixedContent: boolean;
scriptKind?: ScriptKind;
@@ -2560,11 +2560,11 @@ declare namespace ts.server.protocol {
[index: string]: T;
}
interface PluginImport {
export interface PluginImport {
name: string;
}
interface ProjectReference {
export interface ProjectReference {
/** A normalized path on disk */
path: string;
/** The path as the user originally wrote it */
@@ -2575,7 +2575,7 @@ declare namespace ts.server.protocol {
circular?: boolean;
}
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
}
declare namespace ts {
// these types are empty stubs for types from services and should not be used directly
+78 -67
View File
@@ -15,6 +15,13 @@ and limitations under the License.
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -697,7 +704,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -6592,7 +6599,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -12490,7 +12497,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
function getPathComponents(path, currentDirectory) {
if (currentDirectory === void 0) { currentDirectory = ""; }
@@ -12569,7 +12576,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -12636,7 +12643,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -13000,14 +13007,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts", ".ts", ".tsx"];
ts.supportedJSExtensions = [".js", ".jsx"];
ts.supportedJSAndJsonExtensions = [".js", ".jsx", ".json"];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json"]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json"]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -13021,7 +13028,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json"]);
return __spreadArrays(supportedExtensions, [".json"]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -19399,7 +19406,7 @@ var ts;
description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us
},
];
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -20088,7 +20095,7 @@ var ts;
ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -21072,7 +21079,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -22149,7 +22156,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
@@ -22909,7 +22916,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0, name);
}
}
@@ -35929,7 +35936,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -36985,7 +36992,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -42216,13 +42223,17 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
if (node.kind !== 190 ||
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 && node.kind !== 190 ||
assignmentKind === 1 ||
prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 1048576)) {
return propType;
}
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -42239,7 +42250,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768) && getFalsyFlags(flowType) & 32768) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
return propType;
}
return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
@@ -42520,7 +42531,7 @@ var ts;
2 | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 : 0) :
0;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -51410,7 +51421,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -55284,9 +55295,9 @@ var ts;
}
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), undefined, [
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"), undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -55437,7 +55448,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), true);
@@ -55768,9 +55779,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -56440,7 +56451,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -60110,7 +60121,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -60723,9 +60734,9 @@ var ts;
var argumentExpression = ts.isPropertyAccessExpression(expression)
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -60988,9 +60999,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, undefined, undefined), block);
}
@@ -61303,9 +61314,9 @@ var ts;
var argumentExpression = ts.isPropertyAccessExpression(expression)
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, [
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"), undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -63535,7 +63546,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
function visitMethodDeclaration(node) {
ts.Debug.assert(!ts.isComputedPropertyName(node.name));
@@ -63656,7 +63667,7 @@ var ts;
function visitNewExpression(node) {
if (ts.some(node.arguments, ts.isSpreadElement)) {
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), false, false, false)), undefined, []);
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), false, false, false)), undefined, []);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -64452,13 +64463,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -64467,7 +64478,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -65756,17 +65767,17 @@ var ts;
var jsonSourceFile = ts.isJsonSourceFile(node) && node;
var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createExpressionStatement(ts.createCall(define, undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
jsonSourceFile ?
jsonSourceFile.statements.length ? jsonSourceFile.statements[0].expression : ts.createObjectLiteral() :
ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createFunctionExpression(undefined, undefined, undefined, undefined, __spreadArrays([
ts.createParameter(undefined, undefined, undefined, "require"),
ts.createParameter(undefined, undefined, undefined, "exports")
].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
], importAliasNames), undefined, transformAsynchronousModuleBody(node))
])))
]), node.statements));
ts.addEmitHelpers(updated, context.readEmitHelpers());
@@ -65785,21 +65796,21 @@ var ts;
]),
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"), undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"), undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
], true), undefined));
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(umdHeader, undefined, [
ts.createFunctionExpression(undefined, undefined, undefined, undefined, [
ts.createFunctionExpression(undefined, undefined, undefined, undefined, __spreadArrays([
ts.createParameter(undefined, undefined, undefined, "require"),
ts.createParameter(undefined, undefined, undefined, "exports")
].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node))
], importAliasNames), undefined, transformAsynchronousModuleBody(node))
]))
]), node.statements));
ts.addEmitHelpers(updated, context.readEmitHelpers());
@@ -68117,7 +68128,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -68711,7 +68722,7 @@ var ts;
}
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -68916,7 +68927,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -69263,7 +69274,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations));
@@ -69857,7 +69868,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -73997,7 +74008,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -74245,7 +74256,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -74849,7 +74860,7 @@ var ts;
return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true };
}
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(undefined, cancellationToken);
}
@@ -75344,7 +75355,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -75637,10 +75648,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -77954,7 +77965,7 @@ var ts;
}
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -78393,7 +78404,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -78566,7 +78577,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -79167,7 +79178,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -79390,7 +79401,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -80144,7 +80155,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -80152,7 +80163,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {
+135 -111
View File
@@ -15,6 +15,13 @@ and limitations under the License.
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -75,8 +82,10 @@ var __rest = (this && this.__rest) || function (s, e) {
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var ts;
@@ -793,7 +802,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -8911,7 +8920,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -15622,7 +15631,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
/**
* Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -15722,7 +15731,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -15803,7 +15812,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -16242,14 +16251,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json" /* Json */]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -16263,7 +16272,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json" /* Json */]);
return __spreadArrays(supportedExtensions, [".json" /* Json */]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -24065,7 +24074,7 @@ var ts;
},
];
/* @internal */
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -24772,7 +24781,7 @@ var ts;
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
/* @internal */
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -25890,7 +25899,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -27242,7 +27251,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
@@ -28165,7 +28174,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0 /* None */, name);
}
}
@@ -43087,7 +43096,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -44342,7 +44351,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -50513,10 +50522,14 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== 190 /* PropertyAccessExpression */ ||
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 /* ElementAccessExpression */ && node.kind !== 190 /* PropertyAccessExpression */ ||
assignmentKind === 1 /* Definite */ ||
prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
return propType;
@@ -50526,7 +50539,7 @@ var ts;
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101 /* ThisKeyword */) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -50543,7 +50556,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -50861,7 +50874,7 @@ var ts;
2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
0 /* None */;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -61272,7 +61285,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -65408,9 +65421,9 @@ var ts;
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -65580,7 +65593,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -66027,9 +66040,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -66967,7 +66980,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -71995,7 +72008,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -72795,9 +72808,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -73111,9 +73124,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block);
}
@@ -73497,9 +73510,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -76663,7 +76676,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
/**
* Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -76931,7 +76944,7 @@ var ts;
// [output]
// new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
/*typeArguments*/ undefined, []);
}
return ts.visitEachChild(node, visitor, context);
@@ -78351,13 +78364,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -78366,7 +78379,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -80303,14 +80316,14 @@ var ts;
// define(moduleName?, ["module1", "module2"], function ...
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define,
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
// Add the dependency array argument:
//
// ["require", "exports", module1", "module2", ...]
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
// Add the module body function argument:
//
// function (require, exports, module1, module2) ...
@@ -80320,10 +80333,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
])))
]),
@@ -80358,11 +80371,11 @@ var ts;
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"),
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
@@ -80390,10 +80403,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
]))
]),
@@ -83761,7 +83774,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -84433,7 +84446,7 @@ var ts;
// 3. Some things are exported, some are not, and there's no marker - add an empty marker
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -84652,7 +84665,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -85087,7 +85100,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(
@@ -85749,7 +85762,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -90269,7 +90282,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -90546,7 +90559,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -91296,7 +91309,7 @@ var ts;
// immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
// get any preEmit diagnostics, not just the ones
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
}
@@ -91856,7 +91869,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -92188,10 +92201,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -94934,7 +94947,7 @@ var ts;
*/
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -95424,7 +95437,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -95614,7 +95627,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -96285,7 +96298,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -96512,7 +96525,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -97330,7 +97343,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -97338,7 +97351,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {
@@ -98823,6 +98836,7 @@ var ts;
97 /* NullKeyword */,
136 /* NumberKeyword */,
137 /* ObjectKeyword */,
134 /* ReadonlyKeyword */,
139 /* StringKeyword */,
140 /* SymbolKeyword */,
103 /* TrueKeyword */,
@@ -100836,7 +100850,7 @@ var ts;
return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined;
}); // TODO: GH#18217
// Now find a path for each potential directory that is to be merged with the one containing the script
return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
return ts.deduplicate(__spreadArrays(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), [scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {
var basePath = compilerOptions.project || host.getCurrentDirectory();
@@ -101043,7 +101057,7 @@ var ts;
var name = trimPrefixAndSuffix(dir);
return name === undefined ? undefined : directoryResult(name);
});
return matches.concat(directories);
return __spreadArrays(matches, directories);
function trimPrefixAndSuffix(path) {
var inner = withoutStartAndEnd(ts.normalizePath(path), completePrefix, normalizedSuffix);
return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);
@@ -101220,8 +101234,9 @@ var ts;
KeywordCompletionFilters[KeywordCompletionFilters["InterfaceElementKeywords"] = 3] = "InterfaceElementKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["ConstructorParameterKeywords"] = 4] = "ConstructorParameterKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["FunctionLikeBodyKeywords"] = 5] = "FunctionLikeBodyKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 6] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 6] = "Last";
KeywordCompletionFilters[KeywordCompletionFilters["TypeAssertionKeywords"] = 6] = "TypeAssertionKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 7] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 7] = "Last";
})(KeywordCompletionFilters || (KeywordCompletionFilters = {}));
var GlobalsSearch;
(function (GlobalsSearch) {
@@ -102120,8 +102135,11 @@ var ts;
function filterGlobalCompletion(symbols) {
var isTypeOnly = isTypeOnlyCompletion();
var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
if (isTypeOnly)
keywordFilters = 6 /* TypeKeywords */;
if (isTypeOnly) {
keywordFilters = isTypeAssertion()
? 6 /* TypeAssertionKeywords */
: 7 /* TypeKeywords */;
}
ts.filterMutate(symbols, function (symbol) {
if (!ts.isSourceFile(location)) {
// export = /**/ here we want to get all meanings, so any symbol is ok
@@ -102145,6 +102163,9 @@ var ts;
return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */);
});
}
function isTypeAssertion() {
return ts.isAssertionExpression(contextToken.parent);
}
function isTypeOnlyCompletion() {
return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
@@ -102168,7 +102189,8 @@ var ts;
case 120 /* AsKeyword */:
return parentKind === 213 /* AsExpression */;
case 28 /* LessThanToken */:
return parentKind === 165 /* TypeReference */;
return parentKind === 165 /* TypeReference */ ||
parentKind === 195 /* TypeAssertionExpression */;
case 87 /* ExtendsKeyword */:
return parentKind === 151 /* TypeParameter */;
}
@@ -102952,7 +102974,7 @@ var ts;
function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {
if (!filterOutTsOnlyKeywords)
return getTypescriptKeywordCompletions(keywordFilter);
var index = keywordFilter + 6 /* Last */ + 1;
var index = keywordFilter + 7 /* Last */ + 1;
return _keywordCompletions[index] ||
(_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)
.filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));
@@ -102974,7 +102996,9 @@ var ts;
return ts.isParameterPropertyModifier(kind);
case 5 /* FunctionLikeBodyKeywords */:
return isFunctionLikeBodyKeyword(kind);
case 6 /* TypeKeywords */:
case 6 /* TypeAssertionKeywords */:
return ts.isTypeKeyword(kind) || kind === 78 /* ConstKeyword */;
case 7 /* TypeKeywords */:
return ts.isTypeKeyword(kind);
default:
return ts.Debug.assertNever(keywordFilter);
@@ -103334,7 +103358,7 @@ var ts;
case 273 /* DefaultClause */:
// Container is either a class declaration or the declaration is a classDeclaration
if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) {
return declaration.members.concat([declaration]);
return __spreadArrays(declaration.members, [declaration]);
}
else {
return container.statements;
@@ -103342,7 +103366,7 @@ var ts;
case 158 /* Constructor */:
case 157 /* MethodDeclaration */:
case 240 /* FunctionDeclaration */:
return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : []));
case 241 /* ClassDeclaration */:
case 210 /* ClassExpression */:
var nodes = container.members;
@@ -103351,11 +103375,11 @@ var ts;
if (modifierFlag & 28 /* AccessibilityModifier */) {
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
if (constructor) {
return nodes.concat(constructor.parameters);
return __spreadArrays(nodes, constructor.parameters);
}
}
else if (modifierFlag & 128 /* Abstract */) {
return nodes.concat([container]);
return __spreadArrays(nodes, [container]);
}
return nodes;
default:
@@ -106329,7 +106353,7 @@ var ts;
else {
var defs = getDefinitionFromSymbol(typeChecker, symbol, node) || ts.emptyArray;
// For a 'super()' call, put the signature first, else put the variable first.
return node.kind === 99 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]);
return node.kind === 99 /* SuperKeyword */ ? __spreadArrays([sigInfo], defs) : __spreadArrays(defs, [sigInfo]);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -109934,14 +109958,14 @@ var ts;
var parameters = typeParameters.map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var documentation = symbol.getDocumentationComment(checker);
var tags = symbol.getJsDocTags();
var prefixDisplayParts = typeSymbolDisplay.concat([ts.punctuationPart(28 /* LessThanToken */)]);
var prefixDisplayParts = __spreadArrays(typeSymbolDisplay, [ts.punctuationPart(28 /* LessThanToken */)]);
return { isVariadic: false, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: [ts.punctuationPart(30 /* GreaterThanToken */)], separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
}
var separatorDisplayParts = [ts.punctuationPart(27 /* CommaToken */), ts.spacePart()];
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
var _a = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile), isVariadic = _a.isVariadic, parameters = _a.parameters, prefix = _a.prefix, suffix = _a.suffix;
var prefixDisplayParts = callTargetDisplayParts.concat(prefix);
var suffixDisplayParts = suffix.concat(returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var prefixDisplayParts = __spreadArrays(callTargetDisplayParts, prefix);
var suffixDisplayParts = __spreadArrays(suffix, returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var documentation = candidateSignature.getDocumentationComment(checker);
var tags = candidateSignature.getJsDocTags();
return { isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
@@ -109965,10 +109989,10 @@ var ts;
var parameters = (typeParameters || ts.emptyArray).map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var parameterParts = ts.mapToDisplayParts(function (writer) {
var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
var params = ts.createNodeArray(thisParameter.concat(checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
var params = ts.createNodeArray(__spreadArrays(thisParameter, checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer);
});
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: [ts.punctuationPart(30 /* GreaterThanToken */)].concat(parameterParts) };
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: __spreadArrays([ts.punctuationPart(30 /* GreaterThanToken */)], parameterParts) };
}
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
var isVariadic = checker.hasEffectiveRestParameter(candidateSignature);
@@ -109980,7 +110004,7 @@ var ts;
}
});
var parameters = checker.getExpandedParameters(candidateSignature).map(function (p) { return createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer); });
return { isVariadic: isVariadic, parameters: parameters, prefix: typeParameterParts.concat([ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
return { isVariadic: isVariadic, parameters: parameters, prefix: __spreadArrays(typeParameterParts, [ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
}
function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) {
var displayParts = ts.mapToDisplayParts(function (writer) {
@@ -111426,7 +111450,7 @@ var ts;
return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false };
}
var anyToken = { tokens: allTokens, isSpecific: false };
var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */]));
var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */]));
var keywords = tokenRangeFromRange(74 /* FirstKeyword */, 148 /* LastKeyword */);
var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 72 /* LastBinaryOperator */);
var binaryKeywordOperators = [94 /* InKeyword */, 95 /* InstanceOfKeyword */, 148 /* OfKeyword */, 120 /* AsKeyword */, 129 /* IsKeyword */];
@@ -111440,7 +111464,7 @@ var ts;
var unaryPredecrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */];
var unaryPostdecrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */];
var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
var typeNames = [73 /* Identifier */].concat(ts.typeKeywords);
var typeNames = __spreadArrays([73 /* Identifier */], ts.typeKeywords);
// Place a space before open brace in a function declaration
// TypeScript: Function can have return types, which can be made of tons of different token kinds
var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
@@ -111678,7 +111702,7 @@ var ts;
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
rule("SpaceAfterTryFinally", [104 /* TryKeyword */, 89 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */),
];
return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules);
return __spreadArrays(highPriorityCommonRules, userConfigurableRules, lowPriorityCommonRules);
}
formatting.getAllRules = getAllRules;
/**
@@ -114032,7 +114056,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) {
var firstStatement = ts.firstOrUndefined(ctr.body.statements);
if (!firstStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays([newStatement], ctr.body.statements));
}
else {
this.insertNodeBefore(sourceFile, firstStatement, newStatement);
@@ -114041,7 +114065,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) {
var lastStatement = ts.lastOrUndefined(ctr.body.statements);
if (!lastStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement]));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays(ctr.body.statements, [newStatement]));
}
else {
this.insertNodeAfter(sourceFile, lastStatement, newStatement);
@@ -114074,7 +114098,7 @@ var ts;
if (getMembersOrProperties(cls).length === 0) {
if (ts.addToSeen(this.classesWithNodesInsertedAtStart, ts.getNodeId(cls), { node: cls, sourceFile: sourceFile })) {
// For `class C {\n}`, don't add the trailing "\n"
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, getClassOrObjectBraceEnds(cls, sourceFile).concat([sourceFile])); // TODO: GH#4130 remove 'as any'
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, __spreadArrays(getClassOrObjectBraceEnds(cls, sourceFile), [sourceFile])); // TODO: GH#4130 remove 'as any'
return { prefix: this.newLineCharacter, suffix: comma + (shouldSuffix ? this.newLineCharacter : "") };
}
else {
@@ -114986,7 +115010,7 @@ var ts;
ts.Diagnostics.This_expression_is_not_callable.code,
ts.Diagnostics.This_expression_is_not_constructable.code,
];
var errorCodes = [
var errorCodes = __spreadArrays([
ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
@@ -115002,7 +115026,7 @@ var ts;
ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
propertyAccessCode
].concat(callableConstructableErrorCodes);
], callableConstructableErrorCodes);
codefix.registerCodeFix({
fixIds: [fixId],
errorCodes: errorCodes,
@@ -115741,7 +115765,7 @@ var ts;
oldTags[i] = merged;
return !!merged;
}); });
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray((oldTags || ts.emptyArray).concat(unmergedNewTags)));
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags)));
var jsDocNode = parent.kind === 198 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent;
jsDocNode.jsDoc = parent.jsDoc;
jsDocNode.jsDocCache = parent.jsDocCache;
@@ -115827,7 +115851,7 @@ var ts;
cancellationToken.throwIfCancellationRequested();
inferTypeFromContext(reference, checker, usageContext);
}
var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []);
var callContexts = __spreadArrays(usageContext.constructContexts || [], usageContext.callContexts || []);
return declaration.parameters.map(function (parameter, parameterIndex) {
var types = [];
var isRest = ts.isRestParameter(parameter);
@@ -117715,7 +117739,7 @@ var ts;
var addToExisting = tryAddToExistingImport(existingImports);
// Don't bother providing an action to add a new import if we can add to an existing one.
var addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, host, preferences);
return (useNamespace ? [useNamespace] : ts.emptyArray).concat(addImport);
return __spreadArrays((useNamespace ? [useNamespace] : ts.emptyArray), addImport);
}
function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) {
// It is possible that multiple import statements with the same specifier exist in the file.
@@ -120052,7 +120076,7 @@ var ts;
var parameter = ts.first(indexSignature.parameters);
var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type);
var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(134 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type);
var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([
var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [
mappedIntersectionType
], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));
changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
@@ -122346,7 +122370,7 @@ var ts;
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
deleteMovedStatements(oldFile, toMove.ranges, changes);
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);
return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
return __spreadArrays(getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference), addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
}
function deleteMovedStatements(sourceFile, moved, changes) {
for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {
@@ -122914,7 +122938,7 @@ var ts;
}
}
function addCommonjsExport(decl) {
return [decl].concat(getNamesToExportInCommonJS(decl).map(createExportAssignment));
return __spreadArrays([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment));
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
@@ -123092,7 +123116,7 @@ var ts;
function getGroupedReferences(functionDeclaration, program, cancellationToken) {
var functionNames = getFunctionNames(functionDeclaration);
var classNames = ts.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : [];
var names = ts.deduplicate(functionNames.concat(classNames), ts.equateValues);
var names = ts.deduplicate(__spreadArrays(functionNames, classNames), ts.equateValues);
var checker = program.getTypeChecker();
var references = ts.flatMap(names, /*mapfn*/ function (/*mapfn*/ name) { return ts.FindAllReferences.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken); });
var groupedReferences = groupReferences(references);
@@ -124630,7 +124654,7 @@ var ts;
}
// If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface
var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
return semanticDiagnostics.concat(declarationDiagnostics);
return __spreadArrays(semanticDiagnostics, declarationDiagnostics);
}
function getSuggestionDiagnostics(fileName) {
synchronizeHostData();
@@ -124638,7 +124662,7 @@ var ts;
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken));
return __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken));
}
function getCompletionsAtPosition(fileName, position, options) {
if (options === void 0) { options = ts.emptyOptions; }
@@ -126678,7 +126702,7 @@ var ts;
typeAcquisition: configFile.typeAcquisition,
files: configFile.fileNames,
raw: configFile.raw,
errors: realizeDiagnostics(result.parseDiagnostics.concat(configFile.errors), "\r\n")
errors: realizeDiagnostics(__spreadArrays(result.parseDiagnostics, configFile.errors), "\r\n")
};
});
};
@@ -129120,7 +129144,7 @@ var ts;
}
// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
var searchPaths = __spreadArrays([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations);
if (this.projectService.globalPlugins) {
var _loop_1 = function (globalPluginName) {
// Skip empty names from odd commandline parses
@@ -129402,7 +129426,7 @@ var ts;
}
// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
var searchPaths = __spreadArrays([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
@@ -132590,8 +132614,8 @@ var ts;
}
var Session = /** @class */ (function () {
function Session(opts) {
var _this = this;
var _a;
var _this = this;
this.changeSeq = 0;
this.handlers = ts.createMapFromTemplate((_a = {},
_a[server.CommandNames.Status] = function () {
@@ -134214,7 +134238,7 @@ var ts;
}
}
}
var sortedFiles = highPriorityFiles.concat(mediumPriorityFiles, lowPriorityFiles, veryLowPriorityFiles);
var sortedFiles = __spreadArrays(highPriorityFiles, mediumPriorityFiles, lowPriorityFiles, veryLowPriorityFiles);
var checkList = sortedFiles.map(function (fileName) { return ({ fileName: fileName, project: project }); });
// Project level error analysis runs on background files too, therefore
// doesn't require the file to be opened
+565 -559
View File
File diff suppressed because it is too large Load Diff
+135 -111
View File
@@ -14,6 +14,13 @@ and limitations under the License.
***************************************************************************** */
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -74,8 +81,10 @@ var __rest = (this && this.__rest) || function (s, e) {
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var ts;
@@ -792,7 +801,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -8910,7 +8919,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -15621,7 +15630,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
/**
* Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -15721,7 +15730,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -15802,7 +15811,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -16241,14 +16250,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json" /* Json */]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -16262,7 +16271,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json" /* Json */]);
return __spreadArrays(supportedExtensions, [".json" /* Json */]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -24064,7 +24073,7 @@ var ts;
},
];
/* @internal */
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -24771,7 +24780,7 @@ var ts;
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
/* @internal */
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -25889,7 +25898,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -27241,7 +27250,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
@@ -28164,7 +28173,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0 /* None */, name);
}
}
@@ -43086,7 +43095,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -44341,7 +44350,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -50512,10 +50521,14 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== 190 /* PropertyAccessExpression */ ||
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 /* ElementAccessExpression */ && node.kind !== 190 /* PropertyAccessExpression */ ||
assignmentKind === 1 /* Definite */ ||
prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
return propType;
@@ -50525,7 +50538,7 @@ var ts;
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101 /* ThisKeyword */) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -50542,7 +50555,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -50860,7 +50873,7 @@ var ts;
2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
0 /* None */;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -61271,7 +61284,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -65407,9 +65420,9 @@ var ts;
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -65579,7 +65592,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -66026,9 +66039,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -66966,7 +66979,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -71994,7 +72007,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -72794,9 +72807,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -73110,9 +73123,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block);
}
@@ -73496,9 +73509,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -76662,7 +76675,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
/**
* Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -76930,7 +76943,7 @@ var ts;
// [output]
// new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
/*typeArguments*/ undefined, []);
}
return ts.visitEachChild(node, visitor, context);
@@ -78350,13 +78363,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -78365,7 +78378,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -80302,14 +80315,14 @@ var ts;
// define(moduleName?, ["module1", "module2"], function ...
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define,
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
// Add the dependency array argument:
//
// ["require", "exports", module1", "module2", ...]
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
// Add the module body function argument:
//
// function (require, exports, module1, module2) ...
@@ -80319,10 +80332,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
])))
]),
@@ -80357,11 +80370,11 @@ var ts;
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"),
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
@@ -80389,10 +80402,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
]))
]),
@@ -83760,7 +83773,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -84432,7 +84445,7 @@ var ts;
// 3. Some things are exported, some are not, and there's no marker - add an empty marker
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -84651,7 +84664,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -85086,7 +85099,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(
@@ -85748,7 +85761,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -90268,7 +90281,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -90545,7 +90558,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -91295,7 +91308,7 @@ var ts;
// immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
// get any preEmit diagnostics, not just the ones
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
}
@@ -91855,7 +91868,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -92187,10 +92200,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -94933,7 +94946,7 @@ var ts;
*/
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -95423,7 +95436,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -95613,7 +95626,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -96284,7 +96297,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -96511,7 +96524,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -97329,7 +97342,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -97337,7 +97350,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {
@@ -99170,6 +99183,7 @@ var ts;
97 /* NullKeyword */,
136 /* NumberKeyword */,
137 /* ObjectKeyword */,
134 /* ReadonlyKeyword */,
139 /* StringKeyword */,
140 /* SymbolKeyword */,
103 /* TrueKeyword */,
@@ -101183,7 +101197,7 @@ var ts;
return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined;
}); // TODO: GH#18217
// Now find a path for each potential directory that is to be merged with the one containing the script
return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
return ts.deduplicate(__spreadArrays(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), [scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {
var basePath = compilerOptions.project || host.getCurrentDirectory();
@@ -101390,7 +101404,7 @@ var ts;
var name = trimPrefixAndSuffix(dir);
return name === undefined ? undefined : directoryResult(name);
});
return matches.concat(directories);
return __spreadArrays(matches, directories);
function trimPrefixAndSuffix(path) {
var inner = withoutStartAndEnd(ts.normalizePath(path), completePrefix, normalizedSuffix);
return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);
@@ -101567,8 +101581,9 @@ var ts;
KeywordCompletionFilters[KeywordCompletionFilters["InterfaceElementKeywords"] = 3] = "InterfaceElementKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["ConstructorParameterKeywords"] = 4] = "ConstructorParameterKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["FunctionLikeBodyKeywords"] = 5] = "FunctionLikeBodyKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 6] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 6] = "Last";
KeywordCompletionFilters[KeywordCompletionFilters["TypeAssertionKeywords"] = 6] = "TypeAssertionKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 7] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 7] = "Last";
})(KeywordCompletionFilters || (KeywordCompletionFilters = {}));
var GlobalsSearch;
(function (GlobalsSearch) {
@@ -102467,8 +102482,11 @@ var ts;
function filterGlobalCompletion(symbols) {
var isTypeOnly = isTypeOnlyCompletion();
var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
if (isTypeOnly)
keywordFilters = 6 /* TypeKeywords */;
if (isTypeOnly) {
keywordFilters = isTypeAssertion()
? 6 /* TypeAssertionKeywords */
: 7 /* TypeKeywords */;
}
ts.filterMutate(symbols, function (symbol) {
if (!ts.isSourceFile(location)) {
// export = /**/ here we want to get all meanings, so any symbol is ok
@@ -102492,6 +102510,9 @@ var ts;
return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */);
});
}
function isTypeAssertion() {
return ts.isAssertionExpression(contextToken.parent);
}
function isTypeOnlyCompletion() {
return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
@@ -102515,7 +102536,8 @@ var ts;
case 120 /* AsKeyword */:
return parentKind === 213 /* AsExpression */;
case 28 /* LessThanToken */:
return parentKind === 165 /* TypeReference */;
return parentKind === 165 /* TypeReference */ ||
parentKind === 195 /* TypeAssertionExpression */;
case 87 /* ExtendsKeyword */:
return parentKind === 151 /* TypeParameter */;
}
@@ -103299,7 +103321,7 @@ var ts;
function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {
if (!filterOutTsOnlyKeywords)
return getTypescriptKeywordCompletions(keywordFilter);
var index = keywordFilter + 6 /* Last */ + 1;
var index = keywordFilter + 7 /* Last */ + 1;
return _keywordCompletions[index] ||
(_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)
.filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));
@@ -103321,7 +103343,9 @@ var ts;
return ts.isParameterPropertyModifier(kind);
case 5 /* FunctionLikeBodyKeywords */:
return isFunctionLikeBodyKeyword(kind);
case 6 /* TypeKeywords */:
case 6 /* TypeAssertionKeywords */:
return ts.isTypeKeyword(kind) || kind === 78 /* ConstKeyword */;
case 7 /* TypeKeywords */:
return ts.isTypeKeyword(kind);
default:
return ts.Debug.assertNever(keywordFilter);
@@ -103681,7 +103705,7 @@ var ts;
case 273 /* DefaultClause */:
// Container is either a class declaration or the declaration is a classDeclaration
if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) {
return declaration.members.concat([declaration]);
return __spreadArrays(declaration.members, [declaration]);
}
else {
return container.statements;
@@ -103689,7 +103713,7 @@ var ts;
case 158 /* Constructor */:
case 157 /* MethodDeclaration */:
case 240 /* FunctionDeclaration */:
return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : []));
case 241 /* ClassDeclaration */:
case 210 /* ClassExpression */:
var nodes = container.members;
@@ -103698,11 +103722,11 @@ var ts;
if (modifierFlag & 28 /* AccessibilityModifier */) {
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
if (constructor) {
return nodes.concat(constructor.parameters);
return __spreadArrays(nodes, constructor.parameters);
}
}
else if (modifierFlag & 128 /* Abstract */) {
return nodes.concat([container]);
return __spreadArrays(nodes, [container]);
}
return nodes;
default:
@@ -106676,7 +106700,7 @@ var ts;
else {
var defs = getDefinitionFromSymbol(typeChecker, symbol, node) || ts.emptyArray;
// For a 'super()' call, put the signature first, else put the variable first.
return node.kind === 99 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]);
return node.kind === 99 /* SuperKeyword */ ? __spreadArrays([sigInfo], defs) : __spreadArrays(defs, [sigInfo]);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -110281,14 +110305,14 @@ var ts;
var parameters = typeParameters.map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var documentation = symbol.getDocumentationComment(checker);
var tags = symbol.getJsDocTags();
var prefixDisplayParts = typeSymbolDisplay.concat([ts.punctuationPart(28 /* LessThanToken */)]);
var prefixDisplayParts = __spreadArrays(typeSymbolDisplay, [ts.punctuationPart(28 /* LessThanToken */)]);
return { isVariadic: false, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: [ts.punctuationPart(30 /* GreaterThanToken */)], separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
}
var separatorDisplayParts = [ts.punctuationPart(27 /* CommaToken */), ts.spacePart()];
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
var _a = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile), isVariadic = _a.isVariadic, parameters = _a.parameters, prefix = _a.prefix, suffix = _a.suffix;
var prefixDisplayParts = callTargetDisplayParts.concat(prefix);
var suffixDisplayParts = suffix.concat(returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var prefixDisplayParts = __spreadArrays(callTargetDisplayParts, prefix);
var suffixDisplayParts = __spreadArrays(suffix, returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var documentation = candidateSignature.getDocumentationComment(checker);
var tags = candidateSignature.getJsDocTags();
return { isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
@@ -110312,10 +110336,10 @@ var ts;
var parameters = (typeParameters || ts.emptyArray).map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var parameterParts = ts.mapToDisplayParts(function (writer) {
var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
var params = ts.createNodeArray(thisParameter.concat(checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
var params = ts.createNodeArray(__spreadArrays(thisParameter, checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer);
});
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: [ts.punctuationPart(30 /* GreaterThanToken */)].concat(parameterParts) };
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: __spreadArrays([ts.punctuationPart(30 /* GreaterThanToken */)], parameterParts) };
}
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
var isVariadic = checker.hasEffectiveRestParameter(candidateSignature);
@@ -110327,7 +110351,7 @@ var ts;
}
});
var parameters = checker.getExpandedParameters(candidateSignature).map(function (p) { return createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer); });
return { isVariadic: isVariadic, parameters: parameters, prefix: typeParameterParts.concat([ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
return { isVariadic: isVariadic, parameters: parameters, prefix: __spreadArrays(typeParameterParts, [ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
}
function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) {
var displayParts = ts.mapToDisplayParts(function (writer) {
@@ -111773,7 +111797,7 @@ var ts;
return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false };
}
var anyToken = { tokens: allTokens, isSpecific: false };
var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */]));
var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */]));
var keywords = tokenRangeFromRange(74 /* FirstKeyword */, 148 /* LastKeyword */);
var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 72 /* LastBinaryOperator */);
var binaryKeywordOperators = [94 /* InKeyword */, 95 /* InstanceOfKeyword */, 148 /* OfKeyword */, 120 /* AsKeyword */, 129 /* IsKeyword */];
@@ -111787,7 +111811,7 @@ var ts;
var unaryPredecrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */];
var unaryPostdecrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */];
var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
var typeNames = [73 /* Identifier */].concat(ts.typeKeywords);
var typeNames = __spreadArrays([73 /* Identifier */], ts.typeKeywords);
// Place a space before open brace in a function declaration
// TypeScript: Function can have return types, which can be made of tons of different token kinds
var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
@@ -112025,7 +112049,7 @@ var ts;
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
rule("SpaceAfterTryFinally", [104 /* TryKeyword */, 89 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */),
];
return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules);
return __spreadArrays(highPriorityCommonRules, userConfigurableRules, lowPriorityCommonRules);
}
formatting.getAllRules = getAllRules;
/**
@@ -114379,7 +114403,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) {
var firstStatement = ts.firstOrUndefined(ctr.body.statements);
if (!firstStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays([newStatement], ctr.body.statements));
}
else {
this.insertNodeBefore(sourceFile, firstStatement, newStatement);
@@ -114388,7 +114412,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) {
var lastStatement = ts.lastOrUndefined(ctr.body.statements);
if (!lastStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement]));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays(ctr.body.statements, [newStatement]));
}
else {
this.insertNodeAfter(sourceFile, lastStatement, newStatement);
@@ -114421,7 +114445,7 @@ var ts;
if (getMembersOrProperties(cls).length === 0) {
if (ts.addToSeen(this.classesWithNodesInsertedAtStart, ts.getNodeId(cls), { node: cls, sourceFile: sourceFile })) {
// For `class C {\n}`, don't add the trailing "\n"
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, getClassOrObjectBraceEnds(cls, sourceFile).concat([sourceFile])); // TODO: GH#4130 remove 'as any'
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, __spreadArrays(getClassOrObjectBraceEnds(cls, sourceFile), [sourceFile])); // TODO: GH#4130 remove 'as any'
return { prefix: this.newLineCharacter, suffix: comma + (shouldSuffix ? this.newLineCharacter : "") };
}
else {
@@ -115333,7 +115357,7 @@ var ts;
ts.Diagnostics.This_expression_is_not_callable.code,
ts.Diagnostics.This_expression_is_not_constructable.code,
];
var errorCodes = [
var errorCodes = __spreadArrays([
ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
@@ -115349,7 +115373,7 @@ var ts;
ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
propertyAccessCode
].concat(callableConstructableErrorCodes);
], callableConstructableErrorCodes);
codefix.registerCodeFix({
fixIds: [fixId],
errorCodes: errorCodes,
@@ -116088,7 +116112,7 @@ var ts;
oldTags[i] = merged;
return !!merged;
}); });
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray((oldTags || ts.emptyArray).concat(unmergedNewTags)));
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags)));
var jsDocNode = parent.kind === 198 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent;
jsDocNode.jsDoc = parent.jsDoc;
jsDocNode.jsDocCache = parent.jsDocCache;
@@ -116174,7 +116198,7 @@ var ts;
cancellationToken.throwIfCancellationRequested();
inferTypeFromContext(reference, checker, usageContext);
}
var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []);
var callContexts = __spreadArrays(usageContext.constructContexts || [], usageContext.callContexts || []);
return declaration.parameters.map(function (parameter, parameterIndex) {
var types = [];
var isRest = ts.isRestParameter(parameter);
@@ -118062,7 +118086,7 @@ var ts;
var addToExisting = tryAddToExistingImport(existingImports);
// Don't bother providing an action to add a new import if we can add to an existing one.
var addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, host, preferences);
return (useNamespace ? [useNamespace] : ts.emptyArray).concat(addImport);
return __spreadArrays((useNamespace ? [useNamespace] : ts.emptyArray), addImport);
}
function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) {
// It is possible that multiple import statements with the same specifier exist in the file.
@@ -120399,7 +120423,7 @@ var ts;
var parameter = ts.first(indexSignature.parameters);
var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type);
var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(134 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type);
var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([
var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [
mappedIntersectionType
], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));
changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
@@ -122693,7 +122717,7 @@ var ts;
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
deleteMovedStatements(oldFile, toMove.ranges, changes);
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);
return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
return __spreadArrays(getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference), addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
}
function deleteMovedStatements(sourceFile, moved, changes) {
for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {
@@ -123261,7 +123285,7 @@ var ts;
}
}
function addCommonjsExport(decl) {
return [decl].concat(getNamesToExportInCommonJS(decl).map(createExportAssignment));
return __spreadArrays([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment));
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
@@ -123439,7 +123463,7 @@ var ts;
function getGroupedReferences(functionDeclaration, program, cancellationToken) {
var functionNames = getFunctionNames(functionDeclaration);
var classNames = ts.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : [];
var names = ts.deduplicate(functionNames.concat(classNames), ts.equateValues);
var names = ts.deduplicate(__spreadArrays(functionNames, classNames), ts.equateValues);
var checker = program.getTypeChecker();
var references = ts.flatMap(names, /*mapfn*/ function (/*mapfn*/ name) { return ts.FindAllReferences.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken); });
var groupedReferences = groupReferences(references);
@@ -124977,7 +125001,7 @@ var ts;
}
// If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface
var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
return semanticDiagnostics.concat(declarationDiagnostics);
return __spreadArrays(semanticDiagnostics, declarationDiagnostics);
}
function getSuggestionDiagnostics(fileName) {
synchronizeHostData();
@@ -124985,7 +125009,7 @@ var ts;
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken));
return __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken));
}
function getCompletionsAtPosition(fileName, position, options) {
if (options === void 0) { options = ts.emptyOptions; }
@@ -127025,7 +127049,7 @@ var ts;
typeAcquisition: configFile.typeAcquisition,
files: configFile.fileNames,
raw: configFile.raw,
errors: realizeDiagnostics(result.parseDiagnostics.concat(configFile.errors), "\r\n")
errors: realizeDiagnostics(__spreadArrays(result.parseDiagnostics, configFile.errors), "\r\n")
};
});
};
@@ -129119,7 +129143,7 @@ var ts;
}
// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
var searchPaths = __spreadArrays([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations);
if (this.projectService.globalPlugins) {
var _loop_1 = function (globalPluginName) {
// Skip empty names from odd commandline parses
@@ -129401,7 +129425,7 @@ var ts;
}
// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
var searchPaths = __spreadArrays([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
@@ -132589,8 +132613,8 @@ var ts;
}
var Session = /** @class */ (function () {
function Session(opts) {
var _this = this;
var _a;
var _this = this;
this.changeSeq = 0;
this.handlers = ts.createMapFromTemplate((_a = {},
_a[server.CommandNames.Status] = function () {
@@ -134213,7 +134237,7 @@ var ts;
}
}
}
var sortedFiles = highPriorityFiles.concat(mediumPriorityFiles, lowPriorityFiles, veryLowPriorityFiles);
var sortedFiles = __spreadArrays(highPriorityFiles, mediumPriorityFiles, lowPriorityFiles, veryLowPriorityFiles);
var checkList = sortedFiles.map(function (fileName) { return ({ fileName: fileName, project: project }); });
// Project level error analysis runs on background files too, therefore
// doesn't require the file to be opened
+530 -525
View File
File diff suppressed because it is too large Load Diff
+127 -105
View File
@@ -14,6 +14,13 @@ and limitations under the License.
***************************************************************************** */
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -783,7 +790,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -8901,7 +8908,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -15612,7 +15619,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
/**
* Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -15712,7 +15719,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -15793,7 +15800,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -16232,14 +16239,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json" /* Json */]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -16253,7 +16260,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json" /* Json */]);
return __spreadArrays(supportedExtensions, [".json" /* Json */]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -24055,7 +24062,7 @@ var ts;
},
];
/* @internal */
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -24762,7 +24769,7 @@ var ts;
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
/* @internal */
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -25880,7 +25887,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -27232,7 +27239,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
@@ -28155,7 +28162,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0 /* None */, name);
}
}
@@ -43077,7 +43084,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -44332,7 +44339,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -50503,10 +50510,14 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== 190 /* PropertyAccessExpression */ ||
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 /* ElementAccessExpression */ && node.kind !== 190 /* PropertyAccessExpression */ ||
assignmentKind === 1 /* Definite */ ||
prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
return propType;
@@ -50516,7 +50527,7 @@ var ts;
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101 /* ThisKeyword */) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -50533,7 +50544,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -50851,7 +50862,7 @@ var ts;
2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
0 /* None */;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -61262,7 +61273,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -65398,9 +65409,9 @@ var ts;
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -65570,7 +65581,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -66017,9 +66028,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -66957,7 +66968,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -71985,7 +71996,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -72785,9 +72796,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -73101,9 +73112,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block);
}
@@ -73487,9 +73498,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -76653,7 +76664,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
/**
* Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -76921,7 +76932,7 @@ var ts;
// [output]
// new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
/*typeArguments*/ undefined, []);
}
return ts.visitEachChild(node, visitor, context);
@@ -78341,13 +78352,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -78356,7 +78367,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -80293,14 +80304,14 @@ var ts;
// define(moduleName?, ["module1", "module2"], function ...
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define,
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
// Add the dependency array argument:
//
// ["require", "exports", module1", "module2", ...]
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
// Add the module body function argument:
//
// function (require, exports, module1, module2) ...
@@ -80310,10 +80321,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
])))
]),
@@ -80348,11 +80359,11 @@ var ts;
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"),
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
@@ -80380,10 +80391,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
]))
]),
@@ -83751,7 +83762,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -84423,7 +84434,7 @@ var ts;
// 3. Some things are exported, some are not, and there's no marker - add an empty marker
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -84642,7 +84653,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -85077,7 +85088,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(
@@ -85739,7 +85750,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -90259,7 +90270,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -90536,7 +90547,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -91286,7 +91297,7 @@ var ts;
// immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
// get any preEmit diagnostics, not just the ones
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
}
@@ -91846,7 +91857,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -92178,10 +92189,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -94924,7 +94935,7 @@ var ts;
*/
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -95414,7 +95425,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -95604,7 +95615,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -96275,7 +96286,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -96502,7 +96513,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -97320,7 +97331,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -97328,7 +97339,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {
@@ -99161,6 +99172,7 @@ var ts;
97 /* NullKeyword */,
136 /* NumberKeyword */,
137 /* ObjectKeyword */,
134 /* ReadonlyKeyword */,
139 /* StringKeyword */,
140 /* SymbolKeyword */,
103 /* TrueKeyword */,
@@ -101174,7 +101186,7 @@ var ts;
return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined;
}); // TODO: GH#18217
// Now find a path for each potential directory that is to be merged with the one containing the script
return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
return ts.deduplicate(__spreadArrays(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), [scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {
var basePath = compilerOptions.project || host.getCurrentDirectory();
@@ -101381,7 +101393,7 @@ var ts;
var name = trimPrefixAndSuffix(dir);
return name === undefined ? undefined : directoryResult(name);
});
return matches.concat(directories);
return __spreadArrays(matches, directories);
function trimPrefixAndSuffix(path) {
var inner = withoutStartAndEnd(ts.normalizePath(path), completePrefix, normalizedSuffix);
return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);
@@ -101558,8 +101570,9 @@ var ts;
KeywordCompletionFilters[KeywordCompletionFilters["InterfaceElementKeywords"] = 3] = "InterfaceElementKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["ConstructorParameterKeywords"] = 4] = "ConstructorParameterKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["FunctionLikeBodyKeywords"] = 5] = "FunctionLikeBodyKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 6] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 6] = "Last";
KeywordCompletionFilters[KeywordCompletionFilters["TypeAssertionKeywords"] = 6] = "TypeAssertionKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 7] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 7] = "Last";
})(KeywordCompletionFilters || (KeywordCompletionFilters = {}));
var GlobalsSearch;
(function (GlobalsSearch) {
@@ -102458,8 +102471,11 @@ var ts;
function filterGlobalCompletion(symbols) {
var isTypeOnly = isTypeOnlyCompletion();
var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
if (isTypeOnly)
keywordFilters = 6 /* TypeKeywords */;
if (isTypeOnly) {
keywordFilters = isTypeAssertion()
? 6 /* TypeAssertionKeywords */
: 7 /* TypeKeywords */;
}
ts.filterMutate(symbols, function (symbol) {
if (!ts.isSourceFile(location)) {
// export = /**/ here we want to get all meanings, so any symbol is ok
@@ -102483,6 +102499,9 @@ var ts;
return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */);
});
}
function isTypeAssertion() {
return ts.isAssertionExpression(contextToken.parent);
}
function isTypeOnlyCompletion() {
return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
@@ -102506,7 +102525,8 @@ var ts;
case 120 /* AsKeyword */:
return parentKind === 213 /* AsExpression */;
case 28 /* LessThanToken */:
return parentKind === 165 /* TypeReference */;
return parentKind === 165 /* TypeReference */ ||
parentKind === 195 /* TypeAssertionExpression */;
case 87 /* ExtendsKeyword */:
return parentKind === 151 /* TypeParameter */;
}
@@ -103290,7 +103310,7 @@ var ts;
function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {
if (!filterOutTsOnlyKeywords)
return getTypescriptKeywordCompletions(keywordFilter);
var index = keywordFilter + 6 /* Last */ + 1;
var index = keywordFilter + 7 /* Last */ + 1;
return _keywordCompletions[index] ||
(_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)
.filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));
@@ -103312,7 +103332,9 @@ var ts;
return ts.isParameterPropertyModifier(kind);
case 5 /* FunctionLikeBodyKeywords */:
return isFunctionLikeBodyKeyword(kind);
case 6 /* TypeKeywords */:
case 6 /* TypeAssertionKeywords */:
return ts.isTypeKeyword(kind) || kind === 78 /* ConstKeyword */;
case 7 /* TypeKeywords */:
return ts.isTypeKeyword(kind);
default:
return ts.Debug.assertNever(keywordFilter);
@@ -103672,7 +103694,7 @@ var ts;
case 273 /* DefaultClause */:
// Container is either a class declaration or the declaration is a classDeclaration
if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) {
return declaration.members.concat([declaration]);
return __spreadArrays(declaration.members, [declaration]);
}
else {
return container.statements;
@@ -103680,7 +103702,7 @@ var ts;
case 158 /* Constructor */:
case 157 /* MethodDeclaration */:
case 240 /* FunctionDeclaration */:
return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : []));
case 241 /* ClassDeclaration */:
case 210 /* ClassExpression */:
var nodes = container.members;
@@ -103689,11 +103711,11 @@ var ts;
if (modifierFlag & 28 /* AccessibilityModifier */) {
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
if (constructor) {
return nodes.concat(constructor.parameters);
return __spreadArrays(nodes, constructor.parameters);
}
}
else if (modifierFlag & 128 /* Abstract */) {
return nodes.concat([container]);
return __spreadArrays(nodes, [container]);
}
return nodes;
default:
@@ -106667,7 +106689,7 @@ var ts;
else {
var defs = getDefinitionFromSymbol(typeChecker, symbol, node) || ts.emptyArray;
// For a 'super()' call, put the signature first, else put the variable first.
return node.kind === 99 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]);
return node.kind === 99 /* SuperKeyword */ ? __spreadArrays([sigInfo], defs) : __spreadArrays(defs, [sigInfo]);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -110272,14 +110294,14 @@ var ts;
var parameters = typeParameters.map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var documentation = symbol.getDocumentationComment(checker);
var tags = symbol.getJsDocTags();
var prefixDisplayParts = typeSymbolDisplay.concat([ts.punctuationPart(28 /* LessThanToken */)]);
var prefixDisplayParts = __spreadArrays(typeSymbolDisplay, [ts.punctuationPart(28 /* LessThanToken */)]);
return { isVariadic: false, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: [ts.punctuationPart(30 /* GreaterThanToken */)], separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
}
var separatorDisplayParts = [ts.punctuationPart(27 /* CommaToken */), ts.spacePart()];
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
var _a = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile), isVariadic = _a.isVariadic, parameters = _a.parameters, prefix = _a.prefix, suffix = _a.suffix;
var prefixDisplayParts = callTargetDisplayParts.concat(prefix);
var suffixDisplayParts = suffix.concat(returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var prefixDisplayParts = __spreadArrays(callTargetDisplayParts, prefix);
var suffixDisplayParts = __spreadArrays(suffix, returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var documentation = candidateSignature.getDocumentationComment(checker);
var tags = candidateSignature.getJsDocTags();
return { isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
@@ -110303,10 +110325,10 @@ var ts;
var parameters = (typeParameters || ts.emptyArray).map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var parameterParts = ts.mapToDisplayParts(function (writer) {
var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
var params = ts.createNodeArray(thisParameter.concat(checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
var params = ts.createNodeArray(__spreadArrays(thisParameter, checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer);
});
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: [ts.punctuationPart(30 /* GreaterThanToken */)].concat(parameterParts) };
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: __spreadArrays([ts.punctuationPart(30 /* GreaterThanToken */)], parameterParts) };
}
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
var isVariadic = checker.hasEffectiveRestParameter(candidateSignature);
@@ -110318,7 +110340,7 @@ var ts;
}
});
var parameters = checker.getExpandedParameters(candidateSignature).map(function (p) { return createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer); });
return { isVariadic: isVariadic, parameters: parameters, prefix: typeParameterParts.concat([ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
return { isVariadic: isVariadic, parameters: parameters, prefix: __spreadArrays(typeParameterParts, [ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
}
function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) {
var displayParts = ts.mapToDisplayParts(function (writer) {
@@ -111764,7 +111786,7 @@ var ts;
return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false };
}
var anyToken = { tokens: allTokens, isSpecific: false };
var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */]));
var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */]));
var keywords = tokenRangeFromRange(74 /* FirstKeyword */, 148 /* LastKeyword */);
var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 72 /* LastBinaryOperator */);
var binaryKeywordOperators = [94 /* InKeyword */, 95 /* InstanceOfKeyword */, 148 /* OfKeyword */, 120 /* AsKeyword */, 129 /* IsKeyword */];
@@ -111778,7 +111800,7 @@ var ts;
var unaryPredecrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */];
var unaryPostdecrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */];
var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
var typeNames = [73 /* Identifier */].concat(ts.typeKeywords);
var typeNames = __spreadArrays([73 /* Identifier */], ts.typeKeywords);
// Place a space before open brace in a function declaration
// TypeScript: Function can have return types, which can be made of tons of different token kinds
var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
@@ -112016,7 +112038,7 @@ var ts;
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
rule("SpaceAfterTryFinally", [104 /* TryKeyword */, 89 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */),
];
return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules);
return __spreadArrays(highPriorityCommonRules, userConfigurableRules, lowPriorityCommonRules);
}
formatting.getAllRules = getAllRules;
/**
@@ -114370,7 +114392,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) {
var firstStatement = ts.firstOrUndefined(ctr.body.statements);
if (!firstStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays([newStatement], ctr.body.statements));
}
else {
this.insertNodeBefore(sourceFile, firstStatement, newStatement);
@@ -114379,7 +114401,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) {
var lastStatement = ts.lastOrUndefined(ctr.body.statements);
if (!lastStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement]));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays(ctr.body.statements, [newStatement]));
}
else {
this.insertNodeAfter(sourceFile, lastStatement, newStatement);
@@ -114412,7 +114434,7 @@ var ts;
if (getMembersOrProperties(cls).length === 0) {
if (ts.addToSeen(this.classesWithNodesInsertedAtStart, ts.getNodeId(cls), { node: cls, sourceFile: sourceFile })) {
// For `class C {\n}`, don't add the trailing "\n"
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, getClassOrObjectBraceEnds(cls, sourceFile).concat([sourceFile])); // TODO: GH#4130 remove 'as any'
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, __spreadArrays(getClassOrObjectBraceEnds(cls, sourceFile), [sourceFile])); // TODO: GH#4130 remove 'as any'
return { prefix: this.newLineCharacter, suffix: comma + (shouldSuffix ? this.newLineCharacter : "") };
}
else {
@@ -115324,7 +115346,7 @@ var ts;
ts.Diagnostics.This_expression_is_not_callable.code,
ts.Diagnostics.This_expression_is_not_constructable.code,
];
var errorCodes = [
var errorCodes = __spreadArrays([
ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
@@ -115340,7 +115362,7 @@ var ts;
ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
propertyAccessCode
].concat(callableConstructableErrorCodes);
], callableConstructableErrorCodes);
codefix.registerCodeFix({
fixIds: [fixId],
errorCodes: errorCodes,
@@ -116079,7 +116101,7 @@ var ts;
oldTags[i] = merged;
return !!merged;
}); });
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray((oldTags || ts.emptyArray).concat(unmergedNewTags)));
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags)));
var jsDocNode = parent.kind === 198 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent;
jsDocNode.jsDoc = parent.jsDoc;
jsDocNode.jsDocCache = parent.jsDocCache;
@@ -116165,7 +116187,7 @@ var ts;
cancellationToken.throwIfCancellationRequested();
inferTypeFromContext(reference, checker, usageContext);
}
var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []);
var callContexts = __spreadArrays(usageContext.constructContexts || [], usageContext.callContexts || []);
return declaration.parameters.map(function (parameter, parameterIndex) {
var types = [];
var isRest = ts.isRestParameter(parameter);
@@ -118053,7 +118075,7 @@ var ts;
var addToExisting = tryAddToExistingImport(existingImports);
// Don't bother providing an action to add a new import if we can add to an existing one.
var addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, host, preferences);
return (useNamespace ? [useNamespace] : ts.emptyArray).concat(addImport);
return __spreadArrays((useNamespace ? [useNamespace] : ts.emptyArray), addImport);
}
function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) {
// It is possible that multiple import statements with the same specifier exist in the file.
@@ -120390,7 +120412,7 @@ var ts;
var parameter = ts.first(indexSignature.parameters);
var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type);
var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(134 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type);
var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([
var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [
mappedIntersectionType
], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));
changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
@@ -122684,7 +122706,7 @@ var ts;
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
deleteMovedStatements(oldFile, toMove.ranges, changes);
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);
return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
return __spreadArrays(getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference), addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
}
function deleteMovedStatements(sourceFile, moved, changes) {
for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {
@@ -123252,7 +123274,7 @@ var ts;
}
}
function addCommonjsExport(decl) {
return [decl].concat(getNamesToExportInCommonJS(decl).map(createExportAssignment));
return __spreadArrays([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment));
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
@@ -123430,7 +123452,7 @@ var ts;
function getGroupedReferences(functionDeclaration, program, cancellationToken) {
var functionNames = getFunctionNames(functionDeclaration);
var classNames = ts.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : [];
var names = ts.deduplicate(functionNames.concat(classNames), ts.equateValues);
var names = ts.deduplicate(__spreadArrays(functionNames, classNames), ts.equateValues);
var checker = program.getTypeChecker();
var references = ts.flatMap(names, /*mapfn*/ function (/*mapfn*/ name) { return ts.FindAllReferences.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken); });
var groupedReferences = groupReferences(references);
@@ -124968,7 +124990,7 @@ var ts;
}
// If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface
var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
return semanticDiagnostics.concat(declarationDiagnostics);
return __spreadArrays(semanticDiagnostics, declarationDiagnostics);
}
function getSuggestionDiagnostics(fileName) {
synchronizeHostData();
@@ -124976,7 +124998,7 @@ var ts;
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken));
return __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken));
}
function getCompletionsAtPosition(fileName, position, options) {
if (options === void 0) { options = ts.emptyOptions; }
@@ -127016,7 +127038,7 @@ var ts;
typeAcquisition: configFile.typeAcquisition,
files: configFile.fileNames,
raw: configFile.raw,
errors: realizeDiagnostics(result.parseDiagnostics.concat(configFile.errors), "\r\n")
errors: realizeDiagnostics(__spreadArrays(result.parseDiagnostics, configFile.errors), "\r\n")
};
});
};
+530 -525
View File
File diff suppressed because it is too large Load Diff
+127 -105
View File
@@ -14,6 +14,13 @@ and limitations under the License.
***************************************************************************** */
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -783,7 +790,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -8901,7 +8908,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -15612,7 +15619,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
/**
* Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -15712,7 +15719,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -15793,7 +15800,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -16232,14 +16239,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json" /* Json */]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -16253,7 +16260,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json" /* Json */]);
return __spreadArrays(supportedExtensions, [".json" /* Json */]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -24055,7 +24062,7 @@ var ts;
},
];
/* @internal */
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -24762,7 +24769,7 @@ var ts;
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
/* @internal */
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -25880,7 +25887,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -27232,7 +27239,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
@@ -28155,7 +28162,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0 /* None */, name);
}
}
@@ -43077,7 +43084,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -44332,7 +44339,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -50503,10 +50510,14 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== 190 /* PropertyAccessExpression */ ||
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 /* ElementAccessExpression */ && node.kind !== 190 /* PropertyAccessExpression */ ||
assignmentKind === 1 /* Definite */ ||
prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
return propType;
@@ -50516,7 +50527,7 @@ var ts;
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101 /* ThisKeyword */) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -50533,7 +50544,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -50851,7 +50862,7 @@ var ts;
2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
0 /* None */;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -61262,7 +61273,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -65398,9 +65409,9 @@ var ts;
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -65570,7 +65581,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -66017,9 +66028,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -66957,7 +66968,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -71985,7 +71996,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -72785,9 +72796,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -73101,9 +73112,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block);
}
@@ -73487,9 +73498,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -76653,7 +76664,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
/**
* Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -76921,7 +76932,7 @@ var ts;
// [output]
// new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
/*typeArguments*/ undefined, []);
}
return ts.visitEachChild(node, visitor, context);
@@ -78341,13 +78352,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -78356,7 +78367,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -80293,14 +80304,14 @@ var ts;
// define(moduleName?, ["module1", "module2"], function ...
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define,
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
// Add the dependency array argument:
//
// ["require", "exports", module1", "module2", ...]
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
// Add the module body function argument:
//
// function (require, exports, module1, module2) ...
@@ -80310,10 +80321,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
])))
]),
@@ -80348,11 +80359,11 @@ var ts;
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"),
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
@@ -80380,10 +80391,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
]))
]),
@@ -83751,7 +83762,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -84423,7 +84434,7 @@ var ts;
// 3. Some things are exported, some are not, and there's no marker - add an empty marker
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -84642,7 +84653,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -85077,7 +85088,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(
@@ -85739,7 +85750,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -90259,7 +90270,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -90536,7 +90547,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -91286,7 +91297,7 @@ var ts;
// immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
// get any preEmit diagnostics, not just the ones
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
}
@@ -91846,7 +91857,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -92178,10 +92189,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -94924,7 +94935,7 @@ var ts;
*/
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -95414,7 +95425,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -95604,7 +95615,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -96275,7 +96286,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -96502,7 +96513,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -97320,7 +97331,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -97328,7 +97339,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {
@@ -99161,6 +99172,7 @@ var ts;
97 /* NullKeyword */,
136 /* NumberKeyword */,
137 /* ObjectKeyword */,
134 /* ReadonlyKeyword */,
139 /* StringKeyword */,
140 /* SymbolKeyword */,
103 /* TrueKeyword */,
@@ -101174,7 +101186,7 @@ var ts;
return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined;
}); // TODO: GH#18217
// Now find a path for each potential directory that is to be merged with the one containing the script
return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
return ts.deduplicate(__spreadArrays(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), [scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {
var basePath = compilerOptions.project || host.getCurrentDirectory();
@@ -101381,7 +101393,7 @@ var ts;
var name = trimPrefixAndSuffix(dir);
return name === undefined ? undefined : directoryResult(name);
});
return matches.concat(directories);
return __spreadArrays(matches, directories);
function trimPrefixAndSuffix(path) {
var inner = withoutStartAndEnd(ts.normalizePath(path), completePrefix, normalizedSuffix);
return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);
@@ -101558,8 +101570,9 @@ var ts;
KeywordCompletionFilters[KeywordCompletionFilters["InterfaceElementKeywords"] = 3] = "InterfaceElementKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["ConstructorParameterKeywords"] = 4] = "ConstructorParameterKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["FunctionLikeBodyKeywords"] = 5] = "FunctionLikeBodyKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 6] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 6] = "Last";
KeywordCompletionFilters[KeywordCompletionFilters["TypeAssertionKeywords"] = 6] = "TypeAssertionKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 7] = "TypeKeywords";
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 7] = "Last";
})(KeywordCompletionFilters || (KeywordCompletionFilters = {}));
var GlobalsSearch;
(function (GlobalsSearch) {
@@ -102458,8 +102471,11 @@ var ts;
function filterGlobalCompletion(symbols) {
var isTypeOnly = isTypeOnlyCompletion();
var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
if (isTypeOnly)
keywordFilters = 6 /* TypeKeywords */;
if (isTypeOnly) {
keywordFilters = isTypeAssertion()
? 6 /* TypeAssertionKeywords */
: 7 /* TypeKeywords */;
}
ts.filterMutate(symbols, function (symbol) {
if (!ts.isSourceFile(location)) {
// export = /**/ here we want to get all meanings, so any symbol is ok
@@ -102483,6 +102499,9 @@ var ts;
return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */);
});
}
function isTypeAssertion() {
return ts.isAssertionExpression(contextToken.parent);
}
function isTypeOnlyCompletion() {
return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
@@ -102506,7 +102525,8 @@ var ts;
case 120 /* AsKeyword */:
return parentKind === 213 /* AsExpression */;
case 28 /* LessThanToken */:
return parentKind === 165 /* TypeReference */;
return parentKind === 165 /* TypeReference */ ||
parentKind === 195 /* TypeAssertionExpression */;
case 87 /* ExtendsKeyword */:
return parentKind === 151 /* TypeParameter */;
}
@@ -103290,7 +103310,7 @@ var ts;
function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {
if (!filterOutTsOnlyKeywords)
return getTypescriptKeywordCompletions(keywordFilter);
var index = keywordFilter + 6 /* Last */ + 1;
var index = keywordFilter + 7 /* Last */ + 1;
return _keywordCompletions[index] ||
(_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)
.filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));
@@ -103312,7 +103332,9 @@ var ts;
return ts.isParameterPropertyModifier(kind);
case 5 /* FunctionLikeBodyKeywords */:
return isFunctionLikeBodyKeyword(kind);
case 6 /* TypeKeywords */:
case 6 /* TypeAssertionKeywords */:
return ts.isTypeKeyword(kind) || kind === 78 /* ConstKeyword */;
case 7 /* TypeKeywords */:
return ts.isTypeKeyword(kind);
default:
return ts.Debug.assertNever(keywordFilter);
@@ -103672,7 +103694,7 @@ var ts;
case 273 /* DefaultClause */:
// Container is either a class declaration or the declaration is a classDeclaration
if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) {
return declaration.members.concat([declaration]);
return __spreadArrays(declaration.members, [declaration]);
}
else {
return container.statements;
@@ -103680,7 +103702,7 @@ var ts;
case 158 /* Constructor */:
case 157 /* MethodDeclaration */:
case 240 /* FunctionDeclaration */:
return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : []));
case 241 /* ClassDeclaration */:
case 210 /* ClassExpression */:
var nodes = container.members;
@@ -103689,11 +103711,11 @@ var ts;
if (modifierFlag & 28 /* AccessibilityModifier */) {
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
if (constructor) {
return nodes.concat(constructor.parameters);
return __spreadArrays(nodes, constructor.parameters);
}
}
else if (modifierFlag & 128 /* Abstract */) {
return nodes.concat([container]);
return __spreadArrays(nodes, [container]);
}
return nodes;
default:
@@ -106667,7 +106689,7 @@ var ts;
else {
var defs = getDefinitionFromSymbol(typeChecker, symbol, node) || ts.emptyArray;
// For a 'super()' call, put the signature first, else put the variable first.
return node.kind === 99 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]);
return node.kind === 99 /* SuperKeyword */ ? __spreadArrays([sigInfo], defs) : __spreadArrays(defs, [sigInfo]);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -110272,14 +110294,14 @@ var ts;
var parameters = typeParameters.map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var documentation = symbol.getDocumentationComment(checker);
var tags = symbol.getJsDocTags();
var prefixDisplayParts = typeSymbolDisplay.concat([ts.punctuationPart(28 /* LessThanToken */)]);
var prefixDisplayParts = __spreadArrays(typeSymbolDisplay, [ts.punctuationPart(28 /* LessThanToken */)]);
return { isVariadic: false, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: [ts.punctuationPart(30 /* GreaterThanToken */)], separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
}
var separatorDisplayParts = [ts.punctuationPart(27 /* CommaToken */), ts.spacePart()];
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
var _a = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile), isVariadic = _a.isVariadic, parameters = _a.parameters, prefix = _a.prefix, suffix = _a.suffix;
var prefixDisplayParts = callTargetDisplayParts.concat(prefix);
var suffixDisplayParts = suffix.concat(returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var prefixDisplayParts = __spreadArrays(callTargetDisplayParts, prefix);
var suffixDisplayParts = __spreadArrays(suffix, returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));
var documentation = candidateSignature.getDocumentationComment(checker);
var tags = candidateSignature.getJsDocTags();
return { isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };
@@ -110303,10 +110325,10 @@ var ts;
var parameters = (typeParameters || ts.emptyArray).map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });
var parameterParts = ts.mapToDisplayParts(function (writer) {
var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
var params = ts.createNodeArray(thisParameter.concat(checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
var params = ts.createNodeArray(__spreadArrays(thisParameter, checker.getExpandedParameters(candidateSignature).map(function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer);
});
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: [ts.punctuationPart(30 /* GreaterThanToken */)].concat(parameterParts) };
return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(28 /* LessThanToken */)], suffix: __spreadArrays([ts.punctuationPart(30 /* GreaterThanToken */)], parameterParts) };
}
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
var isVariadic = checker.hasEffectiveRestParameter(candidateSignature);
@@ -110318,7 +110340,7 @@ var ts;
}
});
var parameters = checker.getExpandedParameters(candidateSignature).map(function (p) { return createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer); });
return { isVariadic: isVariadic, parameters: parameters, prefix: typeParameterParts.concat([ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
return { isVariadic: isVariadic, parameters: parameters, prefix: __spreadArrays(typeParameterParts, [ts.punctuationPart(20 /* OpenParenToken */)]), suffix: [ts.punctuationPart(21 /* CloseParenToken */)] };
}
function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) {
var displayParts = ts.mapToDisplayParts(function (writer) {
@@ -111764,7 +111786,7 @@ var ts;
return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false };
}
var anyToken = { tokens: allTokens, isSpecific: false };
var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */]));
var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */]));
var keywords = tokenRangeFromRange(74 /* FirstKeyword */, 148 /* LastKeyword */);
var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 72 /* LastBinaryOperator */);
var binaryKeywordOperators = [94 /* InKeyword */, 95 /* InstanceOfKeyword */, 148 /* OfKeyword */, 120 /* AsKeyword */, 129 /* IsKeyword */];
@@ -111778,7 +111800,7 @@ var ts;
var unaryPredecrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */];
var unaryPostdecrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */];
var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
var typeNames = [73 /* Identifier */].concat(ts.typeKeywords);
var typeNames = __spreadArrays([73 /* Identifier */], ts.typeKeywords);
// Place a space before open brace in a function declaration
// TypeScript: Function can have return types, which can be made of tons of different token kinds
var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
@@ -112016,7 +112038,7 @@ var ts;
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
rule("SpaceAfterTryFinally", [104 /* TryKeyword */, 89 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */),
];
return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules);
return __spreadArrays(highPriorityCommonRules, userConfigurableRules, lowPriorityCommonRules);
}
formatting.getAllRules = getAllRules;
/**
@@ -114370,7 +114392,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) {
var firstStatement = ts.firstOrUndefined(ctr.body.statements);
if (!firstStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays([newStatement], ctr.body.statements));
}
else {
this.insertNodeBefore(sourceFile, firstStatement, newStatement);
@@ -114379,7 +114401,7 @@ var ts;
ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) {
var lastStatement = ts.lastOrUndefined(ctr.body.statements);
if (!lastStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement]));
this.replaceConstructorBody(sourceFile, ctr, __spreadArrays(ctr.body.statements, [newStatement]));
}
else {
this.insertNodeAfter(sourceFile, lastStatement, newStatement);
@@ -114412,7 +114434,7 @@ var ts;
if (getMembersOrProperties(cls).length === 0) {
if (ts.addToSeen(this.classesWithNodesInsertedAtStart, ts.getNodeId(cls), { node: cls, sourceFile: sourceFile })) {
// For `class C {\n}`, don't add the trailing "\n"
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, getClassOrObjectBraceEnds(cls, sourceFile).concat([sourceFile])); // TODO: GH#4130 remove 'as any'
var shouldSuffix = ts.positionsAreOnSameLine.apply(void 0, __spreadArrays(getClassOrObjectBraceEnds(cls, sourceFile), [sourceFile])); // TODO: GH#4130 remove 'as any'
return { prefix: this.newLineCharacter, suffix: comma + (shouldSuffix ? this.newLineCharacter : "") };
}
else {
@@ -115324,7 +115346,7 @@ var ts;
ts.Diagnostics.This_expression_is_not_callable.code,
ts.Diagnostics.This_expression_is_not_constructable.code,
];
var errorCodes = [
var errorCodes = __spreadArrays([
ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
@@ -115340,7 +115362,7 @@ var ts;
ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
propertyAccessCode
].concat(callableConstructableErrorCodes);
], callableConstructableErrorCodes);
codefix.registerCodeFix({
fixIds: [fixId],
errorCodes: errorCodes,
@@ -116079,7 +116101,7 @@ var ts;
oldTags[i] = merged;
return !!merged;
}); });
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray((oldTags || ts.emptyArray).concat(unmergedNewTags)));
var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags)));
var jsDocNode = parent.kind === 198 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent;
jsDocNode.jsDoc = parent.jsDoc;
jsDocNode.jsDocCache = parent.jsDocCache;
@@ -116165,7 +116187,7 @@ var ts;
cancellationToken.throwIfCancellationRequested();
inferTypeFromContext(reference, checker, usageContext);
}
var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []);
var callContexts = __spreadArrays(usageContext.constructContexts || [], usageContext.callContexts || []);
return declaration.parameters.map(function (parameter, parameterIndex) {
var types = [];
var isRest = ts.isRestParameter(parameter);
@@ -118053,7 +118075,7 @@ var ts;
var addToExisting = tryAddToExistingImport(existingImports);
// Don't bother providing an action to add a new import if we can add to an existing one.
var addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, host, preferences);
return (useNamespace ? [useNamespace] : ts.emptyArray).concat(addImport);
return __spreadArrays((useNamespace ? [useNamespace] : ts.emptyArray), addImport);
}
function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) {
// It is possible that multiple import statements with the same specifier exist in the file.
@@ -120390,7 +120412,7 @@ var ts;
var parameter = ts.first(indexSignature.parameters);
var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type);
var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(134 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type);
var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([
var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [
mappedIntersectionType
], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));
changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
@@ -122684,7 +122706,7 @@ var ts;
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
deleteMovedStatements(oldFile, toMove.ranges, changes);
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);
return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
return __spreadArrays(getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference), addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
}
function deleteMovedStatements(sourceFile, moved, changes) {
for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {
@@ -123252,7 +123274,7 @@ var ts;
}
}
function addCommonjsExport(decl) {
return [decl].concat(getNamesToExportInCommonJS(decl).map(createExportAssignment));
return __spreadArrays([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment));
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
@@ -123430,7 +123452,7 @@ var ts;
function getGroupedReferences(functionDeclaration, program, cancellationToken) {
var functionNames = getFunctionNames(functionDeclaration);
var classNames = ts.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : [];
var names = ts.deduplicate(functionNames.concat(classNames), ts.equateValues);
var names = ts.deduplicate(__spreadArrays(functionNames, classNames), ts.equateValues);
var checker = program.getTypeChecker();
var references = ts.flatMap(names, /*mapfn*/ function (/*mapfn*/ name) { return ts.FindAllReferences.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken); });
var groupedReferences = groupReferences(references);
@@ -124968,7 +124990,7 @@ var ts;
}
// If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface
var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
return semanticDiagnostics.concat(declarationDiagnostics);
return __spreadArrays(semanticDiagnostics, declarationDiagnostics);
}
function getSuggestionDiagnostics(fileName) {
synchronizeHostData();
@@ -124976,7 +124998,7 @@ var ts;
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken));
return __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken));
}
function getCompletionsAtPosition(fileName, position, options) {
if (options === void 0) { options = ts.emptyOptions; }
@@ -127016,7 +127038,7 @@ var ts;
typeAcquisition: configFile.typeAcquisition,
files: configFile.fileNames,
raw: configFile.raw,
errors: realizeDiagnostics(result.parseDiagnostics.concat(configFile.errors), "\r\n")
errors: realizeDiagnostics(__spreadArrays(result.parseDiagnostics, configFile.errors), "\r\n")
};
});
};
+78 -67
View File
@@ -15,6 +15,13 @@ and limitations under the License.
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -784,7 +791,7 @@ var ts;
return array1;
if (!some(array1))
return array2;
return array1.concat(array2);
return __spreadArrays(array1, array2);
}
ts.concatenate = concatenate;
function deduplicateRelational(array, equalityComparer, comparer) {
@@ -8902,7 +8909,7 @@ var ts;
break;
}
}
to.splice.apply(to, [statementIndex, 0].concat(from));
to.splice.apply(to, __spreadArrays([statementIndex, 0], from));
return to;
}
function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
@@ -15613,7 +15620,7 @@ var ts;
var rest = path.substring(rootLength).split(ts.directorySeparator);
if (rest.length && !ts.lastOrUndefined(rest))
rest.pop();
return [root].concat(rest);
return __spreadArrays([root], rest);
}
/**
* Parse a path into an array containing a root component (at index 0) and zero or more path
@@ -15713,7 +15720,7 @@ var ts;
for (; start < fromComponents.length; start++) {
relative.push("..");
}
return [""].concat(relative, components);
return __spreadArrays([""], relative, components);
}
ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
@@ -15794,7 +15801,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
var combined = ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : ts.normalizeSlashes(path);
var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
@@ -16233,14 +16240,14 @@ var ts;
ts.supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */];
ts.supportedJSExtensions = [".js" /* Js */, ".jsx" /* Jsx */];
ts.supportedJSAndJsonExtensions = [".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
var allSupportedExtensions = ts.supportedTSExtensions.concat(ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = ts.supportedTSExtensions.concat(ts.supportedJSExtensions, [".json" /* Json */]);
var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions);
var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]);
function getSupportedExtensions(options, extraFileExtensions) {
var needJsExtensions = options && options.allowJs;
if (!extraFileExtensions || extraFileExtensions.length === 0) {
return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;
}
var extensions = (needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions).concat(ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
var extensions = __spreadArrays(needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions, ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));
return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);
}
ts.getSupportedExtensions = getSupportedExtensions;
@@ -16254,7 +16261,7 @@ var ts;
if (supportedExtensions === ts.supportedTSExtensions) {
return ts.supportedTSExtensionsWithJson;
}
return supportedExtensions.concat([".json" /* Json */]);
return __spreadArrays(supportedExtensions, [".json" /* Json */]);
}
ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;
function isJSLike(scriptKind) {
@@ -24056,7 +24063,7 @@ var ts;
},
];
/* @internal */
ts.optionDeclarations = ts.commonOptionsWithBuild.concat([
ts.optionDeclarations = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "all",
type: "boolean",
@@ -24763,7 +24770,7 @@ var ts;
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
});
/* @internal */
ts.buildOpts = ts.commonOptionsWithBuild.concat([
ts.buildOpts = __spreadArrays(ts.commonOptionsWithBuild, [
{
name: "verbose",
shortName: "v",
@@ -25881,7 +25888,7 @@ var ts;
basePath = ts.normalizeSlashes(basePath);
var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath);
if (resolutionStack.indexOf(resolvedPath) >= 0) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> ")));
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArrays(resolutionStack, [resolvedPath]).join(" -> ")));
return { raw: json || convertToObject(sourceFile, errors) };
}
var ownConfig = json ?
@@ -27233,7 +27240,7 @@ var ts;
ts.tryResolveJSModule = tryResolveJSModule;
var jsOnlyExtensions = [Extensions.JavaScript];
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
var tsPlusJsonExtensions = __spreadArrays(tsExtensions, [Extensions.Json]);
var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
@@ -28156,7 +28163,7 @@ var ts;
}
});
var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInformation_1)) : diag);
symbol = createSymbol(0 /* None */, name);
}
}
@@ -43078,7 +43085,7 @@ var ts;
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
ts.addRelatedInfo.apply(void 0, __spreadArrays([diag], relatedInfo));
}
if (errorOutputContainer) {
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -44333,7 +44340,7 @@ var ts;
}
if (props.length === 1) {
var propName = symbolToString(unmatchedProperty);
reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target)));
reportError.apply(void 0, __spreadArrays([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));
if (ts.length(unmatchedProperty.declarations)) {
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
}
@@ -50504,10 +50511,14 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== 190 /* PropertyAccessExpression */ ||
var assignmentKind = ts.getAssignmentTargetKind(node);
if (node.kind !== 191 /* ElementAccessExpression */ && node.kind !== 190 /* PropertyAccessExpression */ ||
assignmentKind === 1 /* Definite */ ||
prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {
return propType;
@@ -50517,7 +50528,7 @@ var ts;
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
var assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === 101 /* ThisKeyword */) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
@@ -50534,7 +50545,7 @@ var ts;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -50852,7 +50863,7 @@ var ts;
2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :
0 /* None */;
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
if (expressionType === errorType) {
@@ -61263,7 +61274,7 @@ var ts;
ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));
});
var diagnostics_1 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });
ts.addRelatedInfo.apply(void 0, [error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)].concat(diagnostics_1));
ts.addRelatedInfo.apply(void 0, __spreadArrays([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_1));
return true;
}
}
@@ -65399,9 +65410,9 @@ var ts;
ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;
function createFunctionCall(func, thisArg, argumentsList, location) {
return ts.setTextRange(ts.createCall(ts.createPropertyAccess(func, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
thisArg
].concat(argumentsList)), location);
], argumentsList)), location);
}
ts.createFunctionCall = createFunctionCall;
function createFunctionApply(func, thisArg, argumentsExpression, location) {
@@ -65571,7 +65582,7 @@ var ts;
ts.createForOfBindingStatement = createForOfBindingStatement;
function insertLeadingStatement(dest, source) {
if (ts.isBlock(dest)) {
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray([source].concat(dest.statements)), dest.statements));
return ts.updateBlock(dest, ts.setTextRange(ts.createNodeArray(__spreadArrays([source], dest.statements)), dest.statements));
}
else {
return ts.createBlock(ts.createNodeArray([dest, source]), /*multiLine*/ true);
@@ -66018,9 +66029,9 @@ var ts;
function ensureUseStrict(statements) {
var foundUseStrict = findUseStrictPrologue(statements);
if (!foundUseStrict) {
return ts.setTextRange(ts.createNodeArray([
return ts.setTextRange(ts.createNodeArray(__spreadArrays([
startOnNewLine(ts.createStatement(ts.createLiteral("use strict")))
].concat(statements)), statements);
], statements)), statements);
}
return statements;
}
@@ -66958,7 +66969,7 @@ var ts;
context.startLexicalEnvironment();
statements = visitNodes(statements, visitor, ts.isStatement, start);
if (ensureUseStrict && !ts.startsWithUseStrict(statements)) {
statements = ts.setTextRange(ts.createNodeArray([ts.createExpressionStatement(ts.createLiteral("use strict"))].concat(statements)), statements);
statements = ts.setTextRange(ts.createNodeArray(__spreadArrays([ts.createExpressionStatement(ts.createLiteral("use strict"))], statements)), statements);
}
var declarations = context.endLexicalEnvironment();
return ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements);
@@ -71986,7 +71997,7 @@ var ts;
var savedPendingStatements = pendingStatements;
pendingStatements = [];
var visitedNode = ts.visitEachChild(node, visitor, context);
var statement = ts.some(pendingStatements) ? [visitedNode].concat(pendingStatements) :
var statement = ts.some(pendingStatements) ? __spreadArrays([visitedNode], pendingStatements) :
visitedNode;
pendingStatements = savedPendingStatements;
return statement;
@@ -72786,9 +72797,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -73102,9 +73113,9 @@ var ts;
var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);
var block = ts.visitNode(node.block, visitor, ts.isBlock);
if (ts.some(visitedBindings)) {
block = ts.updateBlock(block, [
block = ts.updateBlock(block, __spreadArrays([
ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
].concat(block.statements));
], block.statements));
}
return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block);
}
@@ -73488,9 +73499,9 @@ var ts;
? substitutePropertyAccessExpression(expression)
: substituteElementAccessExpression(expression);
return ts.createCall(ts.createPropertyAccess(argumentExpression, "call"),
/*typeArguments*/ undefined, [
/*typeArguments*/ undefined, __spreadArrays([
ts.createThis()
].concat(node.arguments));
], node.arguments));
}
return node;
}
@@ -76654,7 +76665,7 @@ var ts;
}
function addStatementToStartOfBlock(block, statement) {
var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);
return ts.updateBlock(block, [statement].concat(transformedStatements));
return ts.updateBlock(block, __spreadArrays([statement], transformedStatements));
}
/**
* Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a
@@ -76922,7 +76933,7 @@ var ts;
// [output]
// new ((_a = C).bind.apply(_a, [void 0].concat(a)))()
var _a = ts.createCallBinding(ts.createPropertyAccess(node.expression, "bind"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray([ts.createVoidZero()].concat(node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
return ts.createNew(ts.createFunctionApply(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(ts.createNodeArray(__spreadArrays([ts.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)),
/*typeArguments*/ undefined, []);
}
return ts.visitEachChild(node, visitor, context);
@@ -78342,13 +78353,13 @@ var ts;
temp = declareLocal();
var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);
emitAssignment(temp, ts.createArrayLiteral(leadingElement
? [leadingElement].concat(initialElements) : initialElements));
? __spreadArrays([leadingElement], initialElements) : initialElements));
leadingElement = undefined;
}
var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);
return temp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine), location);
: ts.setTextRange(ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine), location);
function reduceElement(expressions, element) {
if (containsYield(element) && expressions.length > 0) {
var hasAssignedTemp = temp !== undefined;
@@ -78357,7 +78368,7 @@ var ts;
}
emitAssignment(temp, hasAssignedTemp
? ts.createArrayConcat(temp, [ts.createArrayLiteral(expressions, multiLine)])
: ts.createArrayLiteral(leadingElement ? [leadingElement].concat(expressions) : expressions, multiLine));
: ts.createArrayLiteral(leadingElement ? __spreadArrays([leadingElement], expressions) : expressions, multiLine));
leadingElement = undefined;
expressions = [];
}
@@ -80294,14 +80305,14 @@ var ts;
// define(moduleName?, ["module1", "module2"], function ...
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([
ts.createExpressionStatement(ts.createCall(define,
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
// Add the dependency array argument:
//
// ["require", "exports", module1", "module2", ...]
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : [
ts.createArrayLiteral(jsonSourceFile ? ts.emptyArray : __spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
// Add the module body function argument:
//
// function (require, exports, module1, module2) ...
@@ -80311,10 +80322,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
])))
]),
@@ -80349,11 +80360,11 @@ var ts;
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createExpressionStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
ts.createExpressionStatement(ts.createCall(ts.createIdentifier("define"),
/*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([
ts.createArrayLiteral([
/*typeArguments*/ undefined, __spreadArrays((moduleName ? [moduleName] : []), [
ts.createArrayLiteral(__spreadArrays([
ts.createLiteral("require"),
ts.createLiteral("exports")
].concat(aliasedModuleNames, unaliasedModuleNames)),
], aliasedModuleNames, unaliasedModuleNames)),
ts.createIdentifier("factory")
])))
])))
@@ -80381,10 +80392,10 @@ var ts;
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined, [
/*typeParameters*/ undefined, __spreadArrays([
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
].concat(importAliasNames),
], importAliasNames),
/*type*/ undefined, transformAsynchronousModuleBody(node))
]))
]),
@@ -83752,7 +83763,7 @@ var ts;
refs.forEach(referenceVisitor);
var emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = ts.setTextRange(ts.createNodeArray(combinedStatements.concat([createEmptyExports()])), combinedStatements);
combinedStatements = ts.setTextRange(ts.createNodeArray(__spreadArrays(combinedStatements, [createEmptyExports()])), combinedStatements);
}
var updated = ts.updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
@@ -84424,7 +84435,7 @@ var ts;
// 3. Some things are exported, some are not, and there's no marker - add an empty marker
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
if (needsScopeFixMarker) {
lateStatements = ts.createNodeArray(lateStatements.concat([createEmptyExports()]));
lateStatements = ts.createNodeArray(__spreadArrays(lateStatements, [createEmptyExports()]));
}
else {
lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);
@@ -84643,7 +84654,7 @@ var ts;
if (lines.length > 1) {
var lastLines = lines.slice(1);
var indentation_1 = ts.guessIndentation(lastLines);
text = [lines[0]].concat(ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
text = __spreadArrays([lines[0]], ts.map(lastLines, function (l) { return l.slice(indentation_1); })).join(newLine);
}
ts.addSyntheticLeadingComment(prop, range.kind, text, range.hasTrailingNewLine);
}
@@ -85078,7 +85089,7 @@ var ts;
var statements;
if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations) {
if (lexicalEnvironmentFunctionDeclarations) {
statements = lexicalEnvironmentFunctionDeclarations.slice();
statements = __spreadArrays(lexicalEnvironmentFunctionDeclarations);
}
if (lexicalEnvironmentVariableDeclarations) {
var statement = ts.createVariableStatement(
@@ -85740,7 +85751,7 @@ var ts;
var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
var emitHost = {
getPrependNodes: ts.memoize(function () { return prependNodes.concat([ownPrependInput]); }),
getPrependNodes: ts.memoize(function () { return __spreadArrays(prependNodes, [ownPrependInput]); }),
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },
getCompilerOptions: function () { return config.options; },
@@ -90260,7 +90271,7 @@ var ts;
}
ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;
function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {
var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (ts.getEmitDeclarations(program.getCompilerOptions())) {
ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));
}
@@ -90537,7 +90548,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
return configFileParseResult.options.configFile ? __spreadArrays(configFileParseResult.options.configFile.parseDiagnostics, configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -91287,7 +91298,7 @@ var ts;
// immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
// get any preEmit diagnostics, not just the ones
if (options.noEmitOnError) {
var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
var diagnostics = __spreadArrays(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken));
if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {
declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);
}
@@ -91847,7 +91858,7 @@ var ts;
args[_i - 1] = arguments[_i];
}
fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined
? ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(args)) : ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(args)));
? ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, diagnostic], args)) : ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([diagnostic], args)));
}, refFile);
}
function reportFileNamesDifferOnlyInCasingError(fileName, existingFileName, refFile, refPos, refEnd) {
@@ -92179,10 +92190,10 @@ var ts;
args[_i - 4] = arguments[_i];
}
if (refFile === undefined || refPos === undefined || refEnd === undefined) {
return ts.createCompilerDiagnostic.apply(void 0, [message].concat(args));
return ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args));
}
else {
return ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, message].concat(args));
return ts.createFileDiagnostic.apply(void 0, __spreadArrays([refFile, refPos, refEnd - refPos, message], args));
}
}
function getCanonicalFileName(fileName) {
@@ -94925,7 +94936,7 @@ var ts;
*/
function getAllModulePaths(files, importingFileName, importedFileName, getCanonicalFileName, host, redirectTargetsMap) {
var redirects = redirectTargetsMap.get(importedFileName);
var importedFileNames = redirects ? redirects.concat([importedFileName]) : [importedFileName];
var importedFileNames = redirects ? __spreadArrays(redirects, [importedFileName]) : [importedFileName];
var cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : "";
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
var links = discoverProbableSymlinks(files, getCanonicalFileName, cwd);
@@ -95415,7 +95426,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
if (result) {
result.version = computeHash.call(host, result.text);
}
@@ -95605,7 +95616,7 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args));
return getVersionedSourceFileByPath.apply(void 0, __spreadArrays([fileName, toPath(fileName)], args));
};
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
compilerHost.getNewLine = function () { return newLine; };
@@ -96276,7 +96287,7 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args));
return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args));
}), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;
state.readFileWithCache = readFileWithCache;
compilerHost.getSourceFile = getSourceFileWithCache;
@@ -96503,7 +96514,7 @@ var ts;
}
function getSyntaxDiagnostics(cancellationToken) {
ts.Debug.assertDefined(program);
handleDiagnostics(program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
handleDiagnostics(__spreadArrays(program.getConfigFileParsingDiagnostics(), program.getOptionsDiagnostics(cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, "Syntactic");
}
function getSemanticDiagnostics(cancellationToken) {
handleDiagnostics(ts.Debug.assertDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, "Semantic");
@@ -97321,7 +97332,7 @@ var ts;
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)));
state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)));
}
function reportWatchStatus(state, message) {
var args = [];
@@ -97329,7 +97340,7 @@ var ts;
args[_i - 2] = arguments[_i];
}
if (state.hostWithWatch.onWatchStatusChange) {
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, [message].concat(args)), state.host.getNewLine(), state.baseCompilerOptions);
state.hostWithWatch.onWatchStatusChange(ts.createCompilerDiagnostic.apply(void 0, __spreadArrays([message], args)), state.host.getNewLine(), state.baseCompilerOptions);
}
}
function reportErrors(_a, errors) {