typescript 5.2.0-dev.20230605 → 5.2.0-dev.20230607
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/tsc.js +72 -35
- package/lib/tsserver.js +679 -616
- package/lib/tsserverlibrary.js +678 -616
- package/lib/typescript.js +652 -608
- package/lib/typingsInstaller.js +27 -5
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230607`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1600,6 +1600,15 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1600
1600
|
);
|
|
1601
1601
|
}
|
|
1602
1602
|
Debug2.formatSnippetKind = formatSnippetKind;
|
|
1603
|
+
function formatScriptKind(kind) {
|
|
1604
|
+
return formatEnum(
|
|
1605
|
+
kind,
|
|
1606
|
+
ScriptKind,
|
|
1607
|
+
/*isFlags*/
|
|
1608
|
+
false
|
|
1609
|
+
);
|
|
1610
|
+
}
|
|
1611
|
+
Debug2.formatScriptKind = formatScriptKind;
|
|
1603
1612
|
function formatNodeFlags(flags) {
|
|
1604
1613
|
return formatEnum(
|
|
1605
1614
|
flags,
|
|
@@ -3787,6 +3796,17 @@ var ModuleKind = /* @__PURE__ */ ((ModuleKind2) => {
|
|
|
3787
3796
|
ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext";
|
|
3788
3797
|
return ModuleKind2;
|
|
3789
3798
|
})(ModuleKind || {});
|
|
3799
|
+
var ScriptKind = /* @__PURE__ */ ((ScriptKind3) => {
|
|
3800
|
+
ScriptKind3[ScriptKind3["Unknown"] = 0] = "Unknown";
|
|
3801
|
+
ScriptKind3[ScriptKind3["JS"] = 1] = "JS";
|
|
3802
|
+
ScriptKind3[ScriptKind3["JSX"] = 2] = "JSX";
|
|
3803
|
+
ScriptKind3[ScriptKind3["TS"] = 3] = "TS";
|
|
3804
|
+
ScriptKind3[ScriptKind3["TSX"] = 4] = "TSX";
|
|
3805
|
+
ScriptKind3[ScriptKind3["External"] = 5] = "External";
|
|
3806
|
+
ScriptKind3[ScriptKind3["JSON"] = 6] = "JSON";
|
|
3807
|
+
ScriptKind3[ScriptKind3["Deferred"] = 7] = "Deferred";
|
|
3808
|
+
return ScriptKind3;
|
|
3809
|
+
})(ScriptKind || {});
|
|
3790
3810
|
var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
|
|
3791
3811
|
TransformFlags3[TransformFlags3["None"] = 0] = "None";
|
|
3792
3812
|
TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript";
|
|
@@ -7708,6 +7728,7 @@ var Diagnostics = {
|
|
|
7708
7728
|
Use_import_type: diag(95180, 3 /* Message */, "Use_import_type_95180", "Use 'import type'"),
|
|
7709
7729
|
Use_type_0: diag(95181, 3 /* Message */, "Use_type_0_95181", "Use 'type {0}'"),
|
|
7710
7730
|
Fix_all_with_type_only_imports: diag(95182, 3 /* Message */, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"),
|
|
7731
|
+
Cannot_move_statements_to_the_selected_file: diag(95183, 3 /* Message */, "Cannot_move_statements_to_the_selected_file_95183", "Cannot move statements to the selected file"),
|
|
7711
7732
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7712
7733
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7713
7734
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -36913,7 +36934,7 @@ function compilerOptionValueToString(value) {
|
|
|
36913
36934
|
return str + "}";
|
|
36914
36935
|
}
|
|
36915
36936
|
function getKeyForCompilerOptions(options, affectingOptionDeclarations) {
|
|
36916
|
-
return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") +
|
|
36937
|
+
return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`;
|
|
36917
36938
|
}
|
|
36918
36939
|
function createCacheWithRedirects(ownOptions) {
|
|
36919
36940
|
const redirectsMap = /* @__PURE__ */ new Map();
|
|
@@ -42658,10 +42679,11 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
42658
42679
|
CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
|
|
42659
42680
|
CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
|
|
42660
42681
|
CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
|
|
42661
|
-
CheckMode3[CheckMode3["
|
|
42662
|
-
CheckMode3[CheckMode3["
|
|
42663
|
-
CheckMode3[CheckMode3["
|
|
42664
|
-
CheckMode3[CheckMode3["
|
|
42682
|
+
CheckMode3[CheckMode3["SkipAddingIntraExpressionSites"] = 16] = "SkipAddingIntraExpressionSites";
|
|
42683
|
+
CheckMode3[CheckMode3["IsForSignatureHelp"] = 32] = "IsForSignatureHelp";
|
|
42684
|
+
CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 64] = "IsForStringLiteralArgumentCompletions";
|
|
42685
|
+
CheckMode3[CheckMode3["RestBindingElement"] = 128] = "RestBindingElement";
|
|
42686
|
+
CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
|
|
42665
42687
|
return CheckMode3;
|
|
42666
42688
|
})(CheckMode || {});
|
|
42667
42689
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
@@ -42941,9 +42963,9 @@ function createTypeChecker(host) {
|
|
|
42941
42963
|
candidatesOutArray,
|
|
42942
42964
|
/*argumentCount*/
|
|
42943
42965
|
void 0,
|
|
42944
|
-
|
|
42966
|
+
64 /* IsForStringLiteralArgumentCompletions */
|
|
42945
42967
|
)),
|
|
42946
|
-
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount,
|
|
42968
|
+
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 32 /* IsForSignatureHelp */)),
|
|
42947
42969
|
getExpandedParameters,
|
|
42948
42970
|
hasEffectiveRestParameter,
|
|
42949
42971
|
containsArgumentsReference,
|
|
@@ -46474,7 +46496,7 @@ function createTypeChecker(host) {
|
|
|
46474
46496
|
function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
|
|
46475
46497
|
const type = createType(kind);
|
|
46476
46498
|
type.intrinsicName = intrinsicName;
|
|
46477
|
-
type.objectFlags = objectFlags
|
|
46499
|
+
type.objectFlags = objectFlags | 524288 /* CouldContainTypeVariablesComputed */ | 2097152 /* IsGenericTypeComputed */ | 33554432 /* IsUnknownLikeUnionComputed */ | 16777216 /* IsNeverIntersectionComputed */;
|
|
46478
46500
|
return type;
|
|
46479
46501
|
}
|
|
46480
46502
|
function createObjectType(objectFlags, symbol) {
|
|
@@ -50898,7 +50920,7 @@ function createTypeChecker(host) {
|
|
|
50898
50920
|
return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
|
|
50899
50921
|
}
|
|
50900
50922
|
function getTypeForBindingElement(declaration) {
|
|
50901
|
-
const checkMode = declaration.dotDotDotToken ?
|
|
50923
|
+
const checkMode = declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
|
|
50902
50924
|
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
50903
50925
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
50904
50926
|
}
|
|
@@ -58095,10 +58117,18 @@ function createTypeChecker(host) {
|
|
|
58095
58117
|
if (!result) {
|
|
58096
58118
|
const newMapper = createTypeMapper(typeParameters, typeArguments);
|
|
58097
58119
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
58098
|
-
if (result.flags & 138117121 /* ObjectFlagsType */ && !(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58099
|
-
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (some(typeArguments, couldContainTypeVariables) ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
58100
|
-
}
|
|
58101
58120
|
target.instantiations.set(id, result);
|
|
58121
|
+
const resultObjectFlags = getObjectFlags(result);
|
|
58122
|
+
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58123
|
+
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58124
|
+
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58125
|
+
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
58126
|
+
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
58127
|
+
} else {
|
|
58128
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 524288 /* CouldContainTypeVariablesComputed */ : 0;
|
|
58129
|
+
}
|
|
58130
|
+
}
|
|
58131
|
+
}
|
|
58102
58132
|
}
|
|
58103
58133
|
return result;
|
|
58104
58134
|
}
|
|
@@ -65795,7 +65825,7 @@ function createTypeChecker(host) {
|
|
|
65795
65825
|
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
65796
65826
|
}
|
|
65797
65827
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
65798
|
-
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode &
|
|
65828
|
+
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 128 /* RestBindingElement */ ? getContextualType(node, 8 /* SkipBindingPatterns */) : getContextualType(
|
|
65799
65829
|
node,
|
|
65800
65830
|
/*contextFlags*/
|
|
65801
65831
|
void 0
|
|
@@ -66552,7 +66582,7 @@ function createTypeChecker(host) {
|
|
|
66552
66582
|
function getContextualTypeForBindingElement(declaration, contextFlags) {
|
|
66553
66583
|
const parent = declaration.parent.parent;
|
|
66554
66584
|
const name = declaration.propertyName || declaration.name;
|
|
66555
|
-
const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ?
|
|
66585
|
+
const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */);
|
|
66556
66586
|
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
|
|
66557
66587
|
return void 0;
|
|
66558
66588
|
if (parent.name.kind === 206 /* ArrayBindingPattern */) {
|
|
@@ -67601,7 +67631,9 @@ function createTypeChecker(host) {
|
|
|
67601
67631
|
elementTypes.push(undefinedOrMissingType);
|
|
67602
67632
|
elementFlags.push(2 /* Optional */);
|
|
67603
67633
|
} else {
|
|
67604
|
-
const
|
|
67634
|
+
const shouldAddAsIntraExpressionInferenceSite = inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(e);
|
|
67635
|
+
const elementCheckMode = (checkMode || 0 /* Normal */) | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
67636
|
+
const type = checkExpressionForMutableLocation(e, elementCheckMode, forceTuple);
|
|
67605
67637
|
elementTypes.push(addOptionality(
|
|
67606
67638
|
type,
|
|
67607
67639
|
/*isProperty*/
|
|
@@ -67609,7 +67641,7 @@ function createTypeChecker(host) {
|
|
|
67609
67641
|
hasOmittedExpression
|
|
67610
67642
|
));
|
|
67611
67643
|
elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
|
|
67612
|
-
if (
|
|
67644
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
67613
67645
|
const inferenceContext = getInferenceContext(node);
|
|
67614
67646
|
Debug.assert(inferenceContext);
|
|
67615
67647
|
addIntraExpressionInferenceSite(inferenceContext, e, type);
|
|
@@ -67750,11 +67782,13 @@ function createTypeChecker(host) {
|
|
|
67750
67782
|
let member = getSymbolOfDeclaration(memberDecl);
|
|
67751
67783
|
const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
|
|
67752
67784
|
if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
|
|
67753
|
-
|
|
67785
|
+
const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl);
|
|
67786
|
+
const propCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
67787
|
+
let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, propCheckMode) : (
|
|
67754
67788
|
// avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
|
|
67755
67789
|
// for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
|
|
67756
67790
|
// we don't want to say "could not find 'a'".
|
|
67757
|
-
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name,
|
|
67791
|
+
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, propCheckMode) : checkObjectLiteralMethod(memberDecl, propCheckMode)
|
|
67758
67792
|
);
|
|
67759
67793
|
if (isInJavascript) {
|
|
67760
67794
|
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
|
|
@@ -67798,7 +67832,7 @@ function createTypeChecker(host) {
|
|
|
67798
67832
|
prop.links.target = member;
|
|
67799
67833
|
member = prop;
|
|
67800
67834
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
67801
|
-
if (
|
|
67835
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
67802
67836
|
const inferenceContext = getInferenceContext(node);
|
|
67803
67837
|
Debug.assert(inferenceContext);
|
|
67804
67838
|
const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
|
|
@@ -67971,7 +68005,9 @@ function createTypeChecker(host) {
|
|
|
67971
68005
|
for (const attributeDecl of attributes.properties) {
|
|
67972
68006
|
const member = attributeDecl.symbol;
|
|
67973
68007
|
if (isJsxAttribute(attributeDecl)) {
|
|
67974
|
-
const
|
|
68008
|
+
const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(attributeDecl);
|
|
68009
|
+
const attributeCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
68010
|
+
const exprType = checkJsxAttribute(attributeDecl, attributeCheckMode);
|
|
67975
68011
|
objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
|
|
67976
68012
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
67977
68013
|
attributeSymbol.declarations = member.declarations;
|
|
@@ -67992,7 +68028,7 @@ function createTypeChecker(host) {
|
|
|
67992
68028
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
67993
68029
|
}
|
|
67994
68030
|
}
|
|
67995
|
-
if (
|
|
68031
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
67996
68032
|
const inferenceContext = getInferenceContext(attributes);
|
|
67997
68033
|
Debug.assert(inferenceContext);
|
|
67998
68034
|
const inferenceNode = attributeDecl.initializer.expression;
|
|
@@ -69610,7 +69646,7 @@ function createTypeChecker(host) {
|
|
|
69610
69646
|
}
|
|
69611
69647
|
for (let i = 0; i < argCount; i++) {
|
|
69612
69648
|
const arg = args[i];
|
|
69613
|
-
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode &
|
|
69649
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 64 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
69614
69650
|
const paramType = getTypeAtPosition(signature, i);
|
|
69615
69651
|
if (couldContainTypeVariables(paramType)) {
|
|
69616
69652
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -70223,12 +70259,12 @@ function createTypeChecker(host) {
|
|
|
70223
70259
|
const args = getEffectiveCallArguments(node);
|
|
70224
70260
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
70225
70261
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
70226
|
-
argCheckMode |= checkMode &
|
|
70262
|
+
argCheckMode |= checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
|
|
70227
70263
|
let candidatesForArgumentError;
|
|
70228
70264
|
let candidateForArgumentArityError;
|
|
70229
70265
|
let candidateForTypeArgumentError;
|
|
70230
70266
|
let result;
|
|
70231
|
-
const signatureHelpTrailingComma = !!(checkMode &
|
|
70267
|
+
const signatureHelpTrailingComma = !!(checkMode & 32 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
|
|
70232
70268
|
if (candidates.length > 1) {
|
|
70233
70269
|
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
70234
70270
|
}
|
|
@@ -70447,7 +70483,7 @@ function createTypeChecker(host) {
|
|
|
70447
70483
|
continue;
|
|
70448
70484
|
}
|
|
70449
70485
|
if (argCheckMode) {
|
|
70450
|
-
argCheckMode = checkMode &
|
|
70486
|
+
argCheckMode = checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
|
|
70451
70487
|
if (inferenceContext) {
|
|
70452
70488
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
70453
70489
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -73525,7 +73561,7 @@ function createTypeChecker(host) {
|
|
|
73525
73561
|
case 36 /* ExclamationEqualsToken */:
|
|
73526
73562
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
73527
73563
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
73528
|
-
if (!(checkMode && checkMode &
|
|
73564
|
+
if (!(checkMode && checkMode & 256 /* TypeOnly */)) {
|
|
73529
73565
|
if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
|
|
73530
73566
|
const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
|
|
73531
73567
|
error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
@@ -74184,7 +74220,7 @@ function createTypeChecker(host) {
|
|
|
74184
74220
|
}
|
|
74185
74221
|
}
|
|
74186
74222
|
const startInvocationCount = flowInvocationCount;
|
|
74187
|
-
const type = checkExpression(node,
|
|
74223
|
+
const type = checkExpression(node, 256 /* TypeOnly */);
|
|
74188
74224
|
if (flowInvocationCount !== startInvocationCount) {
|
|
74189
74225
|
const cache = flowTypeCache || (flowTypeCache = []);
|
|
74190
74226
|
cache[getNodeId(node)] = type;
|
|
@@ -76655,7 +76691,7 @@ function createTypeChecker(host) {
|
|
|
76655
76691
|
checkComputedPropertyName(node.propertyName);
|
|
76656
76692
|
}
|
|
76657
76693
|
const parent = node.parent.parent;
|
|
76658
|
-
const parentCheckMode = node.dotDotDotToken ?
|
|
76694
|
+
const parentCheckMode = node.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
|
|
76659
76695
|
const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
76660
76696
|
const name = node.propertyName || node.name;
|
|
76661
76697
|
if (parentType && !isBindingPattern(name)) {
|
|
@@ -114477,13 +114513,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
114477
114513
|
sourceFileOptions,
|
|
114478
114514
|
/*onError*/
|
|
114479
114515
|
void 0,
|
|
114480
|
-
shouldCreateNewSourceFile
|
|
114516
|
+
shouldCreateNewSourceFile
|
|
114481
114517
|
) : host.getSourceFile(
|
|
114482
114518
|
oldSourceFile.fileName,
|
|
114483
114519
|
sourceFileOptions,
|
|
114484
114520
|
/*onError*/
|
|
114485
114521
|
void 0,
|
|
114486
|
-
shouldCreateNewSourceFile
|
|
114522
|
+
shouldCreateNewSourceFile
|
|
114487
114523
|
);
|
|
114488
114524
|
if (!newSourceFile) {
|
|
114489
114525
|
return 0 /* Not */;
|
|
@@ -115439,7 +115475,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115439
115475
|
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
115440
115476
|
}
|
|
115441
115477
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
115442
|
-
var _a2
|
|
115478
|
+
var _a2;
|
|
115443
115479
|
const path = toPath3(fileName);
|
|
115444
115480
|
if (useSourceOfProjectReferenceRedirect) {
|
|
115445
115481
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
@@ -115518,7 +115554,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115518
115554
|
Diagnostics.Cannot_read_file_0_Colon_1,
|
|
115519
115555
|
[fileName, hostErrorMessage]
|
|
115520
115556
|
),
|
|
115521
|
-
shouldCreateNewSourceFile
|
|
115557
|
+
shouldCreateNewSourceFile
|
|
115522
115558
|
);
|
|
115523
115559
|
if (packageId) {
|
|
115524
115560
|
const packageIdKey = packageIdToString(packageId);
|
|
@@ -115543,7 +115579,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115543
115579
|
file.path = path;
|
|
115544
115580
|
file.resolvedPath = toPath3(fileName);
|
|
115545
115581
|
file.originalFileName = originalFileName;
|
|
115546
|
-
file.packageJsonLocations = ((
|
|
115582
|
+
file.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0;
|
|
115547
115583
|
file.packageJsonScope = sourceFileOptions.packageJsonScope;
|
|
115548
115584
|
addFileIncludeReason(file, reason);
|
|
115549
115585
|
if (host.useCaseSensitiveFileNames()) {
|
|
@@ -120613,7 +120649,8 @@ function createWatchProgram(host) {
|
|
|
120613
120649
|
if (isFileMissingOnHost(hostSourceFile)) {
|
|
120614
120650
|
return void 0;
|
|
120615
120651
|
}
|
|
120616
|
-
|
|
120652
|
+
const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0;
|
|
120653
|
+
if (hostSourceFile === void 0 || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile) || hostSourceFile.sourceFile.impliedNodeFormat !== impliedNodeFormat) {
|
|
120617
120654
|
const sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError);
|
|
120618
120655
|
if (hostSourceFile) {
|
|
120619
120656
|
if (sourceFile) {
|