@typescript-deploys/pr-build 5.2.0-pr-52095-19 → 5.2.0-pr-55214-6
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 +78 -105
- package/lib/tsserver.js +111 -122
- package/lib/tsserverlibrary.js +109 -122
- package/lib/typescript.js +104 -119
- package/lib/typingsInstaller.js +5 -5
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -751,6 +751,7 @@ __export(server_exports, {
|
|
|
751
751
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
752
752
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
753
753
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
754
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
754
755
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
755
756
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
756
757
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -1426,6 +1427,7 @@ __export(server_exports, {
|
|
|
1426
1427
|
isInString: () => isInString,
|
|
1427
1428
|
isInTemplateString: () => isInTemplateString,
|
|
1428
1429
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
1430
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
1429
1431
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
1430
1432
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
1431
1433
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -2329,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2329
2331
|
|
|
2330
2332
|
// src/compiler/corePublic.ts
|
|
2331
2333
|
var versionMajorMinor = "5.2";
|
|
2332
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2334
|
+
var version = `${versionMajorMinor}.0-insiders.20230731`;
|
|
2333
2335
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2334
2336
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2335
2337
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3498,7 +3500,7 @@ function identity(x) {
|
|
|
3498
3500
|
function toLowerCase(x) {
|
|
3499
3501
|
return x.toLowerCase();
|
|
3500
3502
|
}
|
|
3501
|
-
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_
|
|
3503
|
+
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
|
3502
3504
|
function toFileNameLowerCase(x) {
|
|
3503
3505
|
return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x;
|
|
3504
3506
|
}
|
|
@@ -4233,7 +4235,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4233
4235
|
return func.name;
|
|
4234
4236
|
} else {
|
|
4235
4237
|
const text = Function.prototype.toString.call(func);
|
|
4236
|
-
const match = /^function\s+([\w
|
|
4238
|
+
const match = /^function\s+([\w$]+)\s*\(/.exec(text);
|
|
4237
4239
|
return match ? match[1] : "";
|
|
4238
4240
|
}
|
|
4239
4241
|
}
|
|
@@ -5016,7 +5018,7 @@ ${lanes.join("\n")}
|
|
|
5016
5018
|
})(Debug || (Debug = {}));
|
|
5017
5019
|
|
|
5018
5020
|
// src/compiler/semver.ts
|
|
5019
|
-
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(
|
|
5021
|
+
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
|
5020
5022
|
var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
|
|
5021
5023
|
var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
|
5022
5024
|
var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
|
@@ -13734,7 +13736,7 @@ function getNodeFlags(node) {
|
|
|
13734
13736
|
var supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
|
|
13735
13737
|
function validateLocaleAndSetLanguage(locale, sys2, errors) {
|
|
13736
13738
|
const lowerCaseLocale = locale.toLowerCase();
|
|
13737
|
-
const matchResult = /^([a-z]+)([_
|
|
13739
|
+
const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale);
|
|
13738
13740
|
if (!matchResult) {
|
|
13739
13741
|
if (errors) {
|
|
13740
13742
|
errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
|
|
@@ -18615,9 +18617,9 @@ function escapeTemplateSubstitution(str) {
|
|
|
18615
18617
|
function hasInvalidEscape(template) {
|
|
18616
18618
|
return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
|
|
18617
18619
|
}
|
|
18618
|
-
var doubleQuoteEscapedCharsRegExp = /[
|
|
18619
|
-
var singleQuoteEscapedCharsRegExp = /[
|
|
18620
|
-
var backtickQuoteEscapedCharsRegExp = /\r\n|[
|
|
18620
|
+
var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18621
|
+
var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18622
|
+
var backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
18621
18623
|
var escapedCharsMap = new Map(Object.entries({
|
|
18622
18624
|
" ": "\\t",
|
|
18623
18625
|
"\v": "\\v",
|
|
@@ -18662,8 +18664,8 @@ function escapeNonAsciiString(s, quoteChar) {
|
|
|
18662
18664
|
s = escapeString(s, quoteChar);
|
|
18663
18665
|
return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s;
|
|
18664
18666
|
}
|
|
18665
|
-
var jsxDoubleQuoteEscapedCharsRegExp = /[
|
|
18666
|
-
var jsxSingleQuoteEscapedCharsRegExp = /[
|
|
18667
|
+
var jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18668
|
+
var jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18667
18669
|
var jsxEscapedCharsMap = new Map(Object.entries({
|
|
18668
18670
|
'"': """,
|
|
18669
18671
|
"'": "'"
|
|
@@ -19039,6 +19041,12 @@ function parameterIsThisKeyword(parameter) {
|
|
|
19039
19041
|
function isThisIdentifier(node) {
|
|
19040
19042
|
return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node);
|
|
19041
19043
|
}
|
|
19044
|
+
function isInTypeQuery(node) {
|
|
19045
|
+
return !!findAncestor(
|
|
19046
|
+
node,
|
|
19047
|
+
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
19048
|
+
);
|
|
19049
|
+
}
|
|
19042
19050
|
function isThisInTypeQuery(node) {
|
|
19043
19051
|
if (!isThisIdentifier(node)) {
|
|
19044
19052
|
return false;
|
|
@@ -20536,6 +20544,9 @@ function getAllowJSCompilerOption(compilerOptions) {
|
|
|
20536
20544
|
function getUseDefineForClassFields(compilerOptions) {
|
|
20537
20545
|
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
20538
20546
|
}
|
|
20547
|
+
function getEmitStandardClassFields(compilerOptions) {
|
|
20548
|
+
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
20549
|
+
}
|
|
20539
20550
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
20540
20551
|
return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations);
|
|
20541
20552
|
}
|
|
@@ -20640,7 +20651,7 @@ function tryRemoveDirectoryPrefix(path, dirPath, getCanonicalFileName) {
|
|
|
20640
20651
|
const withoutPrefix = tryRemovePrefix(path, dirPath, getCanonicalFileName);
|
|
20641
20652
|
return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix);
|
|
20642
20653
|
}
|
|
20643
|
-
var reservedCharacterPattern = /[^\w\s
|
|
20654
|
+
var reservedCharacterPattern = /[^\w\s/]/g;
|
|
20644
20655
|
function regExpEscape(text) {
|
|
20645
20656
|
return text.replace(reservedCharacterPattern, escapeRegExpCharacter);
|
|
20646
20657
|
}
|
|
@@ -47753,6 +47764,7 @@ function createTypeChecker(host) {
|
|
|
47753
47764
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
47754
47765
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
47755
47766
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
47767
|
+
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
47756
47768
|
var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
|
|
47757
47769
|
var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
47758
47770
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
@@ -49107,7 +49119,7 @@ function createTypeChecker(host) {
|
|
|
49107
49119
|
false
|
|
49108
49120
|
);
|
|
49109
49121
|
} else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
49110
|
-
return !(
|
|
49122
|
+
return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
49111
49123
|
}
|
|
49112
49124
|
return true;
|
|
49113
49125
|
}
|
|
@@ -49121,7 +49133,7 @@ function createTypeChecker(host) {
|
|
|
49121
49133
|
return true;
|
|
49122
49134
|
}
|
|
49123
49135
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
49124
|
-
if (
|
|
49136
|
+
if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
49125
49137
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
49126
49138
|
declaration,
|
|
49127
49139
|
usage,
|
|
@@ -49245,7 +49257,7 @@ function createTypeChecker(host) {
|
|
|
49245
49257
|
return requiresScopeChangeWorker(node.name);
|
|
49246
49258
|
case 172 /* PropertyDeclaration */:
|
|
49247
49259
|
if (hasStaticModifier(node)) {
|
|
49248
|
-
return
|
|
49260
|
+
return !emitStandardClassFields;
|
|
49249
49261
|
}
|
|
49250
49262
|
return requiresScopeChangeWorker(node.name);
|
|
49251
49263
|
default:
|
|
@@ -49516,7 +49528,7 @@ function createTypeChecker(host) {
|
|
|
49516
49528
|
}
|
|
49517
49529
|
}
|
|
49518
49530
|
function checkAndReportErrorForInvalidInitializer() {
|
|
49519
|
-
if (propertyWithInvalidInitializer && !
|
|
49531
|
+
if (propertyWithInvalidInitializer && !emitStandardClassFields) {
|
|
49520
49532
|
error2(
|
|
49521
49533
|
errorLocation,
|
|
49522
49534
|
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,
|
|
@@ -58309,7 +58321,7 @@ function createTypeChecker(host) {
|
|
|
58309
58321
|
if (baseConstructorIndexInfo) {
|
|
58310
58322
|
indexInfos = append(indexInfos, baseConstructorIndexInfo);
|
|
58311
58323
|
}
|
|
58312
|
-
if (symbol.flags &
|
|
58324
|
+
if (symbol.flags & 256 /* RegularEnum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ || some(type.properties, (prop) => !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */)))) {
|
|
58313
58325
|
indexInfos = append(indexInfos, enumNumberIndexInfo);
|
|
58314
58326
|
}
|
|
58315
58327
|
}
|
|
@@ -59724,7 +59736,7 @@ function createTypeChecker(host) {
|
|
|
59724
59736
|
return getReturnTypeOfTypeTag(declaration);
|
|
59725
59737
|
}
|
|
59726
59738
|
function isResolvingReturnTypeOfSignature(signature) {
|
|
59727
|
-
return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
59739
|
+
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
59728
59740
|
}
|
|
59729
59741
|
function getRestTypeOfSignature(signature) {
|
|
59730
59742
|
return tryGetRestTypeOfSignature(signature) || anyType;
|
|
@@ -61072,6 +61084,9 @@ function createTypeChecker(host) {
|
|
|
61072
61084
|
function getEndElementCount(type, flags) {
|
|
61073
61085
|
return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1;
|
|
61074
61086
|
}
|
|
61087
|
+
function getTotalFixedElementCount(type) {
|
|
61088
|
+
return type.fixedLength + getEndElementCount(type, 3 /* Fixed */);
|
|
61089
|
+
}
|
|
61075
61090
|
function getElementTypes(type) {
|
|
61076
61091
|
const typeArguments = getTypeArguments(type);
|
|
61077
61092
|
const arity = getTypeReferenceArity(type);
|
|
@@ -61977,10 +61992,7 @@ function createTypeChecker(host) {
|
|
|
61977
61992
|
}
|
|
61978
61993
|
if (index >= 0) {
|
|
61979
61994
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
61980
|
-
return
|
|
61981
|
-
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
61982
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
61983
|
-
});
|
|
61995
|
+
return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0);
|
|
61984
61996
|
}
|
|
61985
61997
|
}
|
|
61986
61998
|
}
|
|
@@ -62265,7 +62277,7 @@ function createTypeChecker(host) {
|
|
|
62265
62277
|
}
|
|
62266
62278
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
62267
62279
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
62268
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target
|
|
62280
|
+
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))) {
|
|
62269
62281
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
62270
62282
|
return objectType;
|
|
62271
62283
|
}
|
|
@@ -67276,17 +67288,7 @@ function createTypeChecker(host) {
|
|
|
67276
67288
|
return propType;
|
|
67277
67289
|
}
|
|
67278
67290
|
if (everyType(type, isTupleType)) {
|
|
67279
|
-
return
|
|
67280
|
-
const tupleType = t;
|
|
67281
|
-
const restType = getRestTypeOfTupleType(tupleType);
|
|
67282
|
-
if (!restType) {
|
|
67283
|
-
return undefinedType;
|
|
67284
|
-
}
|
|
67285
|
-
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
67286
|
-
return getUnionType([restType, undefinedType]);
|
|
67287
|
-
}
|
|
67288
|
-
return restType;
|
|
67289
|
-
});
|
|
67291
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
67290
67292
|
}
|
|
67291
67293
|
return void 0;
|
|
67292
67294
|
}
|
|
@@ -67354,6 +67356,19 @@ function createTypeChecker(host) {
|
|
|
67354
67356
|
function getRestTypeOfTupleType(type) {
|
|
67355
67357
|
return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
|
|
67356
67358
|
}
|
|
67359
|
+
function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) {
|
|
67360
|
+
return mapType(type, (t) => {
|
|
67361
|
+
const tupleType = t;
|
|
67362
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
67363
|
+
if (!restType) {
|
|
67364
|
+
return undefinedType;
|
|
67365
|
+
}
|
|
67366
|
+
if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) {
|
|
67367
|
+
return getUnionType([restType, undefinedOrMissingType2]);
|
|
67368
|
+
}
|
|
67369
|
+
return restType;
|
|
67370
|
+
});
|
|
67371
|
+
}
|
|
67357
67372
|
function getRestArrayTypeOfTupleType(type) {
|
|
67358
67373
|
const restType = getRestTypeOfTupleType(type);
|
|
67359
67374
|
return restType && createArrayType(restType);
|
|
@@ -68853,12 +68868,6 @@ function createTypeChecker(host) {
|
|
|
68853
68868
|
}
|
|
68854
68869
|
return links.resolvedSymbol;
|
|
68855
68870
|
}
|
|
68856
|
-
function isInTypeQuery(node) {
|
|
68857
|
-
return !!findAncestor(
|
|
68858
|
-
node,
|
|
68859
|
-
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
68860
|
-
);
|
|
68861
|
-
}
|
|
68862
68871
|
function isInAmbientOrTypeNode(node) {
|
|
68863
68872
|
return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
|
|
68864
68873
|
}
|
|
@@ -71962,75 +71971,41 @@ function createTypeChecker(host) {
|
|
|
71962
71971
|
return mapType(
|
|
71963
71972
|
type,
|
|
71964
71973
|
(t) => {
|
|
71965
|
-
|
|
71966
|
-
|
|
71967
|
-
|
|
71968
|
-
|
|
71969
|
-
const
|
|
71970
|
-
|
|
71971
|
-
|
|
71972
|
-
|
|
71973
|
-
|
|
71974
|
-
|
|
71975
|
-
|
|
71976
|
-
|
|
71977
|
-
}
|
|
71978
|
-
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
71979
|
-
if (typeOfConcreteProperty) {
|
|
71980
|
-
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
71981
|
-
continue;
|
|
71982
|
-
}
|
|
71983
|
-
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
71984
|
-
}
|
|
71985
|
-
if (concretePropertyTypes) {
|
|
71986
|
-
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
71974
|
+
var _a;
|
|
71975
|
+
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
71976
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
71977
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
71978
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
71979
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
71980
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
71981
|
+
}
|
|
71982
|
+
} else if (t.flags & 3670016 /* StructuredType */) {
|
|
71983
|
+
const prop = getPropertyOfType(t, name);
|
|
71984
|
+
if (prop) {
|
|
71985
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
71987
71986
|
}
|
|
71988
|
-
|
|
71989
|
-
|
|
71990
|
-
|
|
71987
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
71988
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
71989
|
+
t,
|
|
71990
|
+
t.target.fixedLength,
|
|
71991
|
+
/*endSkipCount*/
|
|
71992
|
+
0,
|
|
71993
|
+
/*writing*/
|
|
71994
|
+
false,
|
|
71995
|
+
/*noReductions*/
|
|
71996
|
+
true
|
|
71997
|
+
);
|
|
71998
|
+
if (restType) {
|
|
71999
|
+
return restType;
|
|
72000
|
+
}
|
|
71991
72001
|
}
|
|
71992
|
-
return void 0;
|
|
72002
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
71993
72003
|
}
|
|
71994
|
-
return
|
|
72004
|
+
return void 0;
|
|
71995
72005
|
},
|
|
71996
72006
|
/*noReductions*/
|
|
71997
72007
|
true
|
|
71998
72008
|
);
|
|
71999
|
-
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
72000
|
-
const constraint = getConstraintTypeFromMappedType(t);
|
|
72001
|
-
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
72002
|
-
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
72003
|
-
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
72004
|
-
return substituteIndexedMappedType(t, propertyNameType);
|
|
72005
|
-
}
|
|
72006
|
-
return void 0;
|
|
72007
|
-
}
|
|
72008
|
-
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
72009
|
-
const prop = getPropertyOfType(t, name);
|
|
72010
|
-
if (prop) {
|
|
72011
|
-
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
72012
|
-
}
|
|
72013
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
72014
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
72015
|
-
t,
|
|
72016
|
-
t.target.fixedLength,
|
|
72017
|
-
/*endSkipCount*/
|
|
72018
|
-
0,
|
|
72019
|
-
/*writing*/
|
|
72020
|
-
false,
|
|
72021
|
-
/*noReductions*/
|
|
72022
|
-
true
|
|
72023
|
-
);
|
|
72024
|
-
if (restType) {
|
|
72025
|
-
return restType;
|
|
72026
|
-
}
|
|
72027
|
-
}
|
|
72028
|
-
return void 0;
|
|
72029
|
-
}
|
|
72030
|
-
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
72031
|
-
var _a;
|
|
72032
|
-
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
72033
|
-
}
|
|
72034
72009
|
}
|
|
72035
72010
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
72036
72011
|
Debug.assert(isObjectLiteralMethod(node));
|
|
@@ -74115,7 +74090,7 @@ function createTypeChecker(host) {
|
|
|
74115
74090
|
}
|
|
74116
74091
|
let diagnosticMessage;
|
|
74117
74092
|
const declarationName = idText(right);
|
|
74118
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (
|
|
74093
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
74119
74094
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
74120
74095
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
74121
74096
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -79827,7 +79802,7 @@ function createTypeChecker(host) {
|
|
|
79827
79802
|
case "length":
|
|
79828
79803
|
case "caller":
|
|
79829
79804
|
case "arguments":
|
|
79830
|
-
if (
|
|
79805
|
+
if (useDefineForClassFields) {
|
|
79831
79806
|
break;
|
|
79832
79807
|
}
|
|
79833
79808
|
case "prototype":
|
|
@@ -79975,7 +79950,7 @@ function createTypeChecker(host) {
|
|
|
79975
79950
|
if (classExtendsNull) {
|
|
79976
79951
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
79977
79952
|
}
|
|
79978
|
-
const superCallShouldBeRootLevel =
|
|
79953
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
79979
79954
|
if (superCallShouldBeRootLevel) {
|
|
79980
79955
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
79981
79956
|
error2(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);
|
|
@@ -83254,7 +83229,7 @@ function createTypeChecker(host) {
|
|
|
83254
83229
|
node
|
|
83255
83230
|
);
|
|
83256
83231
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
83257
|
-
const willTransformInitializers = !
|
|
83232
|
+
const willTransformInitializers = !emitStandardClassFields;
|
|
83258
83233
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
83259
83234
|
for (const member of node.members) {
|
|
83260
83235
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
@@ -135921,7 +135896,7 @@ function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImpo
|
|
|
135921
135896
|
}
|
|
135922
135897
|
|
|
135923
135898
|
// src/services/sourcemaps.ts
|
|
135924
|
-
var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9
|
|
135899
|
+
var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/;
|
|
135925
135900
|
function getSourceMapper(host) {
|
|
135926
135901
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
135927
135902
|
const currentDirectory = host.getCurrentDirectory();
|
|
@@ -144703,7 +144678,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144703
144678
|
}
|
|
144704
144679
|
return result;
|
|
144705
144680
|
function escapeRegExp(str) {
|
|
144706
|
-
return str.replace(/[
|
|
144681
|
+
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
144707
144682
|
}
|
|
144708
144683
|
function getTodoCommentsRegExp() {
|
|
144709
144684
|
const singleLineCommentStart = /(?:\/\/+\s*)/.source;
|
|
@@ -149729,7 +149704,7 @@ function getLeftAndRightSiblings(typedefNode) {
|
|
|
149729
149704
|
function findEndOfTextBetween(jsDocComment, from, to) {
|
|
149730
149705
|
const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart());
|
|
149731
149706
|
for (let i = comment.length; i > 0; i--) {
|
|
149732
|
-
if (!/[
|
|
149707
|
+
if (!/[*/\s]/g.test(comment.substring(i - 1, i))) {
|
|
149733
149708
|
return from + i;
|
|
149734
149709
|
}
|
|
149735
149710
|
}
|
|
@@ -153077,7 +153052,7 @@ function doChange22(changes, sourceFile, arg, expression) {
|
|
|
153077
153052
|
);
|
|
153078
153053
|
}
|
|
153079
153054
|
function getSuggestion(messageText) {
|
|
153080
|
-
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(
|
|
153055
|
+
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
|
|
153081
153056
|
return suggestion;
|
|
153082
153057
|
}
|
|
153083
153058
|
|
|
@@ -158909,7 +158884,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
158909
158884
|
return { kind: 1 /* JsDocTagName */ };
|
|
158910
158885
|
} else {
|
|
158911
158886
|
const lineStart = getLineStartPositionForPosition(position, sourceFile);
|
|
158912
|
-
if (!/[
|
|
158887
|
+
if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
|
|
158913
158888
|
return { kind: 2 /* JsDocTag */ };
|
|
158914
158889
|
}
|
|
158915
158890
|
}
|
|
@@ -159208,24 +159183,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159208
159183
|
}
|
|
159209
159184
|
}
|
|
159210
159185
|
}
|
|
159211
|
-
if (!isTypeLocation) {
|
|
159186
|
+
if (!isTypeLocation || isInTypeQuery(node)) {
|
|
159212
159187
|
typeChecker.tryGetThisTypeAt(
|
|
159213
159188
|
node,
|
|
159214
159189
|
/*includeGlobalThis*/
|
|
159215
159190
|
false
|
|
159216
159191
|
);
|
|
159217
159192
|
let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
|
|
159218
|
-
|
|
159219
|
-
|
|
159220
|
-
|
|
159221
|
-
|
|
159222
|
-
|
|
159223
|
-
|
|
159224
|
-
|
|
159193
|
+
if (!isTypeLocation) {
|
|
159194
|
+
let insertQuestionDot = false;
|
|
159195
|
+
if (type.isNullableType()) {
|
|
159196
|
+
const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false;
|
|
159197
|
+
if (canCorrectToQuestionDot || isRightOfQuestionDot) {
|
|
159198
|
+
type = type.getNonNullableType();
|
|
159199
|
+
if (canCorrectToQuestionDot) {
|
|
159200
|
+
insertQuestionDot = true;
|
|
159201
|
+
}
|
|
159225
159202
|
}
|
|
159226
159203
|
}
|
|
159204
|
+
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
159205
|
+
} else {
|
|
159206
|
+
addTypeProperties(
|
|
159207
|
+
type.getNonNullableType(),
|
|
159208
|
+
/*insertAwait*/
|
|
159209
|
+
false,
|
|
159210
|
+
/*insertQuestionDot*/
|
|
159211
|
+
false
|
|
159212
|
+
);
|
|
159227
159213
|
}
|
|
159228
|
-
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
159229
159214
|
}
|
|
159230
159215
|
}
|
|
159231
159216
|
function addTypeProperties(type, insertAwait, insertQuestionDot) {
|
|
@@ -172677,6 +172662,7 @@ __export(ts_exports2, {
|
|
|
172677
172662
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
172678
172663
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
172679
172664
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
172665
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
172680
172666
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
172681
172667
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
172682
172668
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -173352,6 +173338,7 @@ __export(ts_exports2, {
|
|
|
173352
173338
|
isInString: () => isInString,
|
|
173353
173339
|
isInTemplateString: () => isInTemplateString,
|
|
173354
173340
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
173341
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
173355
173342
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
173356
173343
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
173357
173344
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -178221,7 +178208,7 @@ var indentStyle = new Map(Object.entries({
|
|
|
178221
178208
|
var defaultTypeSafeList = {
|
|
178222
178209
|
"jquery": {
|
|
178223
178210
|
// jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
|
|
178224
|
-
match: /jquery(-[\d
|
|
178211
|
+
match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,
|
|
178225
178212
|
types: ["jquery"]
|
|
178226
178213
|
},
|
|
178227
178214
|
"WinJS": {
|
|
@@ -181123,7 +181110,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181123
181110
|
}
|
|
181124
181111
|
}
|
|
181125
181112
|
if (!exclude) {
|
|
181126
|
-
if (/^.+[
|
|
181113
|
+
if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
|
|
181127
181114
|
excludedFiles.push(normalizedNames[i]);
|
|
181128
181115
|
} else {
|
|
181129
181116
|
filesToKeep.push(proj.rootFiles[i]);
|
|
@@ -181444,7 +181431,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181444
181431
|
}
|
|
181445
181432
|
};
|
|
181446
181433
|
/** Makes a filename safe to insert in a RegExp */
|
|
181447
|
-
_ProjectService.filenameEscapeRegexp = /[
|
|
181434
|
+
_ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g;
|
|
181448
181435
|
var ProjectService3 = _ProjectService;
|
|
181449
181436
|
function createIncompleteCompletionsCache() {
|
|
181450
181437
|
let info;
|
|
@@ -187205,6 +187192,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187205
187192
|
getEmitModuleKind,
|
|
187206
187193
|
getEmitModuleResolutionKind,
|
|
187207
187194
|
getEmitScriptTarget,
|
|
187195
|
+
getEmitStandardClassFields,
|
|
187208
187196
|
getEnclosingBlockScopeContainer,
|
|
187209
187197
|
getEnclosingContainer,
|
|
187210
187198
|
getEncodedSemanticClassifications,
|
|
@@ -187880,6 +187868,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187880
187868
|
isInString,
|
|
187881
187869
|
isInTemplateString,
|
|
187882
187870
|
isInTopLevelContext,
|
|
187871
|
+
isInTypeQuery,
|
|
187883
187872
|
isIncrementalCompilation,
|
|
187884
187873
|
isIndexSignatureDeclaration,
|
|
187885
187874
|
isIndexedAccessTypeNode,
|