@@ -11724,6 +11724,20 @@ function getScriptTargetFeatures() {
11724
11724
BigUint64Array: ["at"],
11725
11725
ObjectConstructor: ["hasOwn"],
11726
11726
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"]
11727
11741
}
11728
11742
};
11729
11743
}
@@ -46308,7 +46322,7 @@ function createTypeChecker(host) {
46308
46322
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
46309
46323
function symbolToStringWorker(writer2) {
46310
46324
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( );
46312
46326
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46313
46327
printer.writeNode(
46314
46328
4 /* Unspecified */,
@@ -46330,7 +46344,7 @@ function createTypeChecker(host) {
46330
46344
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
46331
46345
}
46332
46346
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( );
46334
46348
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46335
46349
printer.writeNode(
46336
46350
4 /* Unspecified */,
@@ -46347,8 +46361,7 @@ function createTypeChecker(host) {
46347
46361
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
46348
46362
if (typeNode === void 0)
46349
46363
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();
46352
46365
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46353
46366
printer.writeNode(
46354
46367
4 /* Unspecified */,
@@ -49699,7 +49712,7 @@ function createTypeChecker(host) {
49699
49712
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
49700
49713
// TODO: GH#18217
49701
49714
);
49702
- const printer = createPrinter({ removeComments: true } );
49715
+ const printer = createPrinterWithRemoveComments( );
49703
49716
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
49704
49717
printer.writeNode(
49705
49718
4 /* Unspecified */,
@@ -64727,7 +64740,7 @@ function createTypeChecker(host) {
64727
64740
return getNonMissingTypeOfSymbol(symbol);
64728
64741
}
64729
64742
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 */);
64731
64744
}
64732
64745
function isSymbolAssigned(symbol) {
64733
64746
if (!symbol.valueDeclaration) {
@@ -64988,14 +65001,13 @@ function createTypeChecker(host) {
64988
65001
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
64989
65002
const declarationContainer = getControlFlowContainer(declaration);
64990
65003
let flowContainer = getControlFlowContainer(node);
64991
- const isCatch = flowContainer.kind === 295 /* CatchClause */;
64992
65004
const isOuterVariable = flowContainer !== declarationContainer;
64993
65005
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
64994
65006
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
64995
65007
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
64996
65008
flowContainer = getControlFlowContainer(flowContainer);
64997
65009
}
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 */;
64999
65011
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
65000
65012
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
65001
65013
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -78255,7 +78267,7 @@ function createTypeChecker(host) {
78255
78267
if (typeAnnotationNode) {
78256
78268
checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
78257
78269
}
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 */);
78259
78271
if (node.expression.kind === 79 /* Identifier */) {
78260
78272
const id = node.expression;
78261
78273
const sym = resolveEntityName(
@@ -106274,6 +106286,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
106274
106286
);
106275
106287
return outputFiles;
106276
106288
}
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 }));
106277
106293
function createPrinter(printerOptions = {}, handlers = {}) {
106278
106294
const {
106279
106295
hasGlobalName,
0 commit comments