Skip to content

Commit 69972a3

Browse files
Merge remote-tracking branch 'origin/master' into release-4.1
2 parents 3ae68fa + f66c8e6 commit 69972a3

17 files changed

+397
-53
lines changed

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compiler/checker.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13922,7 +13922,7 @@ namespace ts {
1392213922
}
1392313923

1392413924
const shouldIncludeUndefined =
13925-
compilerOptions.noUncheckedIndexSignatures &&
13925+
compilerOptions.noUncheckedIndexedAccess &&
1392613926
(accessFlags & (AccessFlags.Writing | AccessFlags.ExpressionPosition)) === AccessFlags.ExpressionPosition;
1392713927

1392813928
// 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 {
2073520735

2073620736
function includeUndefinedInIndexSignature(type: Type | undefined): Type | undefined {
2073720737
if (!type) return type;
20738-
return compilerOptions.noUncheckedIndexSignatures ?
20738+
return compilerOptions.noUncheckedIndexedAccess ?
2073920739
getUnionType([type, undefinedType]) :
2074020740
type;
2074120741
}
@@ -25478,7 +25478,7 @@ namespace ts {
2547825478
error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
2547925479
}
2548025480

25481-
propType = (compilerOptions.noUncheckedIndexSignatures && !isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
25481+
propType = (compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
2548225482
}
2548325483
else {
2548425484
if (prop.valueDeclaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
@@ -29445,7 +29445,7 @@ namespace ts {
2944529445
// present (aka the tuple element property). This call also checks that the parentType is in
2944629446
// fact an iterable or array (depending on target language).
2944729447
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(IterationUse.Destructuring | IterationUse.PossiblyOutOfBounds, sourceType, undefinedType, node) || errorType;
29448-
let inBoundsType: Type | undefined = compilerOptions.noUncheckedIndexSignatures ? undefined: possiblyOutOfBoundsType;
29448+
let inBoundsType: Type | undefined = compilerOptions.noUncheckedIndexedAccess ? undefined: possiblyOutOfBoundsType;
2944929449
for (let i = 0; i < elements.length; i++) {
2945029450
let type = possiblyOutOfBoundsType;
2945129451
if (node.elements[i].kind === SyntaxKind.SpreadElement) {
@@ -33709,7 +33709,7 @@ namespace ts {
3370933709

3371033710
const uplevelIteration = languageVersion >= ScriptTarget.ES2015;
3371133711
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
33712-
const possibleOutOfBounds = compilerOptions.noUncheckedIndexSignatures && !!(use & IterationUse.PossiblyOutOfBounds);
33712+
const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & IterationUse.PossiblyOutOfBounds);
3371333713

3371433714
// Get the iterated type of an `Iterable<T>` or `IterableIterator<T>` only in ES2015
3371533715
// or higher, when inside of an async generator or for-await-if, or when
@@ -33804,7 +33804,7 @@ namespace ts {
3380433804
const arrayElementType = getIndexTypeOfType(arrayType, IndexKind.Number);
3380533805
if (hasStringConstituent && arrayElementType) {
3380633806
// This is just an optimization for the case where arrayOrStringType is string | string[]
33807-
if (arrayElementType.flags & TypeFlags.StringLike && !compilerOptions.noUncheckedIndexSignatures) {
33807+
if (arrayElementType.flags & TypeFlags.StringLike && !compilerOptions.noUncheckedIndexedAccess) {
3380833808
return stringType;
3380933809
}
3381033810

src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5652,6 +5652,9 @@
56525652
<Item ItemId=";Generates_an_event_trace_and_a_list_of_types_6237" ItemType="0" PsrId="306" Leaf="true">
56535653
<Str Cat="Text">
56545654
<Val><![CDATA[Generates an event trace and a list of types.]]></Val>
5655+
<Tgt Cat="Text" Stat="Loc" Orig="New">
5656+
<Val><![CDATA[產生事件追蹤與類型清單。]]></Val>
5657+
</Tgt>
56555658
</Str>
56565659
<Disp Icon="Str" />
56575660
</Item>
@@ -6075,6 +6078,9 @@
60756078
<Item ItemId=";Include_undefined_in_index_signature_results_6800" ItemType="0" PsrId="306" Leaf="true">
60766079
<Str Cat="Text">
60776080
<Val><![CDATA[Include 'undefined' in index signature results]]></Val>
6081+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6082+
<Val><![CDATA[在索引簽章結果中包含 'undefined']]></Val>
6083+
</Tgt>
60786084
</Str>
60796085
<Disp Icon="Str" />
60806086
</Item>
@@ -7293,6 +7299,9 @@
72937299
<Item ItemId=";Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090" ItemType="0" PsrId="306" Leaf="true">
72947300
<Str Cat="Text">
72957301
<Val><![CDATA[Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?]]></Val>
7302+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7303+
<Val><![CDATA[未設定 'baseUrl' 時,不得使用非相對路徑。是否忘記使用前置 './'?]]></Val>
7304+
</Tgt>
72967305
</Str>
72977306
<Disp Icon="Str" />
72987307
</Item>
@@ -7617,6 +7626,9 @@
76177626
<Item ItemId=";Option_0_cannot_be_specified_when_option_jsx_is_1_5089" ItemType="0" PsrId="306" Leaf="true">
76187627
<Str Cat="Text">
76197628
<Val><![CDATA[Option '{0}' cannot be specified when option 'jsx' is '{1}'.]]></Val>
7629+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7630+
<Val><![CDATA[當選項 'jsx' 為 '{1}' 時,無法指定選項 '{0}'。]]></Val>
7631+
</Tgt>
76207632
</Str>
76217633
<Disp Icon="Str" />
76227634
</Item>
@@ -8793,6 +8805,9 @@
87938805
<Item ItemId=";Provides_a_root_package_name_when_using_outFile_with_declarations_1390" ItemType="0" PsrId="306" Leaf="true">
87948806
<Str Cat="Text">
87958807
<Val><![CDATA[Provides a root package name when using outFile with declarations.]]></Val>
8808+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8809+
<Val><![CDATA[使用 outFile 時若有宣告,請提供根套件名稱。]]></Val>
8810+
</Tgt>
87968811
</Str>
87978812
<Disp Icon="Str" />
87988813
</Item>
@@ -9945,6 +9960,9 @@
99459960
<Item ItemId=";Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238" ItemType="0" PsrId="306" Leaf="true">
99469961
<Str Cat="Text">
99479962
<Val><![CDATA[Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react]]></Val>
9963+
<Tgt Cat="Text" Stat="Loc" Orig="New">
9964+
<Val><![CDATA[指定用於匯入 `jsx` 與 `jsxs` Factory 函式的模組指定名稱。例如,傳送表情符號]]></Val>
9965+
</Tgt>
99489966
</Str>
99499967
<Disp Icon="Str" />
99509968
</Item>
@@ -10242,6 +10260,9 @@
1024210260
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
1024310261
<Str Cat="Text">
1024410262
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
10263+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10264+
<Val><![CDATA[樣板常值型別引數 ' {0} ' 不是常值型別或泛型型別。]]></Val>
10265+
</Tgt>
1024510266
</Str>
1024610267
<Disp Icon="Str" />
1024710268
</Item>
@@ -10329,6 +10350,9 @@
1032910350
<Item ItemId=";The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391" ItemType="0" PsrId="306" Leaf="true">
1033010351
<Str Cat="Text">
1033110352
<Val><![CDATA[The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.]]></Val>
10353+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10354+
<Val><![CDATA[使用 outFile 及節點模組解析且發出宣告時,必須提供 `bundledPackageName` 選項。]]></Val>
10355+
</Tgt>
1033210356
</Str>
1033310357
<Disp Icon="Str" />
1033410358
</Item>

src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5661,6 +5661,9 @@
56615661
<Item ItemId=";Generates_an_event_trace_and_a_list_of_types_6237" ItemType="0" PsrId="306" Leaf="true">
56625662
<Str Cat="Text">
56635663
<Val><![CDATA[Generates an event trace and a list of types.]]></Val>
5664+
<Tgt Cat="Text" Stat="Loc" Orig="New">
5665+
<Val><![CDATA[Generuje trasování události a seznam typů.]]></Val>
5666+
</Tgt>
56645667
</Str>
56655668
<Disp Icon="Str" />
56665669
</Item>
@@ -6084,6 +6087,9 @@
60846087
<Item ItemId=";Include_undefined_in_index_signature_results_6800" ItemType="0" PsrId="306" Leaf="true">
60856088
<Str Cat="Text">
60866089
<Val><![CDATA[Include 'undefined' in index signature results]]></Val>
6090+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6091+
<Val><![CDATA[Zahrnout položku undefined do výsledků signatury indexu]]></Val>
6092+
</Tgt>
60876093
</Str>
60886094
<Disp Icon="Str" />
60896095
</Item>
@@ -7302,6 +7308,9 @@
73027308
<Item ItemId=";Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090" ItemType="0" PsrId="306" Leaf="true">
73037309
<Str Cat="Text">
73047310
<Val><![CDATA[Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?]]></Val>
7311+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7312+
<Val><![CDATA[Nerelativní cesty nejsou povolené, pokud není nastavená hodnota baseUrl. Nezapomněli jste na úvodní znak „./“?]]></Val>
7313+
</Tgt>
73057314
</Str>
73067315
<Disp Icon="Str" />
73077316
</Item>
@@ -7626,6 +7635,9 @@
76267635
<Item ItemId=";Option_0_cannot_be_specified_when_option_jsx_is_1_5089" ItemType="0" PsrId="306" Leaf="true">
76277636
<Str Cat="Text">
76287637
<Val><![CDATA[Option '{0}' cannot be specified when option 'jsx' is '{1}'.]]></Val>
7638+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7639+
<Val><![CDATA[Když je možnost jsx nastavená na {1}, možnost {0} se nedá zadat.]]></Val>
7640+
</Tgt>
76297641
</Str>
76307642
<Disp Icon="Str" />
76317643
</Item>
@@ -8802,6 +8814,9 @@
88028814
<Item ItemId=";Provides_a_root_package_name_when_using_outFile_with_declarations_1390" ItemType="0" PsrId="306" Leaf="true">
88038815
<Str Cat="Text">
88048816
<Val><![CDATA[Provides a root package name when using outFile with declarations.]]></Val>
8817+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8818+
<Val><![CDATA[Poskytuje název kořenového balíčku při použití položky outFile s deklaracemi.]]></Val>
8819+
</Tgt>
88058820
</Str>
88068821
<Disp Icon="Str" />
88078822
</Item>
@@ -9954,6 +9969,9 @@
99549969
<Item ItemId=";Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238" ItemType="0" PsrId="306" Leaf="true">
99559970
<Str Cat="Text">
99569971
<Val><![CDATA[Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react]]></Val>
9972+
<Tgt Cat="Text" Stat="Loc" Orig="New">
9973+
<Val><![CDATA[Zadejte specifikátor modulu, který se má použít k importu továrních funkcí jsx a jsxs např. z funkce react.]]></Val>
9974+
</Tgt>
99579975
</Str>
99589976
<Disp Icon="Str" />
99599977
</Item>
@@ -10251,6 +10269,9 @@
1025110269
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
1025210270
<Str Cat="Text">
1025310271
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
10272+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10273+
<Val><![CDATA[Argument typu literálu šablony {0} není literálového ani generického typu.]]></Val>
10274+
</Tgt>
1025410275
</Str>
1025510276
<Disp Icon="Str" />
1025610277
</Item>
@@ -10338,6 +10359,9 @@
1033810359
<Item ItemId=";The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391" ItemType="0" PsrId="306" Leaf="true">
1033910360
<Str Cat="Text">
1034010361
<Val><![CDATA[The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.]]></Val>
10362+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10363+
<Val><![CDATA[Při použití řešení modulu outFile a node s deklarací musí být zadána možnost bundledPackageName.]]></Val>
10364+
</Tgt>
1034110365
</Str>
1034210366
<Disp Icon="Str" />
1034310367
</Item>

src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5649,6 +5649,9 @@
56495649
<Item ItemId=";Generates_an_event_trace_and_a_list_of_types_6237" ItemType="0" PsrId="306" Leaf="true">
56505650
<Str Cat="Text">
56515651
<Val><![CDATA[Generates an event trace and a list of types.]]></Val>
5652+
<Tgt Cat="Text" Stat="Loc" Orig="New">
5653+
<Val><![CDATA[Generiert eine Ereignisablaufverfolgung und eine Liste von Typen.]]></Val>
5654+
</Tgt>
56525655
</Str>
56535656
<Disp Icon="Str" />
56545657
</Item>
@@ -6072,6 +6075,9 @@
60726075
<Item ItemId=";Include_undefined_in_index_signature_results_6800" ItemType="0" PsrId="306" Leaf="true">
60736076
<Str Cat="Text">
60746077
<Val><![CDATA[Include 'undefined' in index signature results]]></Val>
6078+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6079+
<Val><![CDATA["Nicht definiert" in Indexsignaturergebnisse einbeziehen]]></Val>
6080+
</Tgt>
60756081
</Str>
60766082
<Disp Icon="Str" />
60776083
</Item>
@@ -7290,6 +7296,9 @@
72907296
<Item ItemId=";Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090" ItemType="0" PsrId="306" Leaf="true">
72917297
<Str Cat="Text">
72927298
<Val><![CDATA[Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?]]></Val>
7299+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7300+
<Val><![CDATA[Nicht relative Pfade sind nur zulässig, wenn "baseUrl" festgelegt wurde. Fehlt am Anfang die Zeichenfolge "./"?]]></Val>
7301+
</Tgt>
72937302
</Str>
72947303
<Disp Icon="Str" />
72957304
</Item>
@@ -7614,6 +7623,9 @@
76147623
<Item ItemId=";Option_0_cannot_be_specified_when_option_jsx_is_1_5089" ItemType="0" PsrId="306" Leaf="true">
76157624
<Str Cat="Text">
76167625
<Val><![CDATA[Option '{0}' cannot be specified when option 'jsx' is '{1}'.]]></Val>
7626+
<Tgt Cat="Text" Stat="Loc" Orig="New">
7627+
<Val><![CDATA[Die Option "{0}" kann nicht angegeben werden, wenn die Option "jsx" den Wert "{1}" aufweist.]]></Val>
7628+
</Tgt>
76177629
</Str>
76187630
<Disp Icon="Str" />
76197631
</Item>
@@ -8787,6 +8799,9 @@
87878799
<Item ItemId=";Provides_a_root_package_name_when_using_outFile_with_declarations_1390" ItemType="0" PsrId="306" Leaf="true">
87888800
<Str Cat="Text">
87898801
<Val><![CDATA[Provides a root package name when using outFile with declarations.]]></Val>
8802+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8803+
<Val><![CDATA[Stellt einen Stammpaketnamen bereit, wenn "outFile" mit Deklarationen verwendet wird.]]></Val>
8804+
</Tgt>
87908805
</Str>
87918806
<Disp Icon="Str" />
87928807
</Item>
@@ -9939,6 +9954,9 @@
99399954
<Item ItemId=";Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238" ItemType="0" PsrId="306" Leaf="true">
99409955
<Str Cat="Text">
99419956
<Val><![CDATA[Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react]]></Val>
9957+
<Tgt Cat="Text" Stat="Loc" Orig="New">
9958+
<Val><![CDATA[Geben Sie den Modulspezifizierer an, aus dem die Factoryfunktionen "jsx" und "jsxs" importiert werden sollen, z. B. "react".]]></Val>
9959+
</Tgt>
99429960
</Str>
99439961
<Disp Icon="Str" />
99449962
</Item>
@@ -10236,6 +10254,9 @@
1023610254
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
1023710255
<Str Cat="Text">
1023810256
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
10257+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10258+
<Val><![CDATA[Das Typargument "{0}" des Vorlagenliterals ist weder ein Literaltyp noch ein generischer Typ.]]></Val>
10259+
</Tgt>
1023910260
</Str>
1024010261
<Disp Icon="Str" />
1024110262
</Item>
@@ -10323,6 +10344,9 @@
1032310344
<Item ItemId=";The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391" ItemType="0" PsrId="306" Leaf="true">
1032410345
<Str Cat="Text">
1032510346
<Val><![CDATA[The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.]]></Val>
10347+
<Tgt Cat="Text" Stat="Loc" Orig="New">
10348+
<Val><![CDATA[Die Option "bundledPackageName" muss angegeben werden, wenn "outFile" und die Knotenmodulauflösung mit der Deklarationsausgabe verwendet werden.]]></Val>
10349+
</Tgt>
1032610350
</Str>
1032710351
<Disp Icon="Str" />
1032810352
</Item>

0 commit comments

Comments
 (0)