@typescript-deploys/pr-build 5.2.0-pr-55152-6 → 5.2.0-pr-55222-9
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 +55 -57
- package/lib/tsserver.js +88 -74
- package/lib/tsserverlibrary.js +86 -74
- package/lib/typescript.js +81 -71
- 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-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230731`;
|
|
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,
|
|
@@ -55015,7 +55025,7 @@ function createTypeChecker(host) {
|
|
|
55015
55025
|
return getReturnTypeOfTypeTag(declaration);
|
|
55016
55026
|
}
|
|
55017
55027
|
function isResolvingReturnTypeOfSignature(signature) {
|
|
55018
|
-
return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
55028
|
+
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
55019
55029
|
}
|
|
55020
55030
|
function getRestTypeOfSignature(signature) {
|
|
55021
55031
|
return tryGetRestTypeOfSignature(signature) || anyType;
|
|
@@ -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
|
}
|
|
@@ -59803,7 +59813,6 @@ function createTypeChecker(host) {
|
|
|
59803
59813
|
let overrideNextErrorInfo = 0;
|
|
59804
59814
|
let lastSkippedInfo;
|
|
59805
59815
|
let incompatibleStack;
|
|
59806
|
-
let skipParentCounter = 0;
|
|
59807
59816
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
59808
59817
|
const result = isRelatedTo(
|
|
59809
59818
|
source,
|
|
@@ -59979,15 +59988,7 @@ function createTypeChecker(host) {
|
|
|
59979
59988
|
reportIncompatibleStack();
|
|
59980
59989
|
if (message.elidedInCompatabilityPyramid)
|
|
59981
59990
|
return;
|
|
59982
|
-
|
|
59983
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
59984
|
-
} else {
|
|
59985
|
-
skipParentCounter--;
|
|
59986
|
-
}
|
|
59987
|
-
}
|
|
59988
|
-
function reportParentSkippedError(message, ...args) {
|
|
59989
|
-
reportError(message, ...args);
|
|
59990
|
-
skipParentCounter++;
|
|
59991
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
59991
59992
|
}
|
|
59992
59993
|
function associateRelatedInfo(info) {
|
|
59993
59994
|
Debug.assert(!!errorInfo);
|
|
@@ -60324,14 +60325,14 @@ function createTypeChecker(host) {
|
|
|
60324
60325
|
}
|
|
60325
60326
|
}
|
|
60326
60327
|
if (suggestion !== void 0) {
|
|
60327
|
-
|
|
60328
|
+
reportError(
|
|
60328
60329
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
60329
60330
|
symbolToString(prop),
|
|
60330
60331
|
typeToString(errorTarget),
|
|
60331
60332
|
suggestion
|
|
60332
60333
|
);
|
|
60333
60334
|
} else {
|
|
60334
|
-
|
|
60335
|
+
reportError(
|
|
60335
60336
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
60336
60337
|
symbolToString(prop),
|
|
60337
60338
|
typeToString(errorTarget)
|
|
@@ -61344,7 +61345,7 @@ function createTypeChecker(host) {
|
|
|
61344
61345
|
const allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances);
|
|
61345
61346
|
varianceCheckFailed = !allowStructuralFallback;
|
|
61346
61347
|
if (variances !== emptyArray && !allowStructuralFallback) {
|
|
61347
|
-
if (varianceCheckFailed && !
|
|
61348
|
+
if (varianceCheckFailed && !some(variances, (v) => (v & 7 /* VarianceMask */) === 0 /* Invariant */)) {
|
|
61348
61349
|
return 0 /* False */;
|
|
61349
61350
|
}
|
|
61350
61351
|
originalErrorInfo = errorInfo;
|
|
@@ -62576,17 +62577,7 @@ function createTypeChecker(host) {
|
|
|
62576
62577
|
return propType;
|
|
62577
62578
|
}
|
|
62578
62579
|
if (everyType(type, isTupleType)) {
|
|
62579
|
-
return
|
|
62580
|
-
const tupleType = t;
|
|
62581
|
-
const restType = getRestTypeOfTupleType(tupleType);
|
|
62582
|
-
if (!restType) {
|
|
62583
|
-
return undefinedType;
|
|
62584
|
-
}
|
|
62585
|
-
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
62586
|
-
return getUnionType([restType, undefinedType]);
|
|
62587
|
-
}
|
|
62588
|
-
return restType;
|
|
62589
|
-
});
|
|
62580
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
62590
62581
|
}
|
|
62591
62582
|
return void 0;
|
|
62592
62583
|
}
|
|
@@ -62654,6 +62645,19 @@ function createTypeChecker(host) {
|
|
|
62654
62645
|
function getRestTypeOfTupleType(type) {
|
|
62655
62646
|
return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
|
|
62656
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
|
+
}
|
|
62657
62661
|
function getRestArrayTypeOfTupleType(type) {
|
|
62658
62662
|
const restType = getRestTypeOfTupleType(type);
|
|
62659
62663
|
return restType && createArrayType(restType);
|
|
@@ -64153,12 +64157,6 @@ function createTypeChecker(host) {
|
|
|
64153
64157
|
}
|
|
64154
64158
|
return links.resolvedSymbol;
|
|
64155
64159
|
}
|
|
64156
|
-
function isInTypeQuery(node) {
|
|
64157
|
-
return !!findAncestor(
|
|
64158
|
-
node,
|
|
64159
|
-
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
64160
|
-
);
|
|
64161
|
-
}
|
|
64162
64160
|
function isInAmbientOrTypeNode(node) {
|
|
64163
64161
|
return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
|
|
64164
64162
|
}
|
|
@@ -69381,7 +69379,7 @@ function createTypeChecker(host) {
|
|
|
69381
69379
|
}
|
|
69382
69380
|
let diagnosticMessage;
|
|
69383
69381
|
const declarationName = idText(right);
|
|
69384
|
-
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))) {
|
|
69385
69383
|
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
69386
69384
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
69387
69385
|
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -75093,7 +75091,7 @@ function createTypeChecker(host) {
|
|
|
75093
75091
|
case "length":
|
|
75094
75092
|
case "caller":
|
|
75095
75093
|
case "arguments":
|
|
75096
|
-
if (
|
|
75094
|
+
if (useDefineForClassFields) {
|
|
75097
75095
|
break;
|
|
75098
75096
|
}
|
|
75099
75097
|
case "prototype":
|
|
@@ -75241,7 +75239,7 @@ function createTypeChecker(host) {
|
|
|
75241
75239
|
if (classExtendsNull) {
|
|
75242
75240
|
error(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
75243
75241
|
}
|
|
75244
|
-
const superCallShouldBeRootLevel =
|
|
75242
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
75245
75243
|
if (superCallShouldBeRootLevel) {
|
|
75246
75244
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
75247
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);
|
|
@@ -78520,7 +78518,7 @@ function createTypeChecker(host) {
|
|
|
78520
78518
|
node
|
|
78521
78519
|
);
|
|
78522
78520
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
78523
|
-
const willTransformInitializers = !
|
|
78521
|
+
const willTransformInitializers = !emitStandardClassFields;
|
|
78524
78522
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
78525
78523
|
for (const member of node.members) {
|
|
78526
78524
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
@@ -88649,7 +88647,7 @@ function transformTypeScript(context) {
|
|
|
88649
88647
|
const constantValue = tryGetConstEnumValue(node);
|
|
88650
88648
|
if (constantValue !== void 0) {
|
|
88651
88649
|
setConstantValue(node, constantValue);
|
|
88652
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : factory2.createNumericLiteral(constantValue);
|
|
88650
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
|
|
88653
88651
|
if (!compilerOptions.removeComments) {
|
|
88654
88652
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
88655
88653
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -110924,7 +110922,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110924
110922
|
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
|
|
110925
110923
|
} else if (isAccessExpression(expression)) {
|
|
110926
110924
|
const constantValue = getConstantValue(expression);
|
|
110927
|
-
return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue;
|
|
110925
|
+
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
110928
110926
|
}
|
|
110929
110927
|
}
|
|
110930
110928
|
function emitElementAccessExpression(node) {
|