typescript 4.8.0-dev.20220630 → 4.8.0-dev.20220701
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 +219 -163
- package/lib/tsserver.js +229 -172
- package/lib/tsserverlibrary.js +229 -172
- package/lib/typescript.js +229 -172
- package/lib/typescriptServices.js +229 -172
- package/lib/typingsInstaller.js +229 -172
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
112
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220701";
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -5276,9 +5276,10 @@ var ts;
|
|
|
5276
5276
|
(function (TypeMapKind) {
|
|
5277
5277
|
TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple";
|
|
5278
5278
|
TypeMapKind[TypeMapKind["Array"] = 1] = "Array";
|
|
5279
|
-
TypeMapKind[TypeMapKind["
|
|
5280
|
-
TypeMapKind[TypeMapKind["
|
|
5281
|
-
TypeMapKind[TypeMapKind["
|
|
5279
|
+
TypeMapKind[TypeMapKind["Deferred"] = 2] = "Deferred";
|
|
5280
|
+
TypeMapKind[TypeMapKind["Function"] = 3] = "Function";
|
|
5281
|
+
TypeMapKind[TypeMapKind["Composite"] = 4] = "Composite";
|
|
5282
|
+
TypeMapKind[TypeMapKind["Merged"] = 5] = "Merged";
|
|
5282
5283
|
})(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {}));
|
|
5283
5284
|
var InferencePriority;
|
|
5284
5285
|
(function (InferencePriority) {
|
|
@@ -48681,6 +48682,24 @@ var ts;
|
|
|
48681
48682
|
var Symbol = ts.objectAllocator.getSymbolConstructor();
|
|
48682
48683
|
var Type = ts.objectAllocator.getTypeConstructor();
|
|
48683
48684
|
var Signature = ts.objectAllocator.getSignatureConstructor();
|
|
48685
|
+
var DebugTypeMapper = /** @class */ (function () {
|
|
48686
|
+
function DebugTypeMapper() {
|
|
48687
|
+
}
|
|
48688
|
+
DebugTypeMapper.prototype.__debugToString = function () {
|
|
48689
|
+
var _a;
|
|
48690
|
+
ts.Debug.type(this);
|
|
48691
|
+
switch (this.kind) {
|
|
48692
|
+
case 3 /* Function */: return ((_a = this.debugInfo) === null || _a === void 0 ? void 0 : _a.call(this)) || "(function mapper)";
|
|
48693
|
+
case 0 /* Simple */: return this.source.__debugTypeToString() + " -> " + this.target.__debugTypeToString();
|
|
48694
|
+
case 1 /* Array */: return ts.zipWith(this.sources, this.targets || ts.map(this.sources, function () { return anyType; }), function (s, t) { return s.__debugTypeToString() + " -> " + t.__debugTypeToString(); }).join(", ");
|
|
48695
|
+
case 2 /* Deferred */: return ts.zipWith(this.sources, this.targets, function (s, t) { return s.__debugTypeToString() + " -> " + t().__debugTypeToString(); }).join(", ");
|
|
48696
|
+
case 5 /* Merged */:
|
|
48697
|
+
case 4 /* Composite */: return "m1: " + this.mapper1.__debugToString().split("\n").join("\n ") + "\nm2: " + this.mapper2.__debugToString().split("\n").join("\n ");
|
|
48698
|
+
default: return ts.Debug.assertNever(this);
|
|
48699
|
+
}
|
|
48700
|
+
};
|
|
48701
|
+
return DebugTypeMapper;
|
|
48702
|
+
}());
|
|
48684
48703
|
var typeCount = 0;
|
|
48685
48704
|
var symbolCount = 0;
|
|
48686
48705
|
var enumCount = 0;
|
|
@@ -49141,10 +49160,23 @@ var ts;
|
|
|
49141
49160
|
var numberOrBigIntType = getUnionType([numberType, bigintType]);
|
|
49142
49161
|
var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
|
|
49143
49162
|
var numericStringType = getTemplateLiteralType(["", ""], [numberType]); // The `${number}` type
|
|
49144
|
-
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
|
|
49145
|
-
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
|
|
49163
|
+
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }, function () { return "(restrictive mapper)"; });
|
|
49164
|
+
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }, function () { return "(permissive mapper)"; });
|
|
49146
49165
|
var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); // `uniqueLiteralType` is a special `never` flagged by union reduction to behave as a literal
|
|
49147
|
-
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }); // replace all type parameters with the unique literal type (disregarding constraints)
|
|
49166
|
+
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }, function () { return "(unique literal mapper)"; }); // replace all type parameters with the unique literal type (disregarding constraints)
|
|
49167
|
+
var outofbandVarianceMarkerHandler;
|
|
49168
|
+
var reportUnreliableMapper = makeFunctionTypeMapper(function (t) {
|
|
49169
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
49170
|
+
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true);
|
|
49171
|
+
}
|
|
49172
|
+
return t;
|
|
49173
|
+
}, function () { return "(unmeasurable reporter)"; });
|
|
49174
|
+
var reportUnmeasurableMapper = makeFunctionTypeMapper(function (t) {
|
|
49175
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
49176
|
+
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false);
|
|
49177
|
+
}
|
|
49178
|
+
return t;
|
|
49179
|
+
}, function () { return "(unreliable reporter)"; });
|
|
49148
49180
|
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49149
49181
|
var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49150
49182
|
emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
|
|
@@ -49304,7 +49336,6 @@ var ts;
|
|
|
49304
49336
|
var typeofType = createTypeofType();
|
|
49305
49337
|
var _jsxNamespace;
|
|
49306
49338
|
var _jsxFactoryEntity;
|
|
49307
|
-
var outofbandVarianceMarkerHandler;
|
|
49308
49339
|
var subtypeRelation = new ts.Map();
|
|
49309
49340
|
var strictSubtypeRelation = new ts.Map();
|
|
49310
49341
|
var assignableRelation = new ts.Map();
|
|
@@ -53071,7 +53102,7 @@ var ts;
|
|
|
53071
53102
|
var name = typeParameterToName(newParam, context);
|
|
53072
53103
|
var newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
53073
53104
|
context.approximateLength += 37; // 15 each for two added conditionals, 7 for an added infer type
|
|
53074
|
-
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.
|
|
53105
|
+
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.mapper);
|
|
53075
53106
|
var saveInferTypeParameters_1 = context.inferTypeParameters;
|
|
53076
53107
|
context.inferTypeParameters = type.root.inferTypeParameters;
|
|
53077
53108
|
var extendsTypeNode_1 = typeToTypeNodeHelper(instantiateType(type.root.extendsType, newMapper), context);
|
|
@@ -60482,8 +60513,7 @@ var ts;
|
|
|
60482
60513
|
var _a;
|
|
60483
60514
|
var inferences;
|
|
60484
60515
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
60485
|
-
|
|
60486
|
-
var declaration = _b[_i];
|
|
60516
|
+
var _loop_15 = function (declaration) {
|
|
60487
60517
|
if (declaration.parent.kind === 190 /* InferType */) {
|
|
60488
60518
|
// When an 'infer T' declaration is immediately contained in a type reference node
|
|
60489
60519
|
// (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
|
|
@@ -60491,12 +60521,12 @@ var ts;
|
|
|
60491
60521
|
// present, we form an intersection of the inferred constraint types.
|
|
60492
60522
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
60493
60523
|
if (grandParent.kind === 178 /* TypeReference */ && !omitTypeReferences) {
|
|
60494
|
-
var
|
|
60495
|
-
var
|
|
60496
|
-
if (
|
|
60497
|
-
var index =
|
|
60498
|
-
if (index <
|
|
60499
|
-
var declaredConstraint = getConstraintOfTypeParameter(
|
|
60524
|
+
var typeReference_1 = grandParent;
|
|
60525
|
+
var typeParameters_1 = getTypeParametersForTypeReference(typeReference_1);
|
|
60526
|
+
if (typeParameters_1) {
|
|
60527
|
+
var index = typeReference_1.typeArguments.indexOf(childTypeParameter);
|
|
60528
|
+
if (index < typeParameters_1.length) {
|
|
60529
|
+
var declaredConstraint = getConstraintOfTypeParameter(typeParameters_1[index]);
|
|
60500
60530
|
if (declaredConstraint) {
|
|
60501
60531
|
// Type parameter constraints can reference other type parameters so
|
|
60502
60532
|
// constraints need to be instantiated. If instantiation produces the
|
|
@@ -60504,7 +60534,9 @@ var ts;
|
|
|
60504
60534
|
// type Foo<T extends string, U extends T> = [T, U];
|
|
60505
60535
|
// type Bar<T> = T extends Foo<infer X, infer X> ? Foo<X, X> : T;
|
|
60506
60536
|
// the instantiated constraint for U is X, so we discard that inference.
|
|
60507
|
-
var mapper =
|
|
60537
|
+
var mapper = makeDeferredTypeMapper(typeParameters_1, typeParameters_1.map(function (_, index) { return function () {
|
|
60538
|
+
return getEffectiveTypeArgumentAtIndex(typeReference_1, typeParameters_1, index);
|
|
60539
|
+
}; }));
|
|
60508
60540
|
var constraint = instantiateType(declaredConstraint, mapper);
|
|
60509
60541
|
if (constraint !== typeParameter) {
|
|
60510
60542
|
inferences = ts.append(inferences, constraint);
|
|
@@ -60542,6 +60574,10 @@ var ts;
|
|
|
60542
60574
|
inferences = ts.append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfNode(checkMappedType_1.typeParameter)), checkMappedType_1.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType_1.typeParameter.constraint) : keyofConstraintType)));
|
|
60543
60575
|
}
|
|
60544
60576
|
}
|
|
60577
|
+
};
|
|
60578
|
+
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
60579
|
+
var declaration = _b[_i];
|
|
60580
|
+
_loop_15(declaration);
|
|
60545
60581
|
}
|
|
60546
60582
|
}
|
|
60547
60583
|
return inferences && getIntersectionType(inferences);
|
|
@@ -61430,7 +61466,7 @@ var ts;
|
|
|
61430
61466
|
var lastRequiredIndex = -1;
|
|
61431
61467
|
var firstRestIndex = -1;
|
|
61432
61468
|
var lastOptionalOrRestIndex = -1;
|
|
61433
|
-
var
|
|
61469
|
+
var _loop_16 = function (i) {
|
|
61434
61470
|
var type = elementTypes[i];
|
|
61435
61471
|
var flags = target.elementFlags[i];
|
|
61436
61472
|
if (flags & 8 /* Variadic */) {
|
|
@@ -61460,7 +61496,7 @@ var ts;
|
|
|
61460
61496
|
}
|
|
61461
61497
|
};
|
|
61462
61498
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
61463
|
-
var state_4 =
|
|
61499
|
+
var state_4 = _loop_16(i);
|
|
61464
61500
|
if (typeof state_4 === "object")
|
|
61465
61501
|
return state_4.value;
|
|
61466
61502
|
}
|
|
@@ -61656,7 +61692,7 @@ var ts;
|
|
|
61656
61692
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
61657
61693
|
if (templates.length) {
|
|
61658
61694
|
var i = types.length;
|
|
61659
|
-
var
|
|
61695
|
+
var _loop_17 = function () {
|
|
61660
61696
|
i--;
|
|
61661
61697
|
var t = types[i];
|
|
61662
61698
|
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -61664,7 +61700,7 @@ var ts;
|
|
|
61664
61700
|
}
|
|
61665
61701
|
};
|
|
61666
61702
|
while (i > 0) {
|
|
61667
|
-
|
|
61703
|
+
_loop_17();
|
|
61668
61704
|
}
|
|
61669
61705
|
}
|
|
61670
61706
|
}
|
|
@@ -61741,14 +61777,14 @@ var ts;
|
|
|
61741
61777
|
var namedUnions = [];
|
|
61742
61778
|
addNamedUnions(namedUnions, types);
|
|
61743
61779
|
var reducedTypes = [];
|
|
61744
|
-
var
|
|
61780
|
+
var _loop_18 = function (t) {
|
|
61745
61781
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
61746
61782
|
reducedTypes.push(t);
|
|
61747
61783
|
}
|
|
61748
61784
|
};
|
|
61749
61785
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
61750
61786
|
var t = typeSet_1[_i];
|
|
61751
|
-
|
|
61787
|
+
_loop_18(t);
|
|
61752
61788
|
}
|
|
61753
61789
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
61754
61790
|
return namedUnions[0];
|
|
@@ -62972,7 +63008,7 @@ var ts;
|
|
|
62972
63008
|
var result;
|
|
62973
63009
|
var extraTypes;
|
|
62974
63010
|
var tailCount = 0;
|
|
62975
|
-
var
|
|
63011
|
+
var _loop_19 = function () {
|
|
62976
63012
|
if (tailCount === 1000) {
|
|
62977
63013
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
62978
63014
|
result = errorType;
|
|
@@ -63093,7 +63129,7 @@ var ts;
|
|
|
63093
63129
|
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
63094
63130
|
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
63095
63131
|
while (true) {
|
|
63096
|
-
var state_5 =
|
|
63132
|
+
var state_5 = _loop_19();
|
|
63097
63133
|
if (typeof state_5 === "object")
|
|
63098
63134
|
return state_5.value;
|
|
63099
63135
|
if (state_5 === "break")
|
|
@@ -63723,7 +63759,7 @@ var ts;
|
|
|
63723
63759
|
switch (mapper.kind) {
|
|
63724
63760
|
case 0 /* Simple */:
|
|
63725
63761
|
return type === mapper.source ? mapper.target : type;
|
|
63726
|
-
case 1 /* Array */:
|
|
63762
|
+
case 1 /* Array */: {
|
|
63727
63763
|
var sources = mapper.sources;
|
|
63728
63764
|
var targets = mapper.targets;
|
|
63729
63765
|
for (var i = 0; i < sources.length; i++) {
|
|
@@ -63732,25 +63768,45 @@ var ts;
|
|
|
63732
63768
|
}
|
|
63733
63769
|
}
|
|
63734
63770
|
return type;
|
|
63735
|
-
|
|
63771
|
+
}
|
|
63772
|
+
case 2 /* Deferred */: {
|
|
63773
|
+
var sources = mapper.sources;
|
|
63774
|
+
var targets = mapper.targets;
|
|
63775
|
+
for (var i = 0; i < sources.length; i++) {
|
|
63776
|
+
if (type === sources[i]) {
|
|
63777
|
+
return targets[i]();
|
|
63778
|
+
}
|
|
63779
|
+
}
|
|
63780
|
+
return type;
|
|
63781
|
+
}
|
|
63782
|
+
case 3 /* Function */:
|
|
63736
63783
|
return mapper.func(type);
|
|
63737
|
-
case
|
|
63738
|
-
case
|
|
63784
|
+
case 4 /* Composite */:
|
|
63785
|
+
case 5 /* Merged */:
|
|
63739
63786
|
var t1 = getMappedType(type, mapper.mapper1);
|
|
63740
|
-
return t1 !== type && mapper.kind ===
|
|
63787
|
+
return t1 !== type && mapper.kind === 4 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2);
|
|
63788
|
+
}
|
|
63789
|
+
}
|
|
63790
|
+
function attachDebugPrototypeIfDebug(mapper) {
|
|
63791
|
+
if (ts.Debug.isDebugging) {
|
|
63792
|
+
return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype);
|
|
63741
63793
|
}
|
|
63794
|
+
return mapper;
|
|
63742
63795
|
}
|
|
63743
63796
|
function makeUnaryTypeMapper(source, target) {
|
|
63744
|
-
return { kind: 0 /* Simple */, source: source, target: target };
|
|
63797
|
+
return attachDebugPrototypeIfDebug({ kind: 0 /* Simple */, source: source, target: target });
|
|
63745
63798
|
}
|
|
63746
63799
|
function makeArrayTypeMapper(sources, targets) {
|
|
63747
|
-
return { kind: 1 /* Array */, sources: sources, targets: targets };
|
|
63800
|
+
return attachDebugPrototypeIfDebug({ kind: 1 /* Array */, sources: sources, targets: targets });
|
|
63801
|
+
}
|
|
63802
|
+
function makeFunctionTypeMapper(func, debugInfo) {
|
|
63803
|
+
return attachDebugPrototypeIfDebug({ kind: 3 /* Function */, func: func, debugInfo: ts.Debug.isDebugging ? debugInfo : undefined });
|
|
63748
63804
|
}
|
|
63749
|
-
function
|
|
63750
|
-
return { kind: 2 /*
|
|
63805
|
+
function makeDeferredTypeMapper(sources, targets) {
|
|
63806
|
+
return attachDebugPrototypeIfDebug({ kind: 2 /* Deferred */, sources: sources, targets: targets });
|
|
63751
63807
|
}
|
|
63752
63808
|
function makeCompositeTypeMapper(kind, mapper1, mapper2) {
|
|
63753
|
-
return { kind: kind, mapper1: mapper1, mapper2: mapper2 };
|
|
63809
|
+
return attachDebugPrototypeIfDebug({ kind: kind, mapper1: mapper1, mapper2: mapper2 });
|
|
63754
63810
|
}
|
|
63755
63811
|
function createTypeEraser(sources) {
|
|
63756
63812
|
return createTypeMapper(sources, /*targets*/ undefined);
|
|
@@ -63760,19 +63816,20 @@ var ts;
|
|
|
63760
63816
|
* This is used during inference when instantiating type parameter defaults.
|
|
63761
63817
|
*/
|
|
63762
63818
|
function createBackreferenceMapper(context, index) {
|
|
63763
|
-
|
|
63819
|
+
var forwardInferences = context.inferences.slice(index);
|
|
63820
|
+
return createTypeMapper(ts.map(forwardInferences, function (i) { return i.typeParameter; }), ts.map(forwardInferences, function () { return unknownType; }));
|
|
63764
63821
|
}
|
|
63765
63822
|
function combineTypeMappers(mapper1, mapper2) {
|
|
63766
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
63823
|
+
return mapper1 ? makeCompositeTypeMapper(4 /* Composite */, mapper1, mapper2) : mapper2;
|
|
63767
63824
|
}
|
|
63768
63825
|
function mergeTypeMappers(mapper1, mapper2) {
|
|
63769
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
63826
|
+
return mapper1 ? makeCompositeTypeMapper(5 /* Merged */, mapper1, mapper2) : mapper2;
|
|
63770
63827
|
}
|
|
63771
63828
|
function prependTypeMapping(source, target, mapper) {
|
|
63772
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
63829
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, makeUnaryTypeMapper(source, target), mapper);
|
|
63773
63830
|
}
|
|
63774
63831
|
function appendTypeMapping(mapper, source, target) {
|
|
63775
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
63832
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, mapper, makeUnaryTypeMapper(source, target));
|
|
63776
63833
|
}
|
|
63777
63834
|
function getRestrictiveTypeParameter(tp) {
|
|
63778
63835
|
return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol),
|
|
@@ -65668,7 +65725,7 @@ var ts;
|
|
|
65668
65725
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
65669
65726
|
checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
|
|
65670
65727
|
}
|
|
65671
|
-
var
|
|
65728
|
+
var _loop_20 = function (prop) {
|
|
65672
65729
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
65673
65730
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
65674
65731
|
if (reportErrors) {
|
|
@@ -65731,7 +65788,7 @@ var ts;
|
|
|
65731
65788
|
};
|
|
65732
65789
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
65733
65790
|
var prop = _b[_i];
|
|
65734
|
-
var state_6 =
|
|
65791
|
+
var state_6 = _loop_20(prop);
|
|
65735
65792
|
if (typeof state_6 === "object")
|
|
65736
65793
|
return state_6.value;
|
|
65737
65794
|
}
|
|
@@ -65963,10 +66020,10 @@ var ts;
|
|
|
65963
66020
|
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
|
|
65964
66021
|
var saved = entry & 24 /* ReportsMask */;
|
|
65965
66022
|
if (saved & 8 /* ReportsUnmeasurable */) {
|
|
65966
|
-
instantiateType(source,
|
|
66023
|
+
instantiateType(source, reportUnmeasurableMapper);
|
|
65967
66024
|
}
|
|
65968
66025
|
if (saved & 16 /* ReportsUnreliable */) {
|
|
65969
|
-
instantiateType(source,
|
|
66026
|
+
instantiateType(source, reportUnreliableMapper);
|
|
65970
66027
|
}
|
|
65971
66028
|
}
|
|
65972
66029
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
@@ -66392,7 +66449,7 @@ var ts;
|
|
|
66392
66449
|
}
|
|
66393
66450
|
// Report unreliable variance for type variables referenced in template literal type placeholders.
|
|
66394
66451
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
66395
|
-
instantiateType(source,
|
|
66452
|
+
instantiateType(source, reportUnreliableMapper);
|
|
66396
66453
|
}
|
|
66397
66454
|
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
66398
66455
|
return -1 /* True */;
|
|
@@ -66664,18 +66721,6 @@ var ts;
|
|
|
66664
66721
|
}
|
|
66665
66722
|
}
|
|
66666
66723
|
}
|
|
66667
|
-
function reportUnmeasurableMarkers(p) {
|
|
66668
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
66669
|
-
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false);
|
|
66670
|
-
}
|
|
66671
|
-
return p;
|
|
66672
|
-
}
|
|
66673
|
-
function reportUnreliableMarkers(p) {
|
|
66674
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
66675
|
-
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true);
|
|
66676
|
-
}
|
|
66677
|
-
return p;
|
|
66678
|
-
}
|
|
66679
66724
|
// A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is
|
|
66680
66725
|
// related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice
|
|
66681
66726
|
// that S and T are contra-variant whereas X and Y are co-variant.
|
|
@@ -66685,7 +66730,7 @@ var ts;
|
|
|
66685
66730
|
if (modifiersRelated) {
|
|
66686
66731
|
var result_10;
|
|
66687
66732
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
66688
|
-
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source),
|
|
66733
|
+
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
|
|
66689
66734
|
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
66690
66735
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
66691
66736
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
@@ -66739,11 +66784,11 @@ var ts;
|
|
|
66739
66784
|
// constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
|
|
66740
66785
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
66741
66786
|
var matchingTypes = [];
|
|
66742
|
-
var
|
|
66787
|
+
var _loop_21 = function (combination) {
|
|
66743
66788
|
var hasMatch = false;
|
|
66744
66789
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
66745
66790
|
var type = _d[_c];
|
|
66746
|
-
var
|
|
66791
|
+
var _loop_22 = function (i) {
|
|
66747
66792
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
66748
66793
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
66749
66794
|
if (!targetProperty)
|
|
@@ -66759,7 +66804,7 @@ var ts;
|
|
|
66759
66804
|
}
|
|
66760
66805
|
};
|
|
66761
66806
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
66762
|
-
var state_8 =
|
|
66807
|
+
var state_8 = _loop_22(i);
|
|
66763
66808
|
switch (state_8) {
|
|
66764
66809
|
case "continue-outer": continue outer;
|
|
66765
66810
|
}
|
|
@@ -66773,7 +66818,7 @@ var ts;
|
|
|
66773
66818
|
};
|
|
66774
66819
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
66775
66820
|
var combination = discriminantCombinations_1[_a];
|
|
66776
|
-
var state_7 =
|
|
66821
|
+
var state_7 = _loop_21(combination);
|
|
66777
66822
|
if (typeof state_7 === "object")
|
|
66778
66823
|
return state_7.value;
|
|
66779
66824
|
}
|
|
@@ -67221,7 +67266,7 @@ var ts;
|
|
|
67221
67266
|
* See signatureAssignableTo, compareSignaturesIdentical
|
|
67222
67267
|
*/
|
|
67223
67268
|
function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
|
|
67224
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker,
|
|
67269
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper);
|
|
67225
67270
|
}
|
|
67226
67271
|
function signaturesIdenticalTo(source, target, kind) {
|
|
67227
67272
|
var sourceSignatures = getSignaturesOfType(source, kind);
|
|
@@ -67480,7 +67525,7 @@ var ts;
|
|
|
67480
67525
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
67481
67526
|
links.variances = ts.emptyArray;
|
|
67482
67527
|
var variances = [];
|
|
67483
|
-
var
|
|
67528
|
+
var _loop_23 = function (tp) {
|
|
67484
67529
|
var modifiers = getVarianceModifiers(tp);
|
|
67485
67530
|
var variance = modifiers & 65536 /* Out */ ?
|
|
67486
67531
|
modifiers & 32768 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ :
|
|
@@ -67516,9 +67561,9 @@ var ts;
|
|
|
67516
67561
|
}
|
|
67517
67562
|
variances.push(variance);
|
|
67518
67563
|
};
|
|
67519
|
-
for (var _i = 0,
|
|
67520
|
-
var tp =
|
|
67521
|
-
|
|
67564
|
+
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
67565
|
+
var tp = typeParameters_2[_i];
|
|
67566
|
+
_loop_23(tp);
|
|
67522
67567
|
}
|
|
67523
67568
|
links.variances = variances;
|
|
67524
67569
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -68513,27 +68558,29 @@ var ts;
|
|
|
68513
68558
|
signature: signature,
|
|
68514
68559
|
flags: flags,
|
|
68515
68560
|
compareTypes: compareTypes,
|
|
68516
|
-
mapper:
|
|
68517
|
-
nonFixingMapper:
|
|
68561
|
+
mapper: reportUnmeasurableMapper,
|
|
68562
|
+
nonFixingMapper: reportUnmeasurableMapper,
|
|
68518
68563
|
};
|
|
68564
|
+
context.mapper = makeFixingMapperForContext(context);
|
|
68565
|
+
context.nonFixingMapper = makeNonFixingMapperForContext(context);
|
|
68519
68566
|
return context;
|
|
68520
68567
|
}
|
|
68521
|
-
function
|
|
68522
|
-
|
|
68523
|
-
|
|
68524
|
-
|
|
68525
|
-
|
|
68526
|
-
|
|
68527
|
-
|
|
68528
|
-
|
|
68529
|
-
inferFromIntraExpressionSites(context);
|
|
68530
|
-
clearCachedInferences(inferences);
|
|
68531
|
-
inference.isFixed = true;
|
|
68532
|
-
}
|
|
68533
|
-
return getInferredType(context, i);
|
|
68568
|
+
function makeFixingMapperForContext(context) {
|
|
68569
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (inference, i) { return function () {
|
|
68570
|
+
if (!inference.isFixed) {
|
|
68571
|
+
// Before we commit to a particular inference (and thus lock out any further inferences),
|
|
68572
|
+
// we infer from any intra-expression inference sites we have collected.
|
|
68573
|
+
inferFromIntraExpressionSites(context);
|
|
68574
|
+
clearCachedInferences(context.inferences);
|
|
68575
|
+
inference.isFixed = true;
|
|
68534
68576
|
}
|
|
68535
|
-
|
|
68536
|
-
|
|
68577
|
+
return getInferredType(context, i);
|
|
68578
|
+
}; }));
|
|
68579
|
+
}
|
|
68580
|
+
function makeNonFixingMapperForContext(context) {
|
|
68581
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (_, i) { return function () {
|
|
68582
|
+
return getInferredType(context, i);
|
|
68583
|
+
}; }));
|
|
68537
68584
|
}
|
|
68538
68585
|
function clearCachedInferences(inferences) {
|
|
68539
68586
|
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
|
|
@@ -69453,7 +69500,7 @@ var ts;
|
|
|
69453
69500
|
// upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
|
|
69454
69501
|
// succeed. That would be a pointless and confusing outcome.
|
|
69455
69502
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
69456
|
-
var
|
|
69503
|
+
var _loop_24 = function (i) {
|
|
69457
69504
|
var source_1 = matches ? matches[i] : neverType;
|
|
69458
69505
|
var target_3 = types[i];
|
|
69459
69506
|
// If we are inferring from a string literal type to a type variable whose constraint includes one of the
|
|
@@ -69503,7 +69550,7 @@ var ts;
|
|
|
69503
69550
|
inferFromTypes(source_1, target_3);
|
|
69504
69551
|
};
|
|
69505
69552
|
for (var i = 0; i < types.length; i++) {
|
|
69506
|
-
|
|
69553
|
+
_loop_24(i);
|
|
69507
69554
|
}
|
|
69508
69555
|
}
|
|
69509
69556
|
}
|
|
@@ -70021,7 +70068,7 @@ var ts;
|
|
|
70021
70068
|
function mapTypesByKeyProperty(types, name) {
|
|
70022
70069
|
var map = new ts.Map();
|
|
70023
70070
|
var count = 0;
|
|
70024
|
-
var
|
|
70071
|
+
var _loop_25 = function (type) {
|
|
70025
70072
|
if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
70026
70073
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
70027
70074
|
if (discriminant) {
|
|
@@ -70047,7 +70094,7 @@ var ts;
|
|
|
70047
70094
|
};
|
|
70048
70095
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
70049
70096
|
var type = types_15[_i];
|
|
70050
|
-
var state_9 =
|
|
70097
|
+
var state_9 = _loop_25(type);
|
|
70051
70098
|
if (typeof state_9 === "object")
|
|
70052
70099
|
return state_9.value;
|
|
70053
70100
|
}
|
|
@@ -76396,7 +76443,7 @@ var ts;
|
|
|
76396
76443
|
if (spreadIndex >= 0) {
|
|
76397
76444
|
// Create synthetic arguments from spreads of tuple types.
|
|
76398
76445
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
76399
|
-
var
|
|
76446
|
+
var _loop_26 = function (i) {
|
|
76400
76447
|
var arg = args[i];
|
|
76401
76448
|
// We can call checkExpressionCached because spread expressions never have a contextual type.
|
|
76402
76449
|
var spreadType = arg.kind === 225 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
@@ -76413,7 +76460,7 @@ var ts;
|
|
|
76413
76460
|
}
|
|
76414
76461
|
};
|
|
76415
76462
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
76416
|
-
|
|
76463
|
+
_loop_26(i);
|
|
76417
76464
|
}
|
|
76418
76465
|
return effectiveArgs_1;
|
|
76419
76466
|
}
|
|
@@ -76742,7 +76789,7 @@ var ts;
|
|
|
76742
76789
|
var min_3 = Number.MAX_VALUE;
|
|
76743
76790
|
var minIndex = 0;
|
|
76744
76791
|
var i_1 = 0;
|
|
76745
|
-
var
|
|
76792
|
+
var _loop_27 = function (c) {
|
|
76746
76793
|
var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
76747
76794
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
|
|
76748
76795
|
if (diags_2) {
|
|
@@ -76760,7 +76807,7 @@ var ts;
|
|
|
76760
76807
|
};
|
|
76761
76808
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
76762
76809
|
var c = candidatesForArgumentError_1[_a];
|
|
76763
|
-
|
|
76810
|
+
_loop_27(c);
|
|
76764
76811
|
}
|
|
76765
76812
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
76766
76813
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -76918,7 +76965,7 @@ var ts;
|
|
|
76918
76965
|
}
|
|
76919
76966
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
76920
76967
|
var parameters = [];
|
|
76921
|
-
var
|
|
76968
|
+
var _loop_28 = function (i) {
|
|
76922
76969
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
76923
76970
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
76924
76971
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -76926,7 +76973,7 @@ var ts;
|
|
|
76926
76973
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
76927
76974
|
};
|
|
76928
76975
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
76929
|
-
|
|
76976
|
+
_loop_28(i);
|
|
76930
76977
|
}
|
|
76931
76978
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
76932
76979
|
var flags = 0 /* None */;
|
|
@@ -80279,8 +80326,8 @@ var ts;
|
|
|
80279
80326
|
var result = [];
|
|
80280
80327
|
var oldTypeParameters;
|
|
80281
80328
|
var newTypeParameters;
|
|
80282
|
-
for (var _i = 0,
|
|
80283
|
-
var tp =
|
|
80329
|
+
for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) {
|
|
80330
|
+
var tp = typeParameters_3[_i];
|
|
80284
80331
|
var name = tp.symbol.escapedName;
|
|
80285
80332
|
if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) {
|
|
80286
80333
|
var newName = getUniqueTypeParameterName(ts.concatenate(context.inferredTypeParameters, result), name);
|
|
@@ -80959,7 +81006,7 @@ var ts;
|
|
|
80959
81006
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
80960
81007
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
80961
81008
|
var indexSignatureMap_1 = new ts.Map();
|
|
80962
|
-
var
|
|
81009
|
+
var _loop_29 = function (declaration) {
|
|
80963
81010
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
80964
81011
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
80965
81012
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -80974,7 +81021,7 @@ var ts;
|
|
|
80974
81021
|
};
|
|
80975
81022
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
80976
81023
|
var declaration = _a[_i];
|
|
80977
|
-
|
|
81024
|
+
_loop_29(declaration);
|
|
80978
81025
|
}
|
|
80979
81026
|
indexSignatureMap_1.forEach(function (entry) {
|
|
80980
81027
|
if (entry.declarations.length > 1) {
|
|
@@ -81197,6 +81244,12 @@ var ts;
|
|
|
81197
81244
|
function checkMissingDeclaration(node) {
|
|
81198
81245
|
checkDecorators(node);
|
|
81199
81246
|
}
|
|
81247
|
+
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
81248
|
+
if (index < typeParameters.length) {
|
|
81249
|
+
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
81250
|
+
}
|
|
81251
|
+
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
81252
|
+
}
|
|
81200
81253
|
function getEffectiveTypeArguments(node, typeParameters) {
|
|
81201
81254
|
return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(node));
|
|
81202
81255
|
}
|
|
@@ -82664,8 +82717,8 @@ var ts;
|
|
|
82664
82717
|
return;
|
|
82665
82718
|
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
|
|
82666
82719
|
var seenParentsWithEveryUnused = new ts.Set();
|
|
82667
|
-
for (var _i = 0,
|
|
82668
|
-
var typeParameter =
|
|
82720
|
+
for (var _i = 0, typeParameters_4 = typeParameters; _i < typeParameters_4.length; _i++) {
|
|
82721
|
+
var typeParameter = typeParameters_4[_i];
|
|
82669
82722
|
if (!isTypeParameterUnused(typeParameter))
|
|
82670
82723
|
continue;
|
|
82671
82724
|
var name = ts.idText(typeParameter.name);
|
|
@@ -84484,7 +84537,7 @@ var ts;
|
|
|
84484
84537
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 258 /* InterfaceDeclaration */) : undefined;
|
|
84485
84538
|
var localPropDeclaration = declaration && declaration.kind === 221 /* BinaryExpression */ ||
|
|
84486
84539
|
name && name.kind === 162 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
84487
|
-
var
|
|
84540
|
+
var _loop_30 = function (info) {
|
|
84488
84541
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
84489
84542
|
// We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
|
|
84490
84543
|
// in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
|
|
@@ -84497,7 +84550,7 @@ var ts;
|
|
|
84497
84550
|
};
|
|
84498
84551
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
84499
84552
|
var info = indexInfos_9[_i];
|
|
84500
|
-
|
|
84553
|
+
_loop_30(info);
|
|
84501
84554
|
}
|
|
84502
84555
|
}
|
|
84503
84556
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -84505,7 +84558,7 @@ var ts;
|
|
|
84505
84558
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
84506
84559
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 258 /* InterfaceDeclaration */) : undefined;
|
|
84507
84560
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
84508
|
-
var
|
|
84561
|
+
var _loop_31 = function (info) {
|
|
84509
84562
|
if (info === checkInfo)
|
|
84510
84563
|
return "continue";
|
|
84511
84564
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -84520,7 +84573,7 @@ var ts;
|
|
|
84520
84573
|
};
|
|
84521
84574
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
84522
84575
|
var info = indexInfos_10[_i];
|
|
84523
|
-
|
|
84576
|
+
_loop_31(info);
|
|
84524
84577
|
}
|
|
84525
84578
|
}
|
|
84526
84579
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -84840,7 +84893,7 @@ var ts;
|
|
|
84840
84893
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
84841
84894
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
84842
84895
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
84843
|
-
var
|
|
84896
|
+
var _loop_32 = function (member) {
|
|
84844
84897
|
if (ts.hasAmbientModifier(member)) {
|
|
84845
84898
|
return "continue";
|
|
84846
84899
|
}
|
|
@@ -84857,7 +84910,7 @@ var ts;
|
|
|
84857
84910
|
};
|
|
84858
84911
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
84859
84912
|
var member = _a[_i];
|
|
84860
|
-
|
|
84913
|
+
_loop_32(member);
|
|
84861
84914
|
}
|
|
84862
84915
|
}
|
|
84863
84916
|
/**
|
|
@@ -84945,7 +84998,7 @@ var ts;
|
|
|
84945
84998
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
84946
84999
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
84947
85000
|
var issuedMemberError = false;
|
|
84948
|
-
var
|
|
85001
|
+
var _loop_33 = function (member) {
|
|
84949
85002
|
if (ts.isStatic(member)) {
|
|
84950
85003
|
return "continue";
|
|
84951
85004
|
}
|
|
@@ -84964,7 +85017,7 @@ var ts;
|
|
|
84964
85017
|
};
|
|
84965
85018
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
84966
85019
|
var member = _a[_i];
|
|
84967
|
-
|
|
85020
|
+
_loop_33(member);
|
|
84968
85021
|
}
|
|
84969
85022
|
if (!issuedMemberError) {
|
|
84970
85023
|
// check again with diagnostics to generate a less-specific error
|
|
@@ -85035,7 +85088,7 @@ var ts;
|
|
|
85035
85088
|
var _a, _b, _c, _d;
|
|
85036
85089
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
85037
85090
|
var baseProperties = getPropertiesOfType(baseType);
|
|
85038
|
-
var
|
|
85091
|
+
var _loop_34 = function (baseProperty) {
|
|
85039
85092
|
var base = getTargetSymbol(baseProperty);
|
|
85040
85093
|
if (base.flags & 4194304 /* Prototype */) {
|
|
85041
85094
|
return "continue";
|
|
@@ -85145,7 +85198,7 @@ var ts;
|
|
|
85145
85198
|
};
|
|
85146
85199
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
85147
85200
|
var baseProperty = baseProperties_1[_i];
|
|
85148
|
-
var state_10 =
|
|
85201
|
+
var state_10 = _loop_34(baseProperty);
|
|
85149
85202
|
switch (state_10) {
|
|
85150
85203
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
85151
85204
|
}
|
|
@@ -111660,7 +111713,6 @@ var ts;
|
|
|
111660
111713
|
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
|
111661
111714
|
// Update the output signature
|
|
111662
111715
|
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, createHash, changedDtsData);
|
|
111663
|
-
newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
|
|
111664
111716
|
}
|
|
111665
111717
|
// Update sourceFileInfo
|
|
111666
111718
|
var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
|
|
@@ -121047,7 +121099,7 @@ var ts;
|
|
|
121047
121099
|
state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
|
|
121048
121100
|
}
|
|
121049
121101
|
state.changedFilesSet = new ts.Set();
|
|
121050
|
-
state.
|
|
121102
|
+
state.latestChangedDtsFile = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.latestChangedDtsFile : undefined;
|
|
121051
121103
|
var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
|
|
121052
121104
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
121053
121105
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
@@ -121171,7 +121223,7 @@ var ts;
|
|
|
121171
121223
|
programEmitComplete: state.programEmitComplete,
|
|
121172
121224
|
emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
|
|
121173
121225
|
outSignature: state.outSignature,
|
|
121174
|
-
|
|
121226
|
+
latestChangedDtsFile: state.latestChangedDtsFile,
|
|
121175
121227
|
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
|
121176
121228
|
changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
|
|
121177
121229
|
};
|
|
@@ -121184,7 +121236,7 @@ var ts;
|
|
|
121184
121236
|
state.programEmitComplete = savedEmitState.programEmitComplete;
|
|
121185
121237
|
state.emitSignatures = savedEmitState.emitSignatures;
|
|
121186
121238
|
state.outSignature = savedEmitState.outSignature;
|
|
121187
|
-
state.
|
|
121239
|
+
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
|
121188
121240
|
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
|
121189
121241
|
if (savedEmitState.changedFilesSet)
|
|
121190
121242
|
state.changedFilesSet = savedEmitState.changedFilesSet;
|
|
@@ -121498,14 +121550,14 @@ var ts;
|
|
|
121498
121550
|
/**
|
|
121499
121551
|
* Gets the program information to be emitted in buildInfo so that we can use it to create new program
|
|
121500
121552
|
*/
|
|
121501
|
-
function getProgramBuildInfo(state, getCanonicalFileName
|
|
121553
|
+
function getProgramBuildInfo(state, getCanonicalFileName) {
|
|
121502
121554
|
var outFilePath = ts.outFile(state.compilerOptions);
|
|
121503
121555
|
if (outFilePath && !state.compilerOptions.composite)
|
|
121504
121556
|
return;
|
|
121505
121557
|
var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
|
|
121506
121558
|
var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
121507
|
-
//
|
|
121508
|
-
|
|
121559
|
+
// Convert the file name to Path here if we set the fileName instead to optimize multiple d.ts file emits and having to compute Canonical path
|
|
121560
|
+
var latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : undefined;
|
|
121509
121561
|
if (outFilePath) {
|
|
121510
121562
|
var fileNames_1 = [];
|
|
121511
121563
|
var fileInfos_1 = [];
|
|
@@ -121521,7 +121573,7 @@ var ts;
|
|
|
121521
121573
|
fileInfos: fileInfos_1,
|
|
121522
121574
|
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
|
|
121523
121575
|
outSignature: state.outSignature,
|
|
121524
|
-
|
|
121576
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
121525
121577
|
};
|
|
121526
121578
|
return result_15;
|
|
121527
121579
|
}
|
|
@@ -121623,7 +121675,7 @@ var ts;
|
|
|
121623
121675
|
affectedFilesPendingEmit: affectedFilesPendingEmit,
|
|
121624
121676
|
changeFileSet: changeFileSet,
|
|
121625
121677
|
emitSignatures: emitSignatures,
|
|
121626
|
-
|
|
121678
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
121627
121679
|
};
|
|
121628
121680
|
return result;
|
|
121629
121681
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
@@ -121791,7 +121843,7 @@ var ts;
|
|
|
121791
121843
|
*/
|
|
121792
121844
|
var computeHash = ts.maybeBind(host, host.createHash);
|
|
121793
121845
|
var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
|
121794
|
-
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName
|
|
121846
|
+
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
|
|
121795
121847
|
// To ensure that we arent storing any references to old program or new program without state
|
|
121796
121848
|
newProgram = undefined; // TODO: GH#18217
|
|
121797
121849
|
oldProgram = undefined;
|
|
@@ -121801,6 +121853,7 @@ var ts;
|
|
|
121801
121853
|
builderProgram.getState = getState;
|
|
121802
121854
|
builderProgram.saveEmitState = function () { return backupBuilderProgramEmitState(state); };
|
|
121803
121855
|
builderProgram.restoreEmitState = function (saved) { return restoreBuilderProgramEmitState(state, saved); };
|
|
121856
|
+
builderProgram.hasChangedEmitSignature = function () { return !!state.hasChangedEmitSignature; };
|
|
121804
121857
|
builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
|
|
121805
121858
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
121806
121859
|
builderProgram.emit = emit;
|
|
@@ -121908,18 +121961,22 @@ var ts;
|
|
|
121908
121961
|
var filePath = sourceFiles[0].resolvedPath;
|
|
121909
121962
|
var oldSignature = (_f = state.emitSignatures) === null || _f === void 0 ? void 0 : _f.get(filePath);
|
|
121910
121963
|
emitSignature !== null && emitSignature !== void 0 ? emitSignature : (emitSignature = computeSignature(text, computeHash, data));
|
|
121911
|
-
if
|
|
121912
|
-
|
|
121913
|
-
|
|
121914
|
-
|
|
121964
|
+
// Dont write dts files if they didn't change
|
|
121965
|
+
if (emitSignature === oldSignature)
|
|
121966
|
+
return;
|
|
121967
|
+
((_g = state.emitSignatures) !== null && _g !== void 0 ? _g : (state.emitSignatures = new ts.Map())).set(filePath, emitSignature);
|
|
121968
|
+
state.hasChangedEmitSignature = true;
|
|
121969
|
+
state.latestChangedDtsFile = fileName;
|
|
121915
121970
|
}
|
|
121916
121971
|
}
|
|
121917
121972
|
else if (state.compilerOptions.composite) {
|
|
121918
121973
|
var newSignature = computeSignature(text, computeHash, data);
|
|
121919
|
-
if
|
|
121920
|
-
|
|
121921
|
-
|
|
121922
|
-
|
|
121974
|
+
// Dont write dts files if they didn't change
|
|
121975
|
+
if (newSignature === state.outSignature)
|
|
121976
|
+
return;
|
|
121977
|
+
state.outSignature = newSignature;
|
|
121978
|
+
state.hasChangedEmitSignature = true;
|
|
121979
|
+
state.latestChangedDtsFile = fileName;
|
|
121923
121980
|
}
|
|
121924
121981
|
}
|
|
121925
121982
|
if (writeFile)
|
|
@@ -122082,11 +122139,12 @@ var ts;
|
|
|
122082
122139
|
var state;
|
|
122083
122140
|
var filePaths;
|
|
122084
122141
|
var filePathsSetList;
|
|
122142
|
+
var latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : undefined;
|
|
122085
122143
|
if (isProgramBundleEmitBuildInfo(program)) {
|
|
122086
122144
|
state = {
|
|
122087
122145
|
fileInfos: new ts.Map(),
|
|
122088
122146
|
compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
|
|
122089
|
-
|
|
122147
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
122090
122148
|
outSignature: program.outSignature,
|
|
122091
122149
|
};
|
|
122092
122150
|
}
|
|
@@ -122119,7 +122177,7 @@ var ts;
|
|
|
122119
122177
|
affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
|
|
122120
122178
|
affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
|
|
122121
122179
|
changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
|
|
122122
|
-
|
|
122180
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
122123
122181
|
emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
|
|
122124
122182
|
};
|
|
122125
122183
|
}
|
|
@@ -122146,6 +122204,7 @@ var ts;
|
|
|
122146
122204
|
getSemanticDiagnosticsOfNextAffectedFile: ts.notImplemented,
|
|
122147
122205
|
emitBuildInfo: ts.notImplemented,
|
|
122148
122206
|
close: ts.noop,
|
|
122207
|
+
hasChangedEmitSignature: ts.returnFalse,
|
|
122149
122208
|
};
|
|
122150
122209
|
function toPath(path) {
|
|
122151
122210
|
return ts.toPath(path, buildInfoDirectory, getCanonicalFileName);
|
|
@@ -123460,7 +123519,7 @@ var ts;
|
|
|
123460
123519
|
});
|
|
123461
123520
|
// Sort by paths closest to importing file Name directory
|
|
123462
123521
|
var sortedPaths = [];
|
|
123463
|
-
var
|
|
123522
|
+
var _loop_35 = function (directory) {
|
|
123464
123523
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
123465
123524
|
var pathsInDirectory;
|
|
123466
123525
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -123484,7 +123543,7 @@ var ts;
|
|
|
123484
123543
|
};
|
|
123485
123544
|
var out_directory_1;
|
|
123486
123545
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
123487
|
-
var state_11 =
|
|
123546
|
+
var state_11 = _loop_35(directory);
|
|
123488
123547
|
directory = out_directory_1;
|
|
123489
123548
|
if (state_11 === "break")
|
|
123490
123549
|
break;
|
|
@@ -124328,7 +124387,6 @@ var ts;
|
|
|
124328
124387
|
readDirectory: ts.maybeBind(host, host.readDirectory),
|
|
124329
124388
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
124330
124389
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
124331
|
-
now: ts.maybeBind(host, host.now),
|
|
124332
124390
|
};
|
|
124333
124391
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
124334
124392
|
try {
|
|
@@ -124486,7 +124544,6 @@ var ts;
|
|
|
124486
124544
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
124487
124545
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
124488
124546
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
124489
|
-
host.now = ts.maybeBind(system, system.now);
|
|
124490
124547
|
ts.setGetSourceFileAsHashVersioned(host, system);
|
|
124491
124548
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
124492
124549
|
return host;
|
|
@@ -125814,8 +125871,7 @@ var ts;
|
|
|
125814
125871
|
}
|
|
125815
125872
|
// Actual Emit
|
|
125816
125873
|
var host = state.host, compilerHost = state.compilerHost;
|
|
125817
|
-
var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
|
|
125818
|
-
var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
|
|
125874
|
+
var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
|
|
125819
125875
|
var emitterDiagnostics = ts.createDiagnosticCollection();
|
|
125820
125876
|
var emittedOutputs = new ts.Map();
|
|
125821
125877
|
var options = program.getCompilerOptions();
|
|
@@ -125823,17 +125879,11 @@ var ts;
|
|
|
125823
125879
|
var outputTimeStampMap;
|
|
125824
125880
|
var now;
|
|
125825
125881
|
outputFiles.forEach(function (_a) {
|
|
125826
|
-
var _b, _c;
|
|
125827
125882
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
125828
125883
|
var path = toPath(state, name);
|
|
125829
125884
|
emittedOutputs.set(toPath(state, name), name);
|
|
125830
|
-
if (buildInfo)
|
|
125831
|
-
setBuildInfo(state, buildInfo, projectPath, options);
|
|
125832
|
-
// Buildinfo has information on when last dts change time
|
|
125833
|
-
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo === null || existingBuildInfo === void 0 ? void 0 : existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
|
|
125834
|
-
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
125835
|
-
}
|
|
125836
|
-
}
|
|
125885
|
+
if (buildInfo)
|
|
125886
|
+
setBuildInfo(state, buildInfo, projectPath, options, resultFlags);
|
|
125837
125887
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
125838
125888
|
if (!isIncremental && state.watch) {
|
|
125839
125889
|
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
|
|
@@ -125847,7 +125897,7 @@ var ts;
|
|
|
125847
125897
|
ts.Debug.assert(step === BuildStep.EmitBuildInfo);
|
|
125848
125898
|
var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
125849
125899
|
if (data === null || data === void 0 ? void 0 : data.buildInfo)
|
|
125850
|
-
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
|
|
125900
|
+
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions(), BuildResultFlags.DeclarationOutputUnchanged);
|
|
125851
125901
|
if (writeFileCallback)
|
|
125852
125902
|
writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
125853
125903
|
else
|
|
@@ -125880,7 +125930,6 @@ var ts;
|
|
|
125880
125930
|
state.diagnostics.delete(projectPath);
|
|
125881
125931
|
state.projectStatus.set(projectPath, {
|
|
125882
125932
|
type: ts.UpToDateStatusType.UpToDate,
|
|
125883
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
|
|
125884
125933
|
oldestOutputFileName: oldestOutputFileName
|
|
125885
125934
|
});
|
|
125886
125935
|
afterProgramDone(state, program, config);
|
|
@@ -125922,10 +125971,10 @@ var ts;
|
|
|
125922
125971
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
125923
125972
|
emittedOutputs.set(toPath(state, name), name);
|
|
125924
125973
|
if (buildInfo) {
|
|
125925
|
-
|
|
125926
|
-
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
|
|
125974
|
+
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.outSignature) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) {
|
|
125927
125975
|
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
125928
125976
|
}
|
|
125977
|
+
setBuildInfo(state, buildInfo, projectPath, config.options, resultFlags);
|
|
125929
125978
|
}
|
|
125930
125979
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
125931
125980
|
});
|
|
@@ -126184,15 +126233,23 @@ var ts;
|
|
|
126184
126233
|
state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
|
|
126185
126234
|
return result;
|
|
126186
126235
|
}
|
|
126187
|
-
function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
|
|
126236
|
+
function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) {
|
|
126188
126237
|
var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
|
|
126189
126238
|
var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
|
|
126239
|
+
var modifiedTime = getCurrentTime(state.host);
|
|
126190
126240
|
if (existing) {
|
|
126191
126241
|
existing.buildInfo = buildInfo;
|
|
126192
|
-
existing.modifiedTime =
|
|
126242
|
+
existing.modifiedTime = modifiedTime;
|
|
126243
|
+
if (!(resultFlags & BuildResultFlags.DeclarationOutputUnchanged))
|
|
126244
|
+
existing.latestChangedDtsTime = modifiedTime;
|
|
126193
126245
|
}
|
|
126194
126246
|
else {
|
|
126195
|
-
state.buildInfoCache.set(resolvedConfigPath, {
|
|
126247
|
+
state.buildInfoCache.set(resolvedConfigPath, {
|
|
126248
|
+
path: toPath(state, buildInfoPath),
|
|
126249
|
+
buildInfo: buildInfo,
|
|
126250
|
+
modifiedTime: modifiedTime,
|
|
126251
|
+
latestChangedDtsTime: resultFlags & BuildResultFlags.DeclarationOutputUnchanged ? undefined : modifiedTime,
|
|
126252
|
+
});
|
|
126196
126253
|
}
|
|
126197
126254
|
}
|
|
126198
126255
|
function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
|
|
@@ -126224,7 +126281,7 @@ var ts;
|
|
|
126224
126281
|
}
|
|
126225
126282
|
}
|
|
126226
126283
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
126227
|
-
var _a, _b
|
|
126284
|
+
var _a, _b;
|
|
126228
126285
|
// Container if no files are specified in the project
|
|
126229
126286
|
if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
|
|
126230
126287
|
return {
|
|
@@ -126236,8 +126293,8 @@ var ts;
|
|
|
126236
126293
|
var force = !!state.options.force;
|
|
126237
126294
|
if (project.projectReferences) {
|
|
126238
126295
|
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
|
|
126239
|
-
for (var _i = 0,
|
|
126240
|
-
var ref =
|
|
126296
|
+
for (var _i = 0, _c = project.projectReferences; _i < _c.length; _i++) {
|
|
126297
|
+
var ref = _c[_i];
|
|
126241
126298
|
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
126242
126299
|
var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
|
|
126243
126300
|
var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
|
|
@@ -126277,7 +126334,6 @@ var ts;
|
|
|
126277
126334
|
var buildInfoTime;
|
|
126278
126335
|
var buildInfoProgram;
|
|
126279
126336
|
var buildInfoVersionMap;
|
|
126280
|
-
var newestDeclarationFileContentChangedTime;
|
|
126281
126337
|
if (buildInfoPath) {
|
|
126282
126338
|
var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
126283
126339
|
buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
|
|
@@ -126314,8 +126370,6 @@ var ts;
|
|
|
126314
126370
|
}
|
|
126315
126371
|
oldestOutputFileTime = buildInfoTime;
|
|
126316
126372
|
oldestOutputFileName = buildInfoPath;
|
|
126317
|
-
// Get the last dtsChange time from build info
|
|
126318
|
-
newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
|
|
126319
126373
|
}
|
|
126320
126374
|
// Check input files
|
|
126321
126375
|
var newestInputFileName = undefined;
|
|
@@ -126323,8 +126377,8 @@ var ts;
|
|
|
126323
126377
|
/** True if input file has changed timestamp but text is not changed, we can then do only timestamp updates on output to make it look up-to-date later */
|
|
126324
126378
|
var pseudoInputUpToDate = false;
|
|
126325
126379
|
// Get timestamps of input files
|
|
126326
|
-
for (var
|
|
126327
|
-
var inputFile =
|
|
126380
|
+
for (var _d = 0, _e = project.fileNames; _d < _e.length; _d++) {
|
|
126381
|
+
var inputFile = _e[_d];
|
|
126328
126382
|
var inputTime = getModifiedTime(state, inputFile);
|
|
126329
126383
|
if (inputTime === ts.missingFileModifiedTime) {
|
|
126330
126384
|
return {
|
|
@@ -126365,8 +126419,8 @@ var ts;
|
|
|
126365
126419
|
// Collect the expected outputs of this project
|
|
126366
126420
|
var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
|
|
126367
126421
|
var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
|
|
126368
|
-
for (var
|
|
126369
|
-
var output = outputs_1[
|
|
126422
|
+
for (var _f = 0, outputs_1 = outputs; _f < outputs_1.length; _f++) {
|
|
126423
|
+
var output = outputs_1[_f];
|
|
126370
126424
|
var path = toPath(state, output);
|
|
126371
126425
|
// Output is missing; can stop checking
|
|
126372
126426
|
var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
|
|
@@ -126404,8 +126458,8 @@ var ts;
|
|
|
126404
126458
|
var usesPrepend = false;
|
|
126405
126459
|
var upstreamChangedProject;
|
|
126406
126460
|
if (referenceStatuses) {
|
|
126407
|
-
for (var
|
|
126408
|
-
var
|
|
126461
|
+
for (var _g = 0, referenceStatuses_1 = referenceStatuses; _g < referenceStatuses_1.length; _g++) {
|
|
126462
|
+
var _h = referenceStatuses_1[_g], ref = _h.ref, refStatus = _h.refStatus, resolvedConfig = _h.resolvedConfig, resolvedRefPath = _h.resolvedRefPath;
|
|
126409
126463
|
usesPrepend = usesPrepend || !!(ref.prepend);
|
|
126410
126464
|
// If the upstream project's newest file is older than our oldest output, we
|
|
126411
126465
|
// can't be out of date because of it
|
|
@@ -126422,7 +126476,8 @@ var ts;
|
|
|
126422
126476
|
}
|
|
126423
126477
|
// If the upstream project has only change .d.ts files, and we've built
|
|
126424
126478
|
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
|
|
126425
|
-
|
|
126479
|
+
var newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath);
|
|
126480
|
+
if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
|
126426
126481
|
pseudoUpToDate = true;
|
|
126427
126482
|
upstreamChangedProject = ref.path;
|
|
126428
126483
|
continue;
|
|
@@ -126465,7 +126520,6 @@ var ts;
|
|
|
126465
126520
|
pseudoInputUpToDate ?
|
|
126466
126521
|
ts.UpToDateStatusType.UpToDateWithInputFileText :
|
|
126467
126522
|
ts.UpToDateStatusType.UpToDate,
|
|
126468
|
-
newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
|
|
126469
126523
|
newestInputFileTime: newestInputFileTime,
|
|
126470
126524
|
newestInputFileName: newestInputFileName,
|
|
126471
126525
|
oldestOutputFileName: oldestOutputFileName
|
|
@@ -126549,13 +126603,17 @@ var ts;
|
|
|
126549
126603
|
outputTimeStampMap.delete(key);
|
|
126550
126604
|
});
|
|
126551
126605
|
}
|
|
126552
|
-
function
|
|
126553
|
-
var _a;
|
|
126606
|
+
function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
126554
126607
|
if (!options.composite)
|
|
126555
126608
|
return undefined;
|
|
126556
|
-
var
|
|
126557
|
-
|
|
126558
|
-
|
|
126609
|
+
var entry = ts.Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
126610
|
+
if (entry.latestChangedDtsTime !== undefined)
|
|
126611
|
+
return entry.latestChangedDtsTime || undefined;
|
|
126612
|
+
var latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ?
|
|
126613
|
+
state.host.getModifiedTime(ts.getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, ts.getDirectoryPath(entry.path))) :
|
|
126614
|
+
undefined;
|
|
126615
|
+
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
126616
|
+
return latestChangedDtsTime;
|
|
126559
126617
|
}
|
|
126560
126618
|
function updateOutputTimestamps(state, proj, resolvedPath) {
|
|
126561
126619
|
if (state.options.dry) {
|
|
@@ -126564,7 +126622,6 @@ var ts;
|
|
|
126564
126622
|
updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
|
|
126565
126623
|
state.projectStatus.set(resolvedPath, {
|
|
126566
126624
|
type: ts.UpToDateStatusType.UpToDate,
|
|
126567
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
|
|
126568
126625
|
oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
|
|
126569
126626
|
});
|
|
126570
126627
|
}
|