typescript 5.5.0-dev.20240327 → 5.5.0-dev.20240328
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 +40 -0
- package/lib/lib.es2020.bigint.d.ts +2 -2
- package/lib/tsc.js +217 -152
- package/lib/typescript.d.ts +6 -3
- package/lib/typescript.js +251 -170
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -402,6 +402,7 @@ __export(typescript_exports, {
|
|
|
402
402
|
createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
403
403
|
createEmitHelperFactory: () => createEmitHelperFactory,
|
|
404
404
|
createEmptyExports: () => createEmptyExports,
|
|
405
|
+
createEvaluator: () => createEvaluator,
|
|
405
406
|
createExpressionForJsxElement: () => createExpressionForJsxElement,
|
|
406
407
|
createExpressionForJsxFragment: () => createExpressionForJsxFragment,
|
|
407
408
|
createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike,
|
|
@@ -2327,7 +2328,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2327
2328
|
|
|
2328
2329
|
// src/compiler/corePublic.ts
|
|
2329
2330
|
var versionMajorMinor = "5.5";
|
|
2330
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-dev.20240328`;
|
|
2331
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2332
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2333
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6695,6 +6696,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6695
6696
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
6696
6697
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
6697
6698
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
6699
|
+
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
6698
6700
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
6699
6701
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
6700
6702
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
@@ -21935,6 +21937,91 @@ function isSyntacticallyString(expr) {
|
|
|
21935
21937
|
}
|
|
21936
21938
|
return false;
|
|
21937
21939
|
}
|
|
21940
|
+
function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameExpression }) {
|
|
21941
|
+
function evaluate(expr, location) {
|
|
21942
|
+
switch (expr.kind) {
|
|
21943
|
+
case 224 /* PrefixUnaryExpression */:
|
|
21944
|
+
const value = evaluate(expr.operand, location);
|
|
21945
|
+
if (typeof value === "number") {
|
|
21946
|
+
switch (expr.operator) {
|
|
21947
|
+
case 40 /* PlusToken */:
|
|
21948
|
+
return value;
|
|
21949
|
+
case 41 /* MinusToken */:
|
|
21950
|
+
return -value;
|
|
21951
|
+
case 55 /* TildeToken */:
|
|
21952
|
+
return ~value;
|
|
21953
|
+
}
|
|
21954
|
+
}
|
|
21955
|
+
break;
|
|
21956
|
+
case 226 /* BinaryExpression */:
|
|
21957
|
+
const left = evaluate(expr.left, location);
|
|
21958
|
+
const right = evaluate(expr.right, location);
|
|
21959
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
21960
|
+
switch (expr.operatorToken.kind) {
|
|
21961
|
+
case 52 /* BarToken */:
|
|
21962
|
+
return left | right;
|
|
21963
|
+
case 51 /* AmpersandToken */:
|
|
21964
|
+
return left & right;
|
|
21965
|
+
case 49 /* GreaterThanGreaterThanToken */:
|
|
21966
|
+
return left >> right;
|
|
21967
|
+
case 50 /* GreaterThanGreaterThanGreaterThanToken */:
|
|
21968
|
+
return left >>> right;
|
|
21969
|
+
case 48 /* LessThanLessThanToken */:
|
|
21970
|
+
return left << right;
|
|
21971
|
+
case 53 /* CaretToken */:
|
|
21972
|
+
return left ^ right;
|
|
21973
|
+
case 42 /* AsteriskToken */:
|
|
21974
|
+
return left * right;
|
|
21975
|
+
case 44 /* SlashToken */:
|
|
21976
|
+
return left / right;
|
|
21977
|
+
case 40 /* PlusToken */:
|
|
21978
|
+
return left + right;
|
|
21979
|
+
case 41 /* MinusToken */:
|
|
21980
|
+
return left - right;
|
|
21981
|
+
case 45 /* PercentToken */:
|
|
21982
|
+
return left % right;
|
|
21983
|
+
case 43 /* AsteriskAsteriskToken */:
|
|
21984
|
+
return left ** right;
|
|
21985
|
+
}
|
|
21986
|
+
} else if ((typeof left === "string" || typeof left === "number") && (typeof right === "string" || typeof right === "number") && expr.operatorToken.kind === 40 /* PlusToken */) {
|
|
21987
|
+
return "" + left + right;
|
|
21988
|
+
}
|
|
21989
|
+
break;
|
|
21990
|
+
case 11 /* StringLiteral */:
|
|
21991
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
21992
|
+
return expr.text;
|
|
21993
|
+
case 228 /* TemplateExpression */:
|
|
21994
|
+
return evaluateTemplateExpression(expr, location);
|
|
21995
|
+
case 9 /* NumericLiteral */:
|
|
21996
|
+
return +expr.text;
|
|
21997
|
+
case 217 /* ParenthesizedExpression */:
|
|
21998
|
+
return evaluate(expr.expression, location);
|
|
21999
|
+
case 80 /* Identifier */:
|
|
22000
|
+
return evaluateEntityNameExpression(expr, location);
|
|
22001
|
+
case 211 /* PropertyAccessExpression */:
|
|
22002
|
+
if (isEntityNameExpression(expr)) {
|
|
22003
|
+
return evaluateEntityNameExpression(expr, location);
|
|
22004
|
+
}
|
|
22005
|
+
break;
|
|
22006
|
+
case 212 /* ElementAccessExpression */:
|
|
22007
|
+
return evaluateElementAccessExpression(expr, location);
|
|
22008
|
+
}
|
|
22009
|
+
return void 0;
|
|
22010
|
+
}
|
|
22011
|
+
function evaluateTemplateExpression(expr, location) {
|
|
22012
|
+
let result = expr.head.text;
|
|
22013
|
+
for (const span of expr.templateSpans) {
|
|
22014
|
+
const value = evaluate(span.expression, location);
|
|
22015
|
+
if (value === void 0) {
|
|
22016
|
+
return void 0;
|
|
22017
|
+
}
|
|
22018
|
+
result += value;
|
|
22019
|
+
result += span.literal.text;
|
|
22020
|
+
}
|
|
22021
|
+
return result;
|
|
22022
|
+
}
|
|
22023
|
+
return evaluate;
|
|
22024
|
+
}
|
|
21938
22025
|
|
|
21939
22026
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21940
22027
|
function createBaseNodeFactory() {
|
|
@@ -48134,6 +48221,10 @@ function createTypeChecker(host) {
|
|
|
48134
48221
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
48135
48222
|
var emitResolver = createResolver();
|
|
48136
48223
|
var nodeBuilder = createNodeBuilder();
|
|
48224
|
+
var evaluate = createEvaluator({
|
|
48225
|
+
evaluateElementAccessExpression,
|
|
48226
|
+
evaluateEntityNameExpression
|
|
48227
|
+
});
|
|
48137
48228
|
var globals = createSymbolTable();
|
|
48138
48229
|
var undefinedSymbol = createSymbol(4 /* Property */, "undefined");
|
|
48139
48230
|
undefinedSymbol.declarations = [];
|
|
@@ -53304,7 +53395,7 @@ function createTypeChecker(host) {
|
|
|
53304
53395
|
}
|
|
53305
53396
|
const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
|
|
53306
53397
|
if (some(abstractSignatures)) {
|
|
53307
|
-
const types = map(abstractSignatures, getOrCreateTypeFromSignature);
|
|
53398
|
+
const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s));
|
|
53308
53399
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
53309
53400
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
53310
53401
|
(context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
|
|
@@ -54619,7 +54710,7 @@ function createTypeChecker(host) {
|
|
|
54619
54710
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
54620
54711
|
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
54621
54712
|
name.symbol = sym;
|
|
54622
|
-
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
54713
|
+
return { introducesError, node: setTextRange(setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */), node) };
|
|
54623
54714
|
}
|
|
54624
54715
|
}
|
|
54625
54716
|
return { introducesError, node };
|
|
@@ -54629,7 +54720,6 @@ function createTypeChecker(host) {
|
|
|
54629
54720
|
cancellationToken.throwIfCancellationRequested();
|
|
54630
54721
|
}
|
|
54631
54722
|
let hadError = false;
|
|
54632
|
-
const file = getSourceFileOfNode(existing);
|
|
54633
54723
|
const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode);
|
|
54634
54724
|
if (hadError) {
|
|
54635
54725
|
return void 0;
|
|
@@ -54780,8 +54870,17 @@ function createTypeChecker(host) {
|
|
|
54780
54870
|
return result;
|
|
54781
54871
|
}
|
|
54782
54872
|
}
|
|
54783
|
-
if (
|
|
54784
|
-
|
|
54873
|
+
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
|
|
54874
|
+
const visited = visitEachChild(
|
|
54875
|
+
node,
|
|
54876
|
+
visitExistingNodeTreeSymbols,
|
|
54877
|
+
/*context*/
|
|
54878
|
+
void 0
|
|
54879
|
+
);
|
|
54880
|
+
const clone2 = setTextRange(visited === node ? factory.cloneNode(node) : visited, node);
|
|
54881
|
+
const flags = getEmitFlags(clone2);
|
|
54882
|
+
setEmitFlags(clone2, flags | (context.flags & 1024 /* MultilineObjectLiterals */ && isTypeLiteralNode(node) ? 0 : 1 /* SingleLine */));
|
|
54883
|
+
return clone2;
|
|
54785
54884
|
}
|
|
54786
54885
|
return visitEachChild(
|
|
54787
54886
|
node,
|
|
@@ -59461,11 +59560,15 @@ function createTypeChecker(host) {
|
|
|
59461
59560
|
const modifiers = getMappedTypeModifiers(type);
|
|
59462
59561
|
return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0;
|
|
59463
59562
|
}
|
|
59464
|
-
function getModifiersTypeOptionality(type) {
|
|
59465
|
-
return type.flags & 2097152 /* Intersection */ ? Math.max(...map(type.types, getModifiersTypeOptionality)) : getObjectFlags(type) & 32 /* Mapped */ ? getCombinedMappedTypeOptionality(type) : 0;
|
|
59466
|
-
}
|
|
59467
59563
|
function getCombinedMappedTypeOptionality(type) {
|
|
59468
|
-
|
|
59564
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
59565
|
+
return getMappedTypeOptionality(type) || getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(type));
|
|
59566
|
+
}
|
|
59567
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
59568
|
+
const optionality = getCombinedMappedTypeOptionality(type.types[0]);
|
|
59569
|
+
return every(type.types, (t, i) => i === 0 || getCombinedMappedTypeOptionality(t) === optionality) ? optionality : 0;
|
|
59570
|
+
}
|
|
59571
|
+
return 0;
|
|
59469
59572
|
}
|
|
59470
59573
|
function isPartialMappedType(type) {
|
|
59471
59574
|
return !!(getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */);
|
|
@@ -60742,6 +60845,12 @@ function createTypeChecker(host) {
|
|
|
60742
60845
|
isInJSFile(signature.declaration)
|
|
60743
60846
|
);
|
|
60744
60847
|
}
|
|
60848
|
+
function getImplementationSignature(signature) {
|
|
60849
|
+
return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
|
|
60850
|
+
}
|
|
60851
|
+
function createImplementationSignature(signature) {
|
|
60852
|
+
return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
|
|
60853
|
+
}
|
|
60745
60854
|
function getBaseSignature(signature) {
|
|
60746
60855
|
const typeParameters = signature.typeParameters;
|
|
60747
60856
|
if (typeParameters) {
|
|
@@ -60764,12 +60873,22 @@ function createTypeChecker(host) {
|
|
|
60764
60873
|
}
|
|
60765
60874
|
return signature;
|
|
60766
60875
|
}
|
|
60767
|
-
function getOrCreateTypeFromSignature(signature) {
|
|
60876
|
+
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
60768
60877
|
var _a;
|
|
60769
60878
|
if (!signature.isolatedSignatureType) {
|
|
60770
60879
|
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
60771
60880
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
60772
|
-
const type = createObjectType(16 /* Anonymous */);
|
|
60881
|
+
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
60882
|
+
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
60883
|
+
type.symbol.declarations = [signature.declaration];
|
|
60884
|
+
type.symbol.valueDeclaration = signature.declaration;
|
|
60885
|
+
}
|
|
60886
|
+
outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
|
|
60887
|
+
signature.declaration,
|
|
60888
|
+
/*includeThisTypes*/
|
|
60889
|
+
true
|
|
60890
|
+
));
|
|
60891
|
+
type.outerTypeParameters = outerTypeParameters;
|
|
60773
60892
|
type.members = emptySymbols;
|
|
60774
60893
|
type.properties = emptyArray;
|
|
60775
60894
|
type.callSignatures = !isConstructor ? [signature] : emptyArray;
|
|
@@ -63258,13 +63377,18 @@ function createTypeChecker(host) {
|
|
|
63258
63377
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
63259
63378
|
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
63260
63379
|
const instantiatedTemplateType = instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
63380
|
+
const isOptional = getMappedTypeOptionality(objectType) > 0 || (isGenericType(objectType) ? getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(objectType)) > 0 : couldAccessOptionalProperty(objectType, index));
|
|
63261
63381
|
return addOptionality(
|
|
63262
63382
|
instantiatedTemplateType,
|
|
63263
63383
|
/*isProperty*/
|
|
63264
63384
|
true,
|
|
63265
|
-
|
|
63385
|
+
isOptional
|
|
63266
63386
|
);
|
|
63267
63387
|
}
|
|
63388
|
+
function couldAccessOptionalProperty(objectType, indexType) {
|
|
63389
|
+
const indexConstraint = getBaseConstraintOfType(indexType);
|
|
63390
|
+
return !!indexConstraint && some(getPropertiesOfType(objectType), (p) => !!(p.flags & 16777216 /* Optional */) && isTypeAssignableTo(getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */), indexConstraint));
|
|
63391
|
+
}
|
|
63268
63392
|
function getIndexedAccessType(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
63269
63393
|
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
|
|
63270
63394
|
}
|
|
@@ -64175,7 +64299,7 @@ function createTypeChecker(host) {
|
|
|
64175
64299
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
64176
64300
|
const links = getNodeLinks(declaration);
|
|
64177
64301
|
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
64178
|
-
let typeParameters = links.outerTypeParameters;
|
|
64302
|
+
let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters;
|
|
64179
64303
|
if (!typeParameters) {
|
|
64180
64304
|
let outerTypeParameters = getOuterTypeParameters(
|
|
64181
64305
|
declaration,
|
|
@@ -64355,6 +64479,9 @@ function createTypeChecker(host) {
|
|
|
64355
64479
|
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
64356
64480
|
result.node = type.node;
|
|
64357
64481
|
}
|
|
64482
|
+
if (type.objectFlags & 134217728 /* SingleSignatureType */) {
|
|
64483
|
+
result.outerTypeParameters = type.outerTypeParameters;
|
|
64484
|
+
}
|
|
64358
64485
|
result.target = type;
|
|
64359
64486
|
result.mapper = mapper;
|
|
64360
64487
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -68986,7 +69113,7 @@ function createTypeChecker(host) {
|
|
|
68986
69113
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
68987
69114
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
68988
69115
|
}
|
|
68989
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
69116
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
68990
69117
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
68991
69118
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
68992
69119
|
}
|
|
@@ -69270,6 +69397,9 @@ function createTypeChecker(host) {
|
|
|
69270
69397
|
pos = p;
|
|
69271
69398
|
}
|
|
69272
69399
|
}
|
|
69400
|
+
function isTupleOfSelf(typeParameter, type) {
|
|
69401
|
+
return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
|
|
69402
|
+
}
|
|
69273
69403
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
69274
69404
|
let bivariant = false;
|
|
69275
69405
|
let propagationType;
|
|
@@ -69355,6 +69485,9 @@ function createTypeChecker(host) {
|
|
|
69355
69485
|
inference.priority = priority;
|
|
69356
69486
|
}
|
|
69357
69487
|
if (priority === inference.priority) {
|
|
69488
|
+
if (isTupleOfSelf(inference.typeParameter, candidate)) {
|
|
69489
|
+
return;
|
|
69490
|
+
}
|
|
69358
69491
|
if (contravariant && !bivariant) {
|
|
69359
69492
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
69360
69493
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -76293,7 +76426,7 @@ function createTypeChecker(host) {
|
|
|
76293
76426
|
argument = skipParentheses(argument);
|
|
76294
76427
|
return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
|
|
76295
76428
|
}
|
|
76296
|
-
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) {
|
|
76429
|
+
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
|
|
76297
76430
|
const errorOutputContainer = { errors: void 0, skipLogging: true };
|
|
76298
76431
|
if (isJsxOpeningLikeElement(node)) {
|
|
76299
76432
|
if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) {
|
|
@@ -76327,7 +76460,8 @@ function createTypeChecker(host) {
|
|
|
76327
76460
|
void 0,
|
|
76328
76461
|
checkMode
|
|
76329
76462
|
);
|
|
76330
|
-
const
|
|
76463
|
+
const regularArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
|
|
76464
|
+
const checkArgType = inferenceContext ? instantiateType(regularArgType, inferenceContext.nonFixingMapper) : regularArgType;
|
|
76331
76465
|
const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
|
|
76332
76466
|
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
|
|
76333
76467
|
Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
|
|
@@ -76739,7 +76873,9 @@ function createTypeChecker(host) {
|
|
|
76739
76873
|
0 /* Normal */,
|
|
76740
76874
|
/*reportErrors*/
|
|
76741
76875
|
true,
|
|
76742
|
-
() => chain
|
|
76876
|
+
() => chain,
|
|
76877
|
+
/*inferenceContext*/
|
|
76878
|
+
void 0
|
|
76743
76879
|
);
|
|
76744
76880
|
if (diags) {
|
|
76745
76881
|
for (const d of diags) {
|
|
@@ -76775,7 +76911,9 @@ function createTypeChecker(host) {
|
|
|
76775
76911
|
0 /* Normal */,
|
|
76776
76912
|
/*reportErrors*/
|
|
76777
76913
|
true,
|
|
76778
|
-
chain2
|
|
76914
|
+
chain2,
|
|
76915
|
+
/*inferenceContext*/
|
|
76916
|
+
void 0
|
|
76779
76917
|
);
|
|
76780
76918
|
if (diags2) {
|
|
76781
76919
|
if (diags2.length <= min2) {
|
|
@@ -76866,6 +77004,8 @@ function createTypeChecker(host) {
|
|
|
76866
77004
|
/*reportErrors*/
|
|
76867
77005
|
false,
|
|
76868
77006
|
/*containingMessageChain*/
|
|
77007
|
+
void 0,
|
|
77008
|
+
/*inferenceContext*/
|
|
76869
77009
|
void 0
|
|
76870
77010
|
)) {
|
|
76871
77011
|
candidatesForArgumentError = [candidate];
|
|
@@ -76874,13 +77014,16 @@ function createTypeChecker(host) {
|
|
|
76874
77014
|
return candidate;
|
|
76875
77015
|
}
|
|
76876
77016
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
76877
|
-
|
|
77017
|
+
let candidate = candidates2[candidateIndex];
|
|
76878
77018
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
76879
77019
|
continue;
|
|
76880
77020
|
}
|
|
76881
77021
|
let checkCandidate;
|
|
76882
77022
|
let inferenceContext;
|
|
76883
77023
|
if (candidate.typeParameters) {
|
|
77024
|
+
if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
|
|
77025
|
+
candidate = getImplementationSignature(candidate);
|
|
77026
|
+
}
|
|
76884
77027
|
let typeArgumentTypes;
|
|
76885
77028
|
if (some(typeArguments)) {
|
|
76886
77029
|
typeArgumentTypes = checkTypeArguments(
|
|
@@ -76900,7 +77043,7 @@ function createTypeChecker(host) {
|
|
|
76900
77043
|
/*flags*/
|
|
76901
77044
|
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
76902
77045
|
);
|
|
76903
|
-
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
77046
|
+
typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper);
|
|
76904
77047
|
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
76905
77048
|
}
|
|
76906
77049
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
@@ -76920,7 +77063,8 @@ function createTypeChecker(host) {
|
|
|
76920
77063
|
/*reportErrors*/
|
|
76921
77064
|
false,
|
|
76922
77065
|
/*containingMessageChain*/
|
|
76923
|
-
void 0
|
|
77066
|
+
void 0,
|
|
77067
|
+
inferenceContext
|
|
76924
77068
|
)) {
|
|
76925
77069
|
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
76926
77070
|
continue;
|
|
@@ -76928,7 +77072,7 @@ function createTypeChecker(host) {
|
|
|
76928
77072
|
if (argCheckMode) {
|
|
76929
77073
|
argCheckMode = 0 /* Normal */;
|
|
76930
77074
|
if (inferenceContext) {
|
|
76931
|
-
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
77075
|
+
const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper);
|
|
76932
77076
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
76933
77077
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
76934
77078
|
candidateForArgumentArityError = checkCandidate;
|
|
@@ -76944,7 +77088,8 @@ function createTypeChecker(host) {
|
|
|
76944
77088
|
/*reportErrors*/
|
|
76945
77089
|
false,
|
|
76946
77090
|
/*containingMessageChain*/
|
|
76947
|
-
void 0
|
|
77091
|
+
void 0,
|
|
77092
|
+
inferenceContext
|
|
76948
77093
|
)) {
|
|
76949
77094
|
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
76950
77095
|
continue;
|
|
@@ -80484,7 +80629,7 @@ function createTypeChecker(host) {
|
|
|
80484
80629
|
) || unknownType, isTemplateLiteralContextualType)) {
|
|
80485
80630
|
return getTemplateLiteralType(texts, types);
|
|
80486
80631
|
}
|
|
80487
|
-
const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ &&
|
|
80632
|
+
const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluate(node);
|
|
80488
80633
|
return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType;
|
|
80489
80634
|
}
|
|
80490
80635
|
function isTemplateLiteralContextualType(type) {
|
|
@@ -80698,7 +80843,7 @@ function createTypeChecker(host) {
|
|
|
80698
80843
|
}
|
|
80699
80844
|
}
|
|
80700
80845
|
}
|
|
80701
|
-
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
|
|
80846
|
+
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice());
|
|
80702
80847
|
}
|
|
80703
80848
|
}
|
|
80704
80849
|
}
|
|
@@ -80873,7 +81018,8 @@ function createTypeChecker(host) {
|
|
|
80873
81018
|
if (getIsolatedModules(compilerOptions)) {
|
|
80874
81019
|
Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
|
|
80875
81020
|
const constEnumDeclaration = type.symbol.valueDeclaration;
|
|
80876
|
-
|
|
81021
|
+
const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath);
|
|
81022
|
+
if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
|
|
80877
81023
|
error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
80878
81024
|
}
|
|
80879
81025
|
}
|
|
@@ -85460,122 +85606,53 @@ function createTypeChecker(host) {
|
|
|
85460
85606
|
}
|
|
85461
85607
|
return false;
|
|
85462
85608
|
}
|
|
85463
|
-
function
|
|
85464
|
-
|
|
85465
|
-
|
|
85466
|
-
|
|
85467
|
-
|
|
85468
|
-
|
|
85469
|
-
|
|
85470
|
-
|
|
85471
|
-
|
|
85472
|
-
|
|
85473
|
-
|
|
85474
|
-
|
|
85475
|
-
|
|
85476
|
-
|
|
85477
|
-
|
|
85478
|
-
|
|
85479
|
-
|
|
85480
|
-
|
|
85481
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
85482
|
-
switch (expr.operatorToken.kind) {
|
|
85483
|
-
case 52 /* BarToken */:
|
|
85484
|
-
return left | right;
|
|
85485
|
-
case 51 /* AmpersandToken */:
|
|
85486
|
-
return left & right;
|
|
85487
|
-
case 49 /* GreaterThanGreaterThanToken */:
|
|
85488
|
-
return left >> right;
|
|
85489
|
-
case 50 /* GreaterThanGreaterThanGreaterThanToken */:
|
|
85490
|
-
return left >>> right;
|
|
85491
|
-
case 48 /* LessThanLessThanToken */:
|
|
85492
|
-
return left << right;
|
|
85493
|
-
case 53 /* CaretToken */:
|
|
85494
|
-
return left ^ right;
|
|
85495
|
-
case 42 /* AsteriskToken */:
|
|
85496
|
-
return left * right;
|
|
85497
|
-
case 44 /* SlashToken */:
|
|
85498
|
-
return left / right;
|
|
85499
|
-
case 40 /* PlusToken */:
|
|
85500
|
-
return left + right;
|
|
85501
|
-
case 41 /* MinusToken */:
|
|
85502
|
-
return left - right;
|
|
85503
|
-
case 45 /* PercentToken */:
|
|
85504
|
-
return left % right;
|
|
85505
|
-
case 43 /* AsteriskAsteriskToken */:
|
|
85506
|
-
return left ** right;
|
|
85507
|
-
}
|
|
85508
|
-
} else if ((typeof left === "string" || typeof left === "number") && (typeof right === "string" || typeof right === "number") && expr.operatorToken.kind === 40 /* PlusToken */) {
|
|
85509
|
-
return "" + left + right;
|
|
85510
|
-
}
|
|
85511
|
-
break;
|
|
85512
|
-
case 11 /* StringLiteral */:
|
|
85513
|
-
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
85514
|
-
return expr.text;
|
|
85515
|
-
case 228 /* TemplateExpression */:
|
|
85516
|
-
return evaluateTemplateExpression(expr, location);
|
|
85517
|
-
case 9 /* NumericLiteral */:
|
|
85518
|
-
checkGrammarNumericLiteral(expr);
|
|
85519
|
-
return +expr.text;
|
|
85520
|
-
case 217 /* ParenthesizedExpression */:
|
|
85521
|
-
return evaluate(expr.expression, location);
|
|
85522
|
-
case 80 /* Identifier */: {
|
|
85523
|
-
const identifier = expr;
|
|
85524
|
-
if (isInfinityOrNaNString(identifier.escapedText) && resolveEntityName(
|
|
85525
|
-
identifier,
|
|
85526
|
-
111551 /* Value */,
|
|
85527
|
-
/*ignoreErrors*/
|
|
85528
|
-
true
|
|
85529
|
-
) === getGlobalSymbol(
|
|
85530
|
-
identifier.escapedText,
|
|
85531
|
-
111551 /* Value */,
|
|
85532
|
-
/*diagnostic*/
|
|
85533
|
-
void 0
|
|
85534
|
-
)) {
|
|
85535
|
-
return +identifier.escapedText;
|
|
85536
|
-
}
|
|
85609
|
+
function evaluateEntityNameExpression(expr, location) {
|
|
85610
|
+
const symbol = resolveEntityName(
|
|
85611
|
+
expr,
|
|
85612
|
+
111551 /* Value */,
|
|
85613
|
+
/*ignoreErrors*/
|
|
85614
|
+
true
|
|
85615
|
+
);
|
|
85616
|
+
if (!symbol)
|
|
85617
|
+
return void 0;
|
|
85618
|
+
if (expr.kind === 80 /* Identifier */) {
|
|
85619
|
+
const identifier = expr;
|
|
85620
|
+
if (isInfinityOrNaNString(identifier.escapedText) && symbol === getGlobalSymbol(
|
|
85621
|
+
identifier.escapedText,
|
|
85622
|
+
111551 /* Value */,
|
|
85623
|
+
/*diagnostic*/
|
|
85624
|
+
void 0
|
|
85625
|
+
)) {
|
|
85626
|
+
return +identifier.escapedText;
|
|
85537
85627
|
}
|
|
85538
|
-
|
|
85539
|
-
|
|
85540
|
-
|
|
85541
|
-
|
|
85542
|
-
|
|
85543
|
-
|
|
85544
|
-
|
|
85545
|
-
|
|
85546
|
-
|
|
85547
|
-
|
|
85548
|
-
|
|
85549
|
-
|
|
85550
|
-
|
|
85551
|
-
|
|
85552
|
-
|
|
85553
|
-
|
|
85554
|
-
|
|
85555
|
-
|
|
85556
|
-
|
|
85557
|
-
|
|
85558
|
-
|
|
85559
|
-
|
|
85560
|
-
const
|
|
85561
|
-
if (
|
|
85562
|
-
|
|
85563
|
-
root,
|
|
85564
|
-
111551 /* Value */,
|
|
85565
|
-
/*ignoreErrors*/
|
|
85566
|
-
true
|
|
85567
|
-
);
|
|
85568
|
-
if (rootSymbol && rootSymbol.flags & 384 /* Enum */) {
|
|
85569
|
-
const name = escapeLeadingUnderscores(expr.argumentExpression.text);
|
|
85570
|
-
const member = rootSymbol.exports.get(name);
|
|
85571
|
-
if (member) {
|
|
85572
|
-
return location ? evaluateEnumMember(expr, member, location) : getEnumMemberValue(member.valueDeclaration);
|
|
85573
|
-
}
|
|
85574
|
-
}
|
|
85628
|
+
}
|
|
85629
|
+
if (symbol.flags & 8 /* EnumMember */) {
|
|
85630
|
+
return location ? evaluateEnumMember(expr, symbol, location) : getEnumMemberValue(symbol.valueDeclaration);
|
|
85631
|
+
}
|
|
85632
|
+
if (isConstantVariable(symbol)) {
|
|
85633
|
+
const declaration = symbol.valueDeclaration;
|
|
85634
|
+
if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && (!location || declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location))) {
|
|
85635
|
+
return evaluate(declaration.initializer, declaration);
|
|
85636
|
+
}
|
|
85637
|
+
}
|
|
85638
|
+
}
|
|
85639
|
+
function evaluateElementAccessExpression(expr, location) {
|
|
85640
|
+
const root = expr.expression;
|
|
85641
|
+
if (isEntityNameExpression(root) && isStringLiteralLike(expr.argumentExpression)) {
|
|
85642
|
+
const rootSymbol = resolveEntityName(
|
|
85643
|
+
root,
|
|
85644
|
+
111551 /* Value */,
|
|
85645
|
+
/*ignoreErrors*/
|
|
85646
|
+
true
|
|
85647
|
+
);
|
|
85648
|
+
if (rootSymbol && rootSymbol.flags & 384 /* Enum */) {
|
|
85649
|
+
const name = escapeLeadingUnderscores(expr.argumentExpression.text);
|
|
85650
|
+
const member = rootSymbol.exports.get(name);
|
|
85651
|
+
if (member) {
|
|
85652
|
+
return location ? evaluateEnumMember(expr, member, location) : getEnumMemberValue(member.valueDeclaration);
|
|
85575
85653
|
}
|
|
85576
|
-
|
|
85654
|
+
}
|
|
85577
85655
|
}
|
|
85578
|
-
return void 0;
|
|
85579
85656
|
}
|
|
85580
85657
|
function evaluateEnumMember(expr, symbol, location) {
|
|
85581
85658
|
const declaration = symbol.valueDeclaration;
|
|
@@ -85589,18 +85666,6 @@ function createTypeChecker(host) {
|
|
|
85589
85666
|
}
|
|
85590
85667
|
return getEnumMemberValue(declaration);
|
|
85591
85668
|
}
|
|
85592
|
-
function evaluateTemplateExpression(expr, location) {
|
|
85593
|
-
let result = expr.head.text;
|
|
85594
|
-
for (const span of expr.templateSpans) {
|
|
85595
|
-
const value = evaluate(span.expression, location);
|
|
85596
|
-
if (value === void 0) {
|
|
85597
|
-
return void 0;
|
|
85598
|
-
}
|
|
85599
|
-
result += value;
|
|
85600
|
-
result += span.literal.text;
|
|
85601
|
-
}
|
|
85602
|
-
return result;
|
|
85603
|
-
}
|
|
85604
85669
|
function checkEnumDeclaration(node) {
|
|
85605
85670
|
addLazyDiagnostic(() => checkEnumDeclarationWorker(node));
|
|
85606
85671
|
}
|
|
@@ -122023,6 +122088,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122023
122088
|
getResolvedProjectReferenceByPath,
|
|
122024
122089
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
|
122025
122090
|
isSourceOfProjectReferenceRedirect,
|
|
122091
|
+
getRedirectReferenceForResolutionFromSourceOfProject,
|
|
122026
122092
|
emitBuildInfo,
|
|
122027
122093
|
fileExists,
|
|
122028
122094
|
readFile,
|
|
@@ -159431,7 +159497,8 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
159431
159497
|
}
|
|
159432
159498
|
function symbolAppearsToBeTypeOnly(symbol) {
|
|
159433
159499
|
var _a;
|
|
159434
|
-
|
|
159500
|
+
const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker));
|
|
159501
|
+
return !(flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(flags & 788968 /* Type */));
|
|
159435
159502
|
}
|
|
159436
159503
|
}
|
|
159437
159504
|
function getLabelCompletionAtPosition(node) {
|
|
@@ -173851,6 +173918,7 @@ __export(ts_exports2, {
|
|
|
173851
173918
|
createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
173852
173919
|
createEmitHelperFactory: () => createEmitHelperFactory,
|
|
173853
173920
|
createEmptyExports: () => createEmptyExports,
|
|
173921
|
+
createEvaluator: () => createEvaluator,
|
|
173854
173922
|
createExpressionForJsxElement: () => createExpressionForJsxElement,
|
|
173855
173923
|
createExpressionForJsxFragment: () => createExpressionForJsxFragment,
|
|
173856
173924
|
createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike,
|
|
@@ -180069,7 +180137,16 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
|
|
|
180069
180137
|
recursive ? watchedDirectoriesRecursive : watchedDirectories,
|
|
180070
180138
|
path,
|
|
180071
180139
|
callback,
|
|
180072
|
-
(id) => ({
|
|
180140
|
+
(id) => ({
|
|
180141
|
+
eventName: CreateDirectoryWatcherEvent,
|
|
180142
|
+
data: {
|
|
180143
|
+
id,
|
|
180144
|
+
path,
|
|
180145
|
+
recursive: !!recursive,
|
|
180146
|
+
// Special case node_modules as we watch it for changes to closed script infos as well
|
|
180147
|
+
ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
|
|
180148
|
+
}
|
|
180149
|
+
})
|
|
180073
180150
|
);
|
|
180074
180151
|
}
|
|
180075
180152
|
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
|
|
@@ -180096,24 +180173,28 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
|
|
|
180096
180173
|
}
|
|
180097
180174
|
};
|
|
180098
180175
|
}
|
|
180099
|
-
function onWatchChange(
|
|
180100
|
-
|
|
180101
|
-
|
|
180102
|
-
|
|
180176
|
+
function onWatchChange(args) {
|
|
180177
|
+
if (isArray(args))
|
|
180178
|
+
args.forEach(onWatchChangeRequestArgs);
|
|
180179
|
+
else
|
|
180180
|
+
onWatchChangeRequestArgs(args);
|
|
180103
180181
|
}
|
|
180104
|
-
function
|
|
180105
|
-
|
|
180106
|
-
(
|
|
180107
|
-
|
|
180108
|
-
callback(eventPath, eventKind);
|
|
180109
|
-
});
|
|
180182
|
+
function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
|
|
180183
|
+
onWatchEventType(id, created, 0 /* Created */);
|
|
180184
|
+
onWatchEventType(id, deleted, 2 /* Deleted */);
|
|
180185
|
+
onWatchEventType(id, updated, 1 /* Changed */);
|
|
180110
180186
|
}
|
|
180111
|
-
function
|
|
180112
|
-
|
|
180113
|
-
if (eventType === "update")
|
|
180187
|
+
function onWatchEventType(id, paths, eventKind) {
|
|
180188
|
+
if (!(paths == null ? void 0 : paths.length))
|
|
180114
180189
|
return;
|
|
180115
|
-
(
|
|
180116
|
-
|
|
180190
|
+
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
|
|
180191
|
+
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
|
|
180192
|
+
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
|
|
180193
|
+
}
|
|
180194
|
+
function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
|
|
180195
|
+
var _a;
|
|
180196
|
+
(_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
|
|
180197
|
+
eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
|
|
180117
180198
|
});
|
|
180118
180199
|
}
|
|
180119
180200
|
}
|
|
@@ -183086,7 +183167,6 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183086
183167
|
(fileName, eventKind) => {
|
|
183087
183168
|
switch (eventKind) {
|
|
183088
183169
|
case 0 /* Created */:
|
|
183089
|
-
return Debug.fail();
|
|
183090
183170
|
case 1 /* Changed */:
|
|
183091
183171
|
this.packageJsonCache.addOrUpdate(fileName, path);
|
|
183092
183172
|
this.onPackageJsonChange(result);
|
|
@@ -188054,6 +188134,7 @@ if (typeof console !== "undefined") {
|
|
|
188054
188134
|
createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
188055
188135
|
createEmitHelperFactory,
|
|
188056
188136
|
createEmptyExports,
|
|
188137
|
+
createEvaluator,
|
|
188057
188138
|
createExpressionForJsxElement,
|
|
188058
188139
|
createExpressionForJsxFragment,
|
|
188059
188140
|
createExpressionForObjectLiteralElementLike,
|