typescript 5.2.0-dev.20230728 → 5.2.0-dev.20230730
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2015.core.d.ts +2 -2
- package/lib/lib.es2020.bigint.d.ts +4 -4
- package/lib/lib.es5.d.ts +18 -18
- package/lib/tsc.js +48 -41
- package/lib/tsserver.js +81 -58
- package/lib/tsserverlibrary.js +79 -58
- package/lib/typescript.js +74 -55
- package/lib/typingsInstaller.js +5 -5
- package/package.json +2 -2
package/lib/lib.es2015.core.d.ts
CHANGED
|
@@ -56,10 +56,10 @@ interface Array<T> {
|
|
|
56
56
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
57
57
|
* length of the array.
|
|
58
58
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
59
|
-
* is treated as length+end.
|
|
59
|
+
* is treated as length+end.
|
|
60
60
|
* @param end If not specified, length of the this object is used as its default value.
|
|
61
61
|
*/
|
|
62
|
-
copyWithin(target: number, start
|
|
62
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
interface ArrayConstructor {
|
|
@@ -165,10 +165,10 @@ interface BigInt64Array {
|
|
|
165
165
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
166
166
|
* length of the array.
|
|
167
167
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
168
|
-
* is treated as length+end.
|
|
168
|
+
* is treated as length+end.
|
|
169
169
|
* @param end If not specified, length of the this object is used as its default value.
|
|
170
170
|
*/
|
|
171
|
-
copyWithin(target: number, start
|
|
171
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
172
172
|
|
|
173
173
|
/** Yields index, value pairs for every entry in the array. */
|
|
174
174
|
entries(): IterableIterator<[number, bigint]>;
|
|
@@ -437,10 +437,10 @@ interface BigUint64Array {
|
|
|
437
437
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
438
438
|
* length of the array.
|
|
439
439
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
440
|
-
* is treated as length+end.
|
|
440
|
+
* is treated as length+end.
|
|
441
441
|
* @param end If not specified, length of the this object is used as its default value.
|
|
442
442
|
*/
|
|
443
|
-
copyWithin(target: number, start
|
|
443
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
444
444
|
|
|
445
445
|
/** Yields index, value pairs for every entry in the array. */
|
|
446
446
|
entries(): IterableIterator<[number, bigint]>;
|
package/lib/lib.es5.d.ts
CHANGED
|
@@ -1889,10 +1889,10 @@ interface Int8Array {
|
|
|
1889
1889
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
1890
1890
|
* length of the array.
|
|
1891
1891
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
1892
|
-
* is treated as length+end.
|
|
1892
|
+
* is treated as length+end.
|
|
1893
1893
|
* @param end If not specified, length of the this object is used as its default value.
|
|
1894
1894
|
*/
|
|
1895
|
-
copyWithin(target: number, start
|
|
1895
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
1896
1896
|
|
|
1897
1897
|
/**
|
|
1898
1898
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -2171,10 +2171,10 @@ interface Uint8Array {
|
|
|
2171
2171
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
2172
2172
|
* length of the array.
|
|
2173
2173
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
2174
|
-
* is treated as length+end.
|
|
2174
|
+
* is treated as length+end.
|
|
2175
2175
|
* @param end If not specified, length of the this object is used as its default value.
|
|
2176
2176
|
*/
|
|
2177
|
-
copyWithin(target: number, start
|
|
2177
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
2178
2178
|
|
|
2179
2179
|
/**
|
|
2180
2180
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -2453,10 +2453,10 @@ interface Uint8ClampedArray {
|
|
|
2453
2453
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
2454
2454
|
* length of the array.
|
|
2455
2455
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
2456
|
-
* is treated as length+end.
|
|
2456
|
+
* is treated as length+end.
|
|
2457
2457
|
* @param end If not specified, length of the this object is used as its default value.
|
|
2458
2458
|
*/
|
|
2459
|
-
copyWithin(target: number, start
|
|
2459
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
2460
2460
|
|
|
2461
2461
|
/**
|
|
2462
2462
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -2734,10 +2734,10 @@ interface Int16Array {
|
|
|
2734
2734
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
2735
2735
|
* length of the array.
|
|
2736
2736
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
2737
|
-
* is treated as length+end.
|
|
2737
|
+
* is treated as length+end.
|
|
2738
2738
|
* @param end If not specified, length of the this object is used as its default value.
|
|
2739
2739
|
*/
|
|
2740
|
-
copyWithin(target: number, start
|
|
2740
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
2741
2741
|
|
|
2742
2742
|
/**
|
|
2743
2743
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -3016,10 +3016,10 @@ interface Uint16Array {
|
|
|
3016
3016
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
3017
3017
|
* length of the array.
|
|
3018
3018
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
3019
|
-
* is treated as length+end.
|
|
3019
|
+
* is treated as length+end.
|
|
3020
3020
|
* @param end If not specified, length of the this object is used as its default value.
|
|
3021
3021
|
*/
|
|
3022
|
-
copyWithin(target: number, start
|
|
3022
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
3023
3023
|
|
|
3024
3024
|
/**
|
|
3025
3025
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -3298,10 +3298,10 @@ interface Int32Array {
|
|
|
3298
3298
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
3299
3299
|
* length of the array.
|
|
3300
3300
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
3301
|
-
* is treated as length+end.
|
|
3301
|
+
* is treated as length+end.
|
|
3302
3302
|
* @param end If not specified, length of the this object is used as its default value.
|
|
3303
3303
|
*/
|
|
3304
|
-
copyWithin(target: number, start
|
|
3304
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
3305
3305
|
|
|
3306
3306
|
/**
|
|
3307
3307
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -3580,10 +3580,10 @@ interface Uint32Array {
|
|
|
3580
3580
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
3581
3581
|
* length of the array.
|
|
3582
3582
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
3583
|
-
* is treated as length+end.
|
|
3583
|
+
* is treated as length+end.
|
|
3584
3584
|
* @param end If not specified, length of the this object is used as its default value.
|
|
3585
3585
|
*/
|
|
3586
|
-
copyWithin(target: number, start
|
|
3586
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
3587
3587
|
|
|
3588
3588
|
/**
|
|
3589
3589
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -3861,10 +3861,10 @@ interface Float32Array {
|
|
|
3861
3861
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
3862
3862
|
* length of the array.
|
|
3863
3863
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
3864
|
-
* is treated as length+end.
|
|
3864
|
+
* is treated as length+end.
|
|
3865
3865
|
* @param end If not specified, length of the this object is used as its default value.
|
|
3866
3866
|
*/
|
|
3867
|
-
copyWithin(target: number, start
|
|
3867
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
3868
3868
|
|
|
3869
3869
|
/**
|
|
3870
3870
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -4144,10 +4144,10 @@ interface Float64Array {
|
|
|
4144
4144
|
* @param target If target is negative, it is treated as length+target where length is the
|
|
4145
4145
|
* length of the array.
|
|
4146
4146
|
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
4147
|
-
* is treated as length+end.
|
|
4147
|
+
* is treated as length+end.
|
|
4148
4148
|
* @param end If not specified, length of the this object is used as its default value.
|
|
4149
4149
|
*/
|
|
4150
|
-
copyWithin(target: number, start
|
|
4150
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
4151
4151
|
|
|
4152
4152
|
/**
|
|
4153
4153
|
* Determines whether all the members of an array satisfy the specified test.
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230730`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -908,7 +908,7 @@ function identity(x) {
|
|
|
908
908
|
function toLowerCase(x) {
|
|
909
909
|
return x.toLowerCase();
|
|
910
910
|
}
|
|
911
|
-
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_
|
|
911
|
+
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
|
912
912
|
function toFileNameLowerCase(x) {
|
|
913
913
|
return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x;
|
|
914
914
|
}
|
|
@@ -1526,7 +1526,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1526
1526
|
return func.name;
|
|
1527
1527
|
} else {
|
|
1528
1528
|
const text = Function.prototype.toString.call(func);
|
|
1529
|
-
const match = /^function\s+([\w
|
|
1529
|
+
const match = /^function\s+([\w$]+)\s*\(/.exec(text);
|
|
1530
1530
|
return match ? match[1] : "";
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
@@ -2309,7 +2309,7 @@ ${lanes.join("\n")}
|
|
|
2309
2309
|
})(Debug || (Debug = {}));
|
|
2310
2310
|
|
|
2311
2311
|
// src/compiler/semver.ts
|
|
2312
|
-
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(
|
|
2312
|
+
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
|
2313
2313
|
var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
|
|
2314
2314
|
var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
|
2315
2315
|
var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
|
@@ -10108,7 +10108,7 @@ function getNodeFlags(node) {
|
|
|
10108
10108
|
var supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
|
|
10109
10109
|
function validateLocaleAndSetLanguage(locale, sys2, errors) {
|
|
10110
10110
|
const lowerCaseLocale = locale.toLowerCase();
|
|
10111
|
-
const matchResult = /^([a-z]+)([_
|
|
10111
|
+
const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale);
|
|
10112
10112
|
if (!matchResult) {
|
|
10113
10113
|
if (errors) {
|
|
10114
10114
|
errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
|
|
@@ -14644,9 +14644,9 @@ function escapeTemplateSubstitution(str) {
|
|
|
14644
14644
|
function hasInvalidEscape(template) {
|
|
14645
14645
|
return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
|
|
14646
14646
|
}
|
|
14647
|
-
var doubleQuoteEscapedCharsRegExp = /[
|
|
14648
|
-
var singleQuoteEscapedCharsRegExp = /[
|
|
14649
|
-
var backtickQuoteEscapedCharsRegExp = /\r\n|[
|
|
14647
|
+
var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
14648
|
+
var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
14649
|
+
var backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
14650
14650
|
var escapedCharsMap = new Map(Object.entries({
|
|
14651
14651
|
" ": "\\t",
|
|
14652
14652
|
"\v": "\\v",
|
|
@@ -14691,8 +14691,8 @@ function escapeNonAsciiString(s, quoteChar) {
|
|
|
14691
14691
|
s = escapeString(s, quoteChar);
|
|
14692
14692
|
return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s;
|
|
14693
14693
|
}
|
|
14694
|
-
var jsxDoubleQuoteEscapedCharsRegExp = /[
|
|
14695
|
-
var jsxSingleQuoteEscapedCharsRegExp = /[
|
|
14694
|
+
var jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
14695
|
+
var jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
14696
14696
|
var jsxEscapedCharsMap = new Map(Object.entries({
|
|
14697
14697
|
'"': """,
|
|
14698
14698
|
"'": "'"
|
|
@@ -15064,6 +15064,12 @@ function parameterIsThisKeyword(parameter) {
|
|
|
15064
15064
|
function isThisIdentifier(node) {
|
|
15065
15065
|
return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node);
|
|
15066
15066
|
}
|
|
15067
|
+
function isInTypeQuery(node) {
|
|
15068
|
+
return !!findAncestor(
|
|
15069
|
+
node,
|
|
15070
|
+
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
15071
|
+
);
|
|
15072
|
+
}
|
|
15067
15073
|
function isThisInTypeQuery(node) {
|
|
15068
15074
|
if (!isThisIdentifier(node)) {
|
|
15069
15075
|
return false;
|
|
@@ -16381,6 +16387,9 @@ function getAllowJSCompilerOption(compilerOptions) {
|
|
|
16381
16387
|
function getUseDefineForClassFields(compilerOptions) {
|
|
16382
16388
|
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16383
16389
|
}
|
|
16390
|
+
function getEmitStandardClassFields(compilerOptions) {
|
|
16391
|
+
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
16392
|
+
}
|
|
16384
16393
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
16385
16394
|
return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations);
|
|
16386
16395
|
}
|
|
@@ -16478,7 +16487,7 @@ function guessDirectorySymlink(a, b, cwd, getCanonicalFileName) {
|
|
|
16478
16487
|
function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
|
|
16479
16488
|
return s !== void 0 && (getCanonicalFileName(s) === "node_modules" || startsWith(s, "@"));
|
|
16480
16489
|
}
|
|
16481
|
-
var reservedCharacterPattern = /[^\w\s
|
|
16490
|
+
var reservedCharacterPattern = /[^\w\s/]/g;
|
|
16482
16491
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
16483
16492
|
var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
16484
16493
|
var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
|
|
@@ -43044,6 +43053,7 @@ function createTypeChecker(host) {
|
|
|
43044
43053
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
43045
43054
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
43046
43055
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
43056
|
+
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
43047
43057
|
var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
|
|
43048
43058
|
var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
43049
43059
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
@@ -44398,7 +44408,7 @@ function createTypeChecker(host) {
|
|
|
44398
44408
|
false
|
|
44399
44409
|
);
|
|
44400
44410
|
} else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
44401
|
-
return !(
|
|
44411
|
+
return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
44402
44412
|
}
|
|
44403
44413
|
return true;
|
|
44404
44414
|
}
|
|
@@ -44412,7 +44422,7 @@ function createTypeChecker(host) {
|
|
|
44412
44422
|
return true;
|
|
44413
44423
|
}
|
|
44414
44424
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
44415
|
-
if (
|
|
44425
|
+
if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
44416
44426
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
44417
44427
|
declaration,
|
|
44418
44428
|
usage,
|
|
@@ -44536,7 +44546,7 @@ function createTypeChecker(host) {
|
|
|
44536
44546
|
return requiresScopeChangeWorker(node.name);
|
|
44537
44547
|
case 172 /* PropertyDeclaration */:
|
|
44538
44548
|
if (hasStaticModifier(node)) {
|
|
44539
|
-
return
|
|
44549
|
+
return !emitStandardClassFields;
|
|
44540
44550
|
}
|
|
44541
44551
|
return requiresScopeChangeWorker(node.name);
|
|
44542
44552
|
default:
|
|
@@ -44807,7 +44817,7 @@ function createTypeChecker(host) {
|
|
|
44807
44817
|
}
|
|
44808
44818
|
}
|
|
44809
44819
|
function checkAndReportErrorForInvalidInitializer() {
|
|
44810
|
-
if (propertyWithInvalidInitializer && !
|
|
44820
|
+
if (propertyWithInvalidInitializer && !emitStandardClassFields) {
|
|
44811
44821
|
error(
|
|
44812
44822
|
errorLocation,
|
|
44813
44823
|
errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,
|
|
@@ -56363,6 +56373,9 @@ function createTypeChecker(host) {
|
|
|
56363
56373
|
function getEndElementCount(type, flags) {
|
|
56364
56374
|
return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1;
|
|
56365
56375
|
}
|
|
56376
|
+
function getTotalFixedElementCount(type) {
|
|
56377
|
+
return type.fixedLength + getEndElementCount(type, 3 /* Fixed */);
|
|
56378
|
+
}
|
|
56366
56379
|
function getElementTypes(type) {
|
|
56367
56380
|
const typeArguments = getTypeArguments(type);
|
|
56368
56381
|
const arity = getTypeReferenceArity(type);
|
|
@@ -57268,10 +57281,7 @@ function createTypeChecker(host) {
|
|
|
57268
57281
|
}
|
|
57269
57282
|
if (index >= 0) {
|
|
57270
57283
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
57271
|
-
return
|
|
57272
|
-
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
57273
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
57274
|
-
});
|
|
57284
|
+
return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0);
|
|
57275
57285
|
}
|
|
57276
57286
|
}
|
|
57277
57287
|
}
|
|
@@ -57556,7 +57566,7 @@ function createTypeChecker(host) {
|
|
|
57556
57566
|
}
|
|
57557
57567
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
57558
57568
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
57559
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target
|
|
57569
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) {
|
|
57560
57570
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
57561
57571
|
return objectType;
|
|
57562
57572
|
}
|
|
@@ -62567,17 +62577,7 @@ function createTypeChecker(host) {
|
|
|
62567
62577
|
return propType;
|
|
62568
62578
|
}
|
|
62569
62579
|
if (everyType(type, isTupleType)) {
|
|
62570
|
-
return
|
|
62571
|
-
const tupleType = t;
|
|
62572
|
-
const restType = getRestTypeOfTupleType(tupleType);
|
|
62573
|
-
if (!restType) {
|
|
62574
|
-
return undefinedType;
|
|
62575
|
-
}
|
|
62576
|
-
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
62577
|
-
return getUnionType([restType, undefinedType]);
|
|
62578
|
-
}
|
|
62579
|
-
return restType;
|
|
62580
|
-
});
|
|
62580
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
62581
62581
|
}
|
|
62582
62582
|
return void 0;
|
|
62583
62583
|
}
|
|
@@ -62645,6 +62645,19 @@ function createTypeChecker(host) {
|
|
|
62645
62645
|
function getRestTypeOfTupleType(type) {
|
|
62646
62646
|
return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
|
|
62647
62647
|
}
|
|
62648
|
+
function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) {
|
|
62649
|
+
return mapType(type, (t) => {
|
|
62650
|
+
const tupleType = t;
|
|
62651
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
62652
|
+
if (!restType) {
|
|
62653
|
+
return undefinedType;
|
|
62654
|
+
}
|
|
62655
|
+
if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) {
|
|
62656
|
+
return getUnionType([restType, undefinedOrMissingType2]);
|
|
62657
|
+
}
|
|
62658
|
+
return restType;
|
|
62659
|
+
});
|
|
62660
|
+
}
|
|
62648
62661
|
function getRestArrayTypeOfTupleType(type) {
|
|
62649
62662
|
const restType = getRestTypeOfTupleType(type);
|
|
62650
62663
|
return restType && createArrayType(restType);
|
|
@@ -64144,12 +64157,6 @@ function createTypeChecker(host) {
|
|
|
64144
64157
|
}
|
|
64145
64158
|
return links.resolvedSymbol;
|
|
64146
64159
|
}
|
|
64147
|
-
function isInTypeQuery(node) {
|
|
64148
|
-
return !!findAncestor(
|
|
64149
|
-
node,
|
|
64150
|
-
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
64151
|
-
);
|
|
64152
|
-
}
|
|
64153
64160
|
function isInAmbientOrTypeNode(node) {
|
|
64154
64161
|
return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
|
|
64155
64162
|
}
|
|
@@ -69372,7 +69379,7 @@ function createTypeChecker(host) {
|
|
|
69372
69379
|
}
|
|
69373
69380
|
let diagnosticMessage;
|
|
69374
69381
|
const declarationName = idText(right);
|
|
69375
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (
|
|
69382
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
69376
69383
|
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
69377
69384
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
69378
69385
|
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -75084,7 +75091,7 @@ function createTypeChecker(host) {
|
|
|
75084
75091
|
case "length":
|
|
75085
75092
|
case "caller":
|
|
75086
75093
|
case "arguments":
|
|
75087
|
-
if (
|
|
75094
|
+
if (useDefineForClassFields) {
|
|
75088
75095
|
break;
|
|
75089
75096
|
}
|
|
75090
75097
|
case "prototype":
|
|
@@ -75232,7 +75239,7 @@ function createTypeChecker(host) {
|
|
|
75232
75239
|
if (classExtendsNull) {
|
|
75233
75240
|
error(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
75234
75241
|
}
|
|
75235
|
-
const superCallShouldBeRootLevel =
|
|
75242
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
75236
75243
|
if (superCallShouldBeRootLevel) {
|
|
75237
75244
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
75238
75245
|
error(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
@@ -78511,7 +78518,7 @@ function createTypeChecker(host) {
|
|
|
78511
78518
|
node
|
|
78512
78519
|
);
|
|
78513
78520
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
78514
|
-
const willTransformInitializers = !
|
|
78521
|
+
const willTransformInitializers = !emitStandardClassFields;
|
|
78515
78522
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
78516
78523
|
for (const member of node.members) {
|
|
78517
78524
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|