mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fix missing renamed compiler flags (#40606)
This commit is contained in:
@@ -13922,7 +13922,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const shouldIncludeUndefined =
|
||||
compilerOptions.noUncheckedIndexSignatures &&
|
||||
compilerOptions.noUncheckedIndexedAccess &&
|
||||
(accessFlags & (AccessFlags.Writing | AccessFlags.ExpressionPosition)) === AccessFlags.ExpressionPosition;
|
||||
|
||||
// If the object type has a string index signature and no other members we know that the result will
|
||||
@@ -20735,7 +20735,7 @@ namespace ts {
|
||||
|
||||
function includeUndefinedInIndexSignature(type: Type | undefined): Type | undefined {
|
||||
if (!type) return type;
|
||||
return compilerOptions.noUncheckedIndexSignatures ?
|
||||
return compilerOptions.noUncheckedIndexedAccess ?
|
||||
getUnionType([type, undefinedType]) :
|
||||
type;
|
||||
}
|
||||
@@ -25478,7 +25478,7 @@ namespace ts {
|
||||
error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
||||
}
|
||||
|
||||
propType = (compilerOptions.noUncheckedIndexSignatures && !isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
||||
propType = (compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
||||
}
|
||||
else {
|
||||
if (prop.valueDeclaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
|
||||
@@ -29445,7 +29445,7 @@ namespace ts {
|
||||
// present (aka the tuple element property). This call also checks that the parentType is in
|
||||
// fact an iterable or array (depending on target language).
|
||||
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(IterationUse.Destructuring | IterationUse.PossiblyOutOfBounds, sourceType, undefinedType, node) || errorType;
|
||||
let inBoundsType: Type | undefined = compilerOptions.noUncheckedIndexSignatures ? undefined: possiblyOutOfBoundsType;
|
||||
let inBoundsType: Type | undefined = compilerOptions.noUncheckedIndexedAccess ? undefined: possiblyOutOfBoundsType;
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
let type = possiblyOutOfBoundsType;
|
||||
if (node.elements[i].kind === SyntaxKind.SpreadElement) {
|
||||
@@ -33709,7 +33709,7 @@ namespace ts {
|
||||
|
||||
const uplevelIteration = languageVersion >= ScriptTarget.ES2015;
|
||||
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
||||
const possibleOutOfBounds = compilerOptions.noUncheckedIndexSignatures && !!(use & IterationUse.PossiblyOutOfBounds);
|
||||
const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & IterationUse.PossiblyOutOfBounds);
|
||||
|
||||
// Get the iterated type of an `Iterable<T>` or `IterableIterator<T>` only in ES2015
|
||||
// or higher, when inside of an async generator or for-await-if, or when
|
||||
@@ -33804,7 +33804,7 @@ namespace ts {
|
||||
const arrayElementType = getIndexTypeOfType(arrayType, IndexKind.Number);
|
||||
if (hasStringConstituent && arrayElementType) {
|
||||
// This is just an optimization for the case where arrayOrStringType is string | string[]
|
||||
if (arrayElementType.flags & TypeFlags.StringLike && !compilerOptions.noUncheckedIndexSignatures) {
|
||||
if (arrayElementType.flags & TypeFlags.StringLike && !compilerOptions.noUncheckedIndexedAccess) {
|
||||
return stringType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user