@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/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230731`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1646,7 +1646,7 @@ var ts = (() => {
|
|
|
1646
1646
|
return void 0;
|
|
1647
1647
|
};
|
|
1648
1648
|
hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1649
|
-
fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_
|
|
1649
|
+
fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
|
1650
1650
|
AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => {
|
|
1651
1651
|
AssertionLevel2[AssertionLevel2["None"] = 0] = "None";
|
|
1652
1652
|
AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal";
|
|
@@ -1951,7 +1951,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1951
1951
|
return func.name;
|
|
1952
1952
|
} else {
|
|
1953
1953
|
const text = Function.prototype.toString.call(func);
|
|
1954
|
-
const match = /^function\s+([\w
|
|
1954
|
+
const match = /^function\s+([\w$]+)\s*\(/.exec(text);
|
|
1955
1955
|
return match ? match[1] : "";
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
@@ -2936,7 +2936,7 @@ ${lanes.join("\n")}
|
|
|
2936
2936
|
"src/compiler/semver.ts"() {
|
|
2937
2937
|
"use strict";
|
|
2938
2938
|
init_ts2();
|
|
2939
|
-
versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(
|
|
2939
|
+
versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
|
2940
2940
|
prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
|
|
2941
2941
|
prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
|
2942
2942
|
buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
|
@@ -11522,7 +11522,7 @@ ${lanes.join("\n")}
|
|
|
11522
11522
|
}
|
|
11523
11523
|
function validateLocaleAndSetLanguage(locale, sys2, errors) {
|
|
11524
11524
|
const lowerCaseLocale = locale.toLowerCase();
|
|
11525
|
-
const matchResult = /^([a-z]+)([_
|
|
11525
|
+
const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale);
|
|
11526
11526
|
if (!matchResult) {
|
|
11527
11527
|
if (errors) {
|
|
11528
11528
|
errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
|
|
@@ -16738,6 +16738,12 @@ ${lanes.join("\n")}
|
|
|
16738
16738
|
function isThisIdentifier(node) {
|
|
16739
16739
|
return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node);
|
|
16740
16740
|
}
|
|
16741
|
+
function isInTypeQuery(node) {
|
|
16742
|
+
return !!findAncestor(
|
|
16743
|
+
node,
|
|
16744
|
+
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
16745
|
+
);
|
|
16746
|
+
}
|
|
16741
16747
|
function isThisInTypeQuery(node) {
|
|
16742
16748
|
if (!isThisIdentifier(node)) {
|
|
16743
16749
|
return false;
|
|
@@ -18219,6 +18225,9 @@ ${lanes.join("\n")}
|
|
|
18219
18225
|
function getUseDefineForClassFields(compilerOptions) {
|
|
18220
18226
|
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
18221
18227
|
}
|
|
18228
|
+
function getEmitStandardClassFields(compilerOptions) {
|
|
18229
|
+
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
18230
|
+
}
|
|
18222
18231
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
18223
18232
|
return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations);
|
|
18224
18233
|
}
|
|
@@ -19310,9 +19319,9 @@ ${lanes.join("\n")}
|
|
|
19310
19319
|
return OperatorPrecedence2;
|
|
19311
19320
|
})(OperatorPrecedence || {});
|
|
19312
19321
|
templateSubstitutionRegExp = /\$\{/g;
|
|
19313
|
-
doubleQuoteEscapedCharsRegExp = /[
|
|
19314
|
-
singleQuoteEscapedCharsRegExp = /[
|
|
19315
|
-
backtickQuoteEscapedCharsRegExp = /\r\n|[
|
|
19322
|
+
doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
19323
|
+
singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
19324
|
+
backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
19316
19325
|
escapedCharsMap = new Map(Object.entries({
|
|
19317
19326
|
" ": "\\t",
|
|
19318
19327
|
"\v": "\\v",
|
|
@@ -19334,8 +19343,8 @@ ${lanes.join("\n")}
|
|
|
19334
19343
|
// special case for CRLFs in backticks
|
|
19335
19344
|
}));
|
|
19336
19345
|
nonAsciiCharacters = /[^\u0000-\u007F]/g;
|
|
19337
|
-
jsxDoubleQuoteEscapedCharsRegExp = /[
|
|
19338
|
-
jsxSingleQuoteEscapedCharsRegExp = /[
|
|
19346
|
+
jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
19347
|
+
jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
19339
19348
|
jsxEscapedCharsMap = new Map(Object.entries({
|
|
19340
19349
|
'"': """,
|
|
19341
19350
|
"'": "'"
|
|
@@ -19356,7 +19365,7 @@ ${lanes.join("\n")}
|
|
|
19356
19365
|
getSourceMapSourceConstructor: () => SourceMapSource
|
|
19357
19366
|
};
|
|
19358
19367
|
objectAllocatorPatchers = [];
|
|
19359
|
-
reservedCharacterPattern = /[^\w\s
|
|
19368
|
+
reservedCharacterPattern = /[^\w\s/]/g;
|
|
19360
19369
|
wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
19361
19370
|
commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
19362
19371
|
implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
|
|
@@ -45518,6 +45527,7 @@ ${lanes.join("\n")}
|
|
|
45518
45527
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
45519
45528
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
45520
45529
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
45530
|
+
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
45521
45531
|
var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
|
|
45522
45532
|
var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
45523
45533
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
@@ -46872,7 +46882,7 @@ ${lanes.join("\n")}
|
|
|
46872
46882
|
false
|
|
46873
46883
|
);
|
|
46874
46884
|
} else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
46875
|
-
return !(
|
|
46885
|
+
return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
46876
46886
|
}
|
|
46877
46887
|
return true;
|
|
46878
46888
|
}
|
|
@@ -46886,7 +46896,7 @@ ${lanes.join("\n")}
|
|
|
46886
46896
|
return true;
|
|
46887
46897
|
}
|
|
46888
46898
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
46889
|
-
if (
|
|
46899
|
+
if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
46890
46900
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
46891
46901
|
declaration,
|
|
46892
46902
|
usage,
|
|
@@ -47010,7 +47020,7 @@ ${lanes.join("\n")}
|
|
|
47010
47020
|
return requiresScopeChangeWorker(node.name);
|
|
47011
47021
|
case 172 /* PropertyDeclaration */:
|
|
47012
47022
|
if (hasStaticModifier(node)) {
|
|
47013
|
-
return
|
|
47023
|
+
return !emitStandardClassFields;
|
|
47014
47024
|
}
|
|
47015
47025
|
return requiresScopeChangeWorker(node.name);
|
|
47016
47026
|
default:
|
|
@@ -47281,7 +47291,7 @@ ${lanes.join("\n")}
|
|
|
47281
47291
|
}
|
|
47282
47292
|
}
|
|
47283
47293
|
function checkAndReportErrorForInvalidInitializer() {
|
|
47284
|
-
if (propertyWithInvalidInitializer && !
|
|
47294
|
+
if (propertyWithInvalidInitializer && !emitStandardClassFields) {
|
|
47285
47295
|
error2(
|
|
47286
47296
|
errorLocation,
|
|
47287
47297
|
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,
|
|
@@ -57489,7 +57499,7 @@ ${lanes.join("\n")}
|
|
|
57489
57499
|
return getReturnTypeOfTypeTag(declaration);
|
|
57490
57500
|
}
|
|
57491
57501
|
function isResolvingReturnTypeOfSignature(signature) {
|
|
57492
|
-
return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
57502
|
+
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
57493
57503
|
}
|
|
57494
57504
|
function getRestTypeOfSignature(signature) {
|
|
57495
57505
|
return tryGetRestTypeOfSignature(signature) || anyType;
|
|
@@ -58837,6 +58847,9 @@ ${lanes.join("\n")}
|
|
|
58837
58847
|
function getEndElementCount(type, flags) {
|
|
58838
58848
|
return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1;
|
|
58839
58849
|
}
|
|
58850
|
+
function getTotalFixedElementCount(type) {
|
|
58851
|
+
return type.fixedLength + getEndElementCount(type, 3 /* Fixed */);
|
|
58852
|
+
}
|
|
58840
58853
|
function getElementTypes(type) {
|
|
58841
58854
|
const typeArguments = getTypeArguments(type);
|
|
58842
58855
|
const arity = getTypeReferenceArity(type);
|
|
@@ -59742,10 +59755,7 @@ ${lanes.join("\n")}
|
|
|
59742
59755
|
}
|
|
59743
59756
|
if (index >= 0) {
|
|
59744
59757
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
59745
|
-
return
|
|
59746
|
-
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
59747
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
59748
|
-
});
|
|
59758
|
+
return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0);
|
|
59749
59759
|
}
|
|
59750
59760
|
}
|
|
59751
59761
|
}
|
|
@@ -60030,7 +60040,7 @@ ${lanes.join("\n")}
|
|
|
60030
60040
|
}
|
|
60031
60041
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
60032
60042
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
60033
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target
|
|
60043
|
+
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))) {
|
|
60034
60044
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
60035
60045
|
return objectType;
|
|
60036
60046
|
}
|
|
@@ -62277,7 +62287,6 @@ ${lanes.join("\n")}
|
|
|
62277
62287
|
let overrideNextErrorInfo = 0;
|
|
62278
62288
|
let lastSkippedInfo;
|
|
62279
62289
|
let incompatibleStack;
|
|
62280
|
-
let skipParentCounter = 0;
|
|
62281
62290
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
62282
62291
|
const result = isRelatedTo(
|
|
62283
62292
|
source,
|
|
@@ -62453,15 +62462,7 @@ ${lanes.join("\n")}
|
|
|
62453
62462
|
reportIncompatibleStack();
|
|
62454
62463
|
if (message.elidedInCompatabilityPyramid)
|
|
62455
62464
|
return;
|
|
62456
|
-
|
|
62457
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62458
|
-
} else {
|
|
62459
|
-
skipParentCounter--;
|
|
62460
|
-
}
|
|
62461
|
-
}
|
|
62462
|
-
function reportParentSkippedError(message, ...args) {
|
|
62463
|
-
reportError(message, ...args);
|
|
62464
|
-
skipParentCounter++;
|
|
62465
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62465
62466
|
}
|
|
62466
62467
|
function associateRelatedInfo(info) {
|
|
62467
62468
|
Debug.assert(!!errorInfo);
|
|
@@ -62798,14 +62799,14 @@ ${lanes.join("\n")}
|
|
|
62798
62799
|
}
|
|
62799
62800
|
}
|
|
62800
62801
|
if (suggestion !== void 0) {
|
|
62801
|
-
|
|
62802
|
+
reportError(
|
|
62802
62803
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
62803
62804
|
symbolToString(prop),
|
|
62804
62805
|
typeToString(errorTarget),
|
|
62805
62806
|
suggestion
|
|
62806
62807
|
);
|
|
62807
62808
|
} else {
|
|
62808
|
-
|
|
62809
|
+
reportError(
|
|
62809
62810
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
62810
62811
|
symbolToString(prop),
|
|
62811
62812
|
typeToString(errorTarget)
|
|
@@ -63818,7 +63819,7 @@ ${lanes.join("\n")}
|
|
|
63818
63819
|
const allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances);
|
|
63819
63820
|
varianceCheckFailed = !allowStructuralFallback;
|
|
63820
63821
|
if (variances !== emptyArray && !allowStructuralFallback) {
|
|
63821
|
-
if (varianceCheckFailed && !
|
|
63822
|
+
if (varianceCheckFailed && !some(variances, (v) => (v & 7 /* VarianceMask */) === 0 /* Invariant */)) {
|
|
63822
63823
|
return 0 /* False */;
|
|
63823
63824
|
}
|
|
63824
63825
|
originalErrorInfo = errorInfo;
|
|
@@ -65050,17 +65051,7 @@ ${lanes.join("\n")}
|
|
|
65050
65051
|
return propType;
|
|
65051
65052
|
}
|
|
65052
65053
|
if (everyType(type, isTupleType)) {
|
|
65053
|
-
return
|
|
65054
|
-
const tupleType = t;
|
|
65055
|
-
const restType = getRestTypeOfTupleType(tupleType);
|
|
65056
|
-
if (!restType) {
|
|
65057
|
-
return undefinedType;
|
|
65058
|
-
}
|
|
65059
|
-
if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
|
|
65060
|
-
return getUnionType([restType, undefinedType]);
|
|
65061
|
-
}
|
|
65062
|
-
return restType;
|
|
65063
|
-
});
|
|
65054
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
65064
65055
|
}
|
|
65065
65056
|
return void 0;
|
|
65066
65057
|
}
|
|
@@ -65128,6 +65119,19 @@ ${lanes.join("\n")}
|
|
|
65128
65119
|
function getRestTypeOfTupleType(type) {
|
|
65129
65120
|
return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
|
|
65130
65121
|
}
|
|
65122
|
+
function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) {
|
|
65123
|
+
return mapType(type, (t) => {
|
|
65124
|
+
const tupleType = t;
|
|
65125
|
+
const restType = getRestTypeOfTupleType(tupleType);
|
|
65126
|
+
if (!restType) {
|
|
65127
|
+
return undefinedType;
|
|
65128
|
+
}
|
|
65129
|
+
if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) {
|
|
65130
|
+
return getUnionType([restType, undefinedOrMissingType2]);
|
|
65131
|
+
}
|
|
65132
|
+
return restType;
|
|
65133
|
+
});
|
|
65134
|
+
}
|
|
65131
65135
|
function getRestArrayTypeOfTupleType(type) {
|
|
65132
65136
|
const restType = getRestTypeOfTupleType(type);
|
|
65133
65137
|
return restType && createArrayType(restType);
|
|
@@ -66627,12 +66631,6 @@ ${lanes.join("\n")}
|
|
|
66627
66631
|
}
|
|
66628
66632
|
return links.resolvedSymbol;
|
|
66629
66633
|
}
|
|
66630
|
-
function isInTypeQuery(node) {
|
|
66631
|
-
return !!findAncestor(
|
|
66632
|
-
node,
|
|
66633
|
-
(n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
|
|
66634
|
-
);
|
|
66635
|
-
}
|
|
66636
66634
|
function isInAmbientOrTypeNode(node) {
|
|
66637
66635
|
return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
|
|
66638
66636
|
}
|
|
@@ -71855,7 +71853,7 @@ ${lanes.join("\n")}
|
|
|
71855
71853
|
}
|
|
71856
71854
|
let diagnosticMessage;
|
|
71857
71855
|
const declarationName = idText(right);
|
|
71858
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (
|
|
71856
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
71859
71857
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
71860
71858
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
71861
71859
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -77567,7 +77565,7 @@ ${lanes.join("\n")}
|
|
|
77567
77565
|
case "length":
|
|
77568
77566
|
case "caller":
|
|
77569
77567
|
case "arguments":
|
|
77570
|
-
if (
|
|
77568
|
+
if (useDefineForClassFields) {
|
|
77571
77569
|
break;
|
|
77572
77570
|
}
|
|
77573
77571
|
case "prototype":
|
|
@@ -77715,7 +77713,7 @@ ${lanes.join("\n")}
|
|
|
77715
77713
|
if (classExtendsNull) {
|
|
77716
77714
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
77717
77715
|
}
|
|
77718
|
-
const superCallShouldBeRootLevel =
|
|
77716
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
77719
77717
|
if (superCallShouldBeRootLevel) {
|
|
77720
77718
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
77721
77719
|
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);
|
|
@@ -80994,7 +80992,7 @@ ${lanes.join("\n")}
|
|
|
80994
80992
|
node
|
|
80995
80993
|
);
|
|
80996
80994
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
80997
|
-
const willTransformInitializers = !
|
|
80995
|
+
const willTransformInitializers = !emitStandardClassFields;
|
|
80998
80996
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
80999
80997
|
for (const member of node.members) {
|
|
81000
80998
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
@@ -91475,7 +91473,7 @@ ${lanes.join("\n")}
|
|
|
91475
91473
|
const constantValue = tryGetConstEnumValue(node);
|
|
91476
91474
|
if (constantValue !== void 0) {
|
|
91477
91475
|
setConstantValue(node, constantValue);
|
|
91478
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : factory2.createNumericLiteral(constantValue);
|
|
91476
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
|
|
91479
91477
|
if (!compilerOptions.removeComments) {
|
|
91480
91478
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
91481
91479
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -113858,7 +113856,7 @@ ${lanes.join("\n")}
|
|
|
113858
113856
|
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
|
|
113859
113857
|
} else if (isAccessExpression(expression)) {
|
|
113860
113858
|
const constantValue = getConstantValue(expression);
|
|
113861
|
-
return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue;
|
|
113859
|
+
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
113862
113860
|
}
|
|
113863
113861
|
}
|
|
113864
113862
|
function emitElementAccessExpression(node) {
|
|
@@ -134397,7 +134395,7 @@ ${lanes.join("\n")}
|
|
|
134397
134395
|
"src/services/sourcemaps.ts"() {
|
|
134398
134396
|
"use strict";
|
|
134399
134397
|
init_ts4();
|
|
134400
|
-
base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9
|
|
134398
|
+
base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/;
|
|
134401
134399
|
}
|
|
134402
134400
|
});
|
|
134403
134401
|
|
|
@@ -142621,7 +142619,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142621
142619
|
}
|
|
142622
142620
|
return result;
|
|
142623
142621
|
function escapeRegExp(str) {
|
|
142624
|
-
return str.replace(/[
|
|
142622
|
+
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
142625
142623
|
}
|
|
142626
142624
|
function getTodoCommentsRegExp() {
|
|
142627
142625
|
const singleLineCommentStart = /(?:\/\/+\s*)/.source;
|
|
@@ -148423,7 +148421,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148423
148421
|
function findEndOfTextBetween(jsDocComment, from, to) {
|
|
148424
148422
|
const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart());
|
|
148425
148423
|
for (let i = comment.length; i > 0; i--) {
|
|
148426
|
-
if (!/[
|
|
148424
|
+
if (!/[*/\s]/g.test(comment.substring(i - 1, i))) {
|
|
148427
148425
|
return from + i;
|
|
148428
148426
|
}
|
|
148429
148427
|
}
|
|
@@ -151936,7 +151934,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151936
151934
|
);
|
|
151937
151935
|
}
|
|
151938
151936
|
function getSuggestion(messageText) {
|
|
151939
|
-
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(
|
|
151937
|
+
const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
|
|
151940
151938
|
return suggestion;
|
|
151941
151939
|
}
|
|
151942
151940
|
var fixId28, errorCodes34;
|
|
@@ -158105,7 +158103,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158105
158103
|
return { kind: 1 /* JsDocTagName */ };
|
|
158106
158104
|
} else {
|
|
158107
158105
|
const lineStart = getLineStartPositionForPosition(position, sourceFile);
|
|
158108
|
-
if (!/[
|
|
158106
|
+
if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
|
|
158109
158107
|
return { kind: 2 /* JsDocTag */ };
|
|
158110
158108
|
}
|
|
158111
158109
|
}
|
|
@@ -158404,24 +158402,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158404
158402
|
}
|
|
158405
158403
|
}
|
|
158406
158404
|
}
|
|
158407
|
-
if (!isTypeLocation) {
|
|
158405
|
+
if (!isTypeLocation || isInTypeQuery(node)) {
|
|
158408
158406
|
typeChecker.tryGetThisTypeAt(
|
|
158409
158407
|
node,
|
|
158410
158408
|
/*includeGlobalThis*/
|
|
158411
158409
|
false
|
|
158412
158410
|
);
|
|
158413
158411
|
let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
|
|
158414
|
-
|
|
158415
|
-
|
|
158416
|
-
|
|
158417
|
-
|
|
158418
|
-
|
|
158419
|
-
|
|
158420
|
-
|
|
158412
|
+
if (!isTypeLocation) {
|
|
158413
|
+
let insertQuestionDot = false;
|
|
158414
|
+
if (type.isNullableType()) {
|
|
158415
|
+
const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false;
|
|
158416
|
+
if (canCorrectToQuestionDot || isRightOfQuestionDot) {
|
|
158417
|
+
type = type.getNonNullableType();
|
|
158418
|
+
if (canCorrectToQuestionDot) {
|
|
158419
|
+
insertQuestionDot = true;
|
|
158420
|
+
}
|
|
158421
158421
|
}
|
|
158422
158422
|
}
|
|
158423
|
+
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
158424
|
+
} else {
|
|
158425
|
+
addTypeProperties(
|
|
158426
|
+
type.getNonNullableType(),
|
|
158427
|
+
/*insertAwait*/
|
|
158428
|
+
false,
|
|
158429
|
+
/*insertQuestionDot*/
|
|
158430
|
+
false
|
|
158431
|
+
);
|
|
158423
158432
|
}
|
|
158424
|
-
addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
|
|
158425
158433
|
}
|
|
158426
158434
|
}
|
|
158427
158435
|
function addTypeProperties(type, insertAwait, insertQuestionDot) {
|
|
@@ -175712,7 +175720,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175712
175720
|
defaultTypeSafeList = {
|
|
175713
175721
|
"jquery": {
|
|
175714
175722
|
// jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
|
|
175715
|
-
match: /jquery(-[\d
|
|
175723
|
+
match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,
|
|
175716
175724
|
types: ["jquery"]
|
|
175717
175725
|
},
|
|
175718
175726
|
"WinJS": {
|
|
@@ -178440,7 +178448,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178440
178448
|
}
|
|
178441
178449
|
}
|
|
178442
178450
|
if (!exclude) {
|
|
178443
|
-
if (/^.+[
|
|
178451
|
+
if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
|
|
178444
178452
|
excludedFiles.push(normalizedNames[i]);
|
|
178445
178453
|
} else {
|
|
178446
178454
|
filesToKeep.push(proj.rootFiles[i]);
|
|
@@ -178761,7 +178769,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178761
178769
|
}
|
|
178762
178770
|
};
|
|
178763
178771
|
/** Makes a filename safe to insert in a RegExp */
|
|
178764
|
-
_ProjectService.filenameEscapeRegexp = /[
|
|
178772
|
+
_ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g;
|
|
178765
178773
|
ProjectService3 = _ProjectService;
|
|
178766
178774
|
}
|
|
178767
178775
|
});
|
|
@@ -183803,6 +183811,7 @@ ${e.message}`;
|
|
|
183803
183811
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
183804
183812
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
183805
183813
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
183814
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
183806
183815
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
183807
183816
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
183808
183817
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -184478,6 +184487,7 @@ ${e.message}`;
|
|
|
184478
184487
|
isInString: () => isInString,
|
|
184479
184488
|
isInTemplateString: () => isInTemplateString,
|
|
184480
184489
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
184490
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
184481
184491
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
184482
184492
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
184483
184493
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -186208,6 +186218,7 @@ ${e.message}`;
|
|
|
186208
186218
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
186209
186219
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
186210
186220
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
186221
|
+
getEmitStandardClassFields: () => getEmitStandardClassFields,
|
|
186211
186222
|
getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
|
|
186212
186223
|
getEnclosingContainer: () => getEnclosingContainer,
|
|
186213
186224
|
getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
|
|
@@ -186883,6 +186894,7 @@ ${e.message}`;
|
|
|
186883
186894
|
isInString: () => isInString,
|
|
186884
186895
|
isInTemplateString: () => isInTemplateString,
|
|
186885
186896
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
186897
|
+
isInTypeQuery: () => isInTypeQuery,
|
|
186886
186898
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
186887
186899
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
186888
186900
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|