Skip to content

Commit dcad07f

Browse files
Update LKG
1 parent d4d640f commit dcad07f

7 files changed

+5835
-115
lines changed

lib/tsc.js

+25-9
Original file line numberDiff line numberDiff line change
@@ -11724,6 +11724,20 @@ function getScriptTargetFeatures() {
1172411724
BigUint64Array: ["at"],
1172511725
ObjectConstructor: ["hasOwn"],
1172611726
Error: ["cause"]
11727+
},
11728+
es2023: {
11729+
Array: ["findLastIndex", "findLast"],
11730+
Int8Array: ["findLastIndex", "findLast"],
11731+
Uint8Array: ["findLastIndex", "findLast"],
11732+
Uint8ClampedArray: ["findLastIndex", "findLast"],
11733+
Int16Array: ["findLastIndex", "findLast"],
11734+
Uint16Array: ["findLastIndex", "findLast"],
11735+
Int32Array: ["findLastIndex", "findLast"],
11736+
Uint32Array: ["findLastIndex", "findLast"],
11737+
Float32Array: ["findLastIndex", "findLast"],
11738+
Float64Array: ["findLastIndex", "findLast"],
11739+
BigInt64Array: ["findLastIndex", "findLast"],
11740+
BigUint64Array: ["findLastIndex", "findLast"]
1172711741
}
1172811742
};
1172911743
}
@@ -46308,7 +46322,7 @@ function createTypeChecker(host) {
4630846322
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
4630946323
function symbolToStringWorker(writer2) {
4631046324
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
46311-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
46325+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
4631246326
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
4631346327
printer.writeNode(
4631446328
4 /* Unspecified */,
@@ -46330,7 +46344,7 @@ function createTypeChecker(host) {
4633046344
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
4633146345
}
4633246346
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
46333-
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
46347+
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
4633446348
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
4633546349
printer.writeNode(
4633646350
4 /* Unspecified */,
@@ -46347,8 +46361,7 @@ function createTypeChecker(host) {
4634746361
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
4634846362
if (typeNode === void 0)
4634946363
return Debug.fail("should always get typenode");
46350-
const options = { removeComments: type !== unresolvedType };
46351-
const printer = createPrinter(options);
46364+
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
4635246365
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
4635346366
printer.writeNode(
4635446367
4 /* Unspecified */,
@@ -49699,7 +49712,7 @@ function createTypeChecker(host) {
4969949712
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
4970049713
// TODO: GH#18217
4970149714
);
49702-
const printer = createPrinter({ removeComments: true });
49715+
const printer = createPrinterWithRemoveComments();
4970349716
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
4970449717
printer.writeNode(
4970549718
4 /* Unspecified */,
@@ -64727,7 +64740,7 @@ function createTypeChecker(host) {
6472764740
return getNonMissingTypeOfSymbol(symbol);
6472864741
}
6472964742
function getControlFlowContainer(node) {
64730-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */);
64743+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
6473164744
}
6473264745
function isSymbolAssigned(symbol) {
6473364746
if (!symbol.valueDeclaration) {
@@ -64988,14 +65001,13 @@ function createTypeChecker(host) {
6498865001
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
6498965002
const declarationContainer = getControlFlowContainer(declaration);
6499065003
let flowContainer = getControlFlowContainer(node);
64991-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
6499265004
const isOuterVariable = flowContainer !== declarationContainer;
6499365005
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
6499465006
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
6499565007
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
6499665008
flowContainer = getControlFlowContainer(flowContainer);
6499765009
}
64998-
const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
65010+
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
6499965011
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
6500065012
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
6500165013
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -78255,7 +78267,7 @@ function createTypeChecker(host) {
7825578267
if (typeAnnotationNode) {
7825678268
checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
7825778269
}
78258-
const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
78270+
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
7825978271
if (node.expression.kind === 79 /* Identifier */) {
7826078272
const id = node.expression;
7826178273
const sym = resolveEntityName(
@@ -106274,6 +106286,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
106274106286
);
106275106287
return outputFiles;
106276106288
}
106289+
var createPrinterWithDefaults = memoize(() => createPrinter({}));
106290+
var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
106291+
var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
106292+
var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
106277106293
function createPrinter(printerOptions = {}, handlers = {}) {
106278106294
const {
106279106295
hasGlobalName,

0 commit comments

Comments
 (0)