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
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220701";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -5461,9 +5461,10 @@ var ts;
|
|
|
5461
5461
|
(function (TypeMapKind) {
|
|
5462
5462
|
TypeMapKind[TypeMapKind["Simple"] = 0] = "Simple";
|
|
5463
5463
|
TypeMapKind[TypeMapKind["Array"] = 1] = "Array";
|
|
5464
|
-
TypeMapKind[TypeMapKind["
|
|
5465
|
-
TypeMapKind[TypeMapKind["
|
|
5466
|
-
TypeMapKind[TypeMapKind["
|
|
5464
|
+
TypeMapKind[TypeMapKind["Deferred"] = 2] = "Deferred";
|
|
5465
|
+
TypeMapKind[TypeMapKind["Function"] = 3] = "Function";
|
|
5466
|
+
TypeMapKind[TypeMapKind["Composite"] = 4] = "Composite";
|
|
5467
|
+
TypeMapKind[TypeMapKind["Merged"] = 5] = "Merged";
|
|
5467
5468
|
})(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {}));
|
|
5468
5469
|
var InferencePriority;
|
|
5469
5470
|
(function (InferencePriority) {
|
|
@@ -48866,6 +48867,24 @@ var ts;
|
|
|
48866
48867
|
var Symbol = ts.objectAllocator.getSymbolConstructor();
|
|
48867
48868
|
var Type = ts.objectAllocator.getTypeConstructor();
|
|
48868
48869
|
var Signature = ts.objectAllocator.getSignatureConstructor();
|
|
48870
|
+
var DebugTypeMapper = /** @class */ (function () {
|
|
48871
|
+
function DebugTypeMapper() {
|
|
48872
|
+
}
|
|
48873
|
+
DebugTypeMapper.prototype.__debugToString = function () {
|
|
48874
|
+
var _a;
|
|
48875
|
+
ts.Debug.type(this);
|
|
48876
|
+
switch (this.kind) {
|
|
48877
|
+
case 3 /* Function */: return ((_a = this.debugInfo) === null || _a === void 0 ? void 0 : _a.call(this)) || "(function mapper)";
|
|
48878
|
+
case 0 /* Simple */: return this.source.__debugTypeToString() + " -> " + this.target.__debugTypeToString();
|
|
48879
|
+
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(", ");
|
|
48880
|
+
case 2 /* Deferred */: return ts.zipWith(this.sources, this.targets, function (s, t) { return s.__debugTypeToString() + " -> " + t().__debugTypeToString(); }).join(", ");
|
|
48881
|
+
case 5 /* Merged */:
|
|
48882
|
+
case 4 /* Composite */: return "m1: " + this.mapper1.__debugToString().split("\n").join("\n ") + "\nm2: " + this.mapper2.__debugToString().split("\n").join("\n ");
|
|
48883
|
+
default: return ts.Debug.assertNever(this);
|
|
48884
|
+
}
|
|
48885
|
+
};
|
|
48886
|
+
return DebugTypeMapper;
|
|
48887
|
+
}());
|
|
48869
48888
|
var typeCount = 0;
|
|
48870
48889
|
var symbolCount = 0;
|
|
48871
48890
|
var enumCount = 0;
|
|
@@ -49326,10 +49345,23 @@ var ts;
|
|
|
49326
49345
|
var numberOrBigIntType = getUnionType([numberType, bigintType]);
|
|
49327
49346
|
var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
|
|
49328
49347
|
var numericStringType = getTemplateLiteralType(["", ""], [numberType]); // The `${number}` type
|
|
49329
|
-
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
|
|
49330
|
-
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
|
|
49348
|
+
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }, function () { return "(restrictive mapper)"; });
|
|
49349
|
+
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }, function () { return "(permissive mapper)"; });
|
|
49331
49350
|
var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); // `uniqueLiteralType` is a special `never` flagged by union reduction to behave as a literal
|
|
49332
|
-
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }); // replace all type parameters with the unique literal type (disregarding constraints)
|
|
49351
|
+
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)
|
|
49352
|
+
var outofbandVarianceMarkerHandler;
|
|
49353
|
+
var reportUnreliableMapper = makeFunctionTypeMapper(function (t) {
|
|
49354
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
49355
|
+
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true);
|
|
49356
|
+
}
|
|
49357
|
+
return t;
|
|
49358
|
+
}, function () { return "(unmeasurable reporter)"; });
|
|
49359
|
+
var reportUnmeasurableMapper = makeFunctionTypeMapper(function (t) {
|
|
49360
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
49361
|
+
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false);
|
|
49362
|
+
}
|
|
49363
|
+
return t;
|
|
49364
|
+
}, function () { return "(unreliable reporter)"; });
|
|
49333
49365
|
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49334
49366
|
var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49335
49367
|
emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
|
|
@@ -49489,7 +49521,6 @@ var ts;
|
|
|
49489
49521
|
var typeofType = createTypeofType();
|
|
49490
49522
|
var _jsxNamespace;
|
|
49491
49523
|
var _jsxFactoryEntity;
|
|
49492
|
-
var outofbandVarianceMarkerHandler;
|
|
49493
49524
|
var subtypeRelation = new ts.Map();
|
|
49494
49525
|
var strictSubtypeRelation = new ts.Map();
|
|
49495
49526
|
var assignableRelation = new ts.Map();
|
|
@@ -53256,7 +53287,7 @@ var ts;
|
|
|
53256
53287
|
var name = typeParameterToName(newParam, context);
|
|
53257
53288
|
var newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
53258
53289
|
context.approximateLength += 37; // 15 each for two added conditionals, 7 for an added infer type
|
|
53259
|
-
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.
|
|
53290
|
+
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.mapper);
|
|
53260
53291
|
var saveInferTypeParameters_1 = context.inferTypeParameters;
|
|
53261
53292
|
context.inferTypeParameters = type.root.inferTypeParameters;
|
|
53262
53293
|
var extendsTypeNode_1 = typeToTypeNodeHelper(instantiateType(type.root.extendsType, newMapper), context);
|
|
@@ -60667,8 +60698,7 @@ var ts;
|
|
|
60667
60698
|
var _a;
|
|
60668
60699
|
var inferences;
|
|
60669
60700
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
60670
|
-
|
|
60671
|
-
var declaration = _b[_i];
|
|
60701
|
+
var _loop_15 = function (declaration) {
|
|
60672
60702
|
if (declaration.parent.kind === 190 /* InferType */) {
|
|
60673
60703
|
// When an 'infer T' declaration is immediately contained in a type reference node
|
|
60674
60704
|
// (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
|
|
@@ -60676,12 +60706,12 @@ var ts;
|
|
|
60676
60706
|
// present, we form an intersection of the inferred constraint types.
|
|
60677
60707
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
60678
60708
|
if (grandParent.kind === 178 /* TypeReference */ && !omitTypeReferences) {
|
|
60679
|
-
var
|
|
60680
|
-
var
|
|
60681
|
-
if (
|
|
60682
|
-
var index =
|
|
60683
|
-
if (index <
|
|
60684
|
-
var declaredConstraint = getConstraintOfTypeParameter(
|
|
60709
|
+
var typeReference_1 = grandParent;
|
|
60710
|
+
var typeParameters_1 = getTypeParametersForTypeReference(typeReference_1);
|
|
60711
|
+
if (typeParameters_1) {
|
|
60712
|
+
var index = typeReference_1.typeArguments.indexOf(childTypeParameter);
|
|
60713
|
+
if (index < typeParameters_1.length) {
|
|
60714
|
+
var declaredConstraint = getConstraintOfTypeParameter(typeParameters_1[index]);
|
|
60685
60715
|
if (declaredConstraint) {
|
|
60686
60716
|
// Type parameter constraints can reference other type parameters so
|
|
60687
60717
|
// constraints need to be instantiated. If instantiation produces the
|
|
@@ -60689,7 +60719,9 @@ var ts;
|
|
|
60689
60719
|
// type Foo<T extends string, U extends T> = [T, U];
|
|
60690
60720
|
// type Bar<T> = T extends Foo<infer X, infer X> ? Foo<X, X> : T;
|
|
60691
60721
|
// the instantiated constraint for U is X, so we discard that inference.
|
|
60692
|
-
var mapper =
|
|
60722
|
+
var mapper = makeDeferredTypeMapper(typeParameters_1, typeParameters_1.map(function (_, index) { return function () {
|
|
60723
|
+
return getEffectiveTypeArgumentAtIndex(typeReference_1, typeParameters_1, index);
|
|
60724
|
+
}; }));
|
|
60693
60725
|
var constraint = instantiateType(declaredConstraint, mapper);
|
|
60694
60726
|
if (constraint !== typeParameter) {
|
|
60695
60727
|
inferences = ts.append(inferences, constraint);
|
|
@@ -60727,6 +60759,10 @@ var ts;
|
|
|
60727
60759
|
inferences = ts.append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfNode(checkMappedType_1.typeParameter)), checkMappedType_1.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType_1.typeParameter.constraint) : keyofConstraintType)));
|
|
60728
60760
|
}
|
|
60729
60761
|
}
|
|
60762
|
+
};
|
|
60763
|
+
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
60764
|
+
var declaration = _b[_i];
|
|
60765
|
+
_loop_15(declaration);
|
|
60730
60766
|
}
|
|
60731
60767
|
}
|
|
60732
60768
|
return inferences && getIntersectionType(inferences);
|
|
@@ -61615,7 +61651,7 @@ var ts;
|
|
|
61615
61651
|
var lastRequiredIndex = -1;
|
|
61616
61652
|
var firstRestIndex = -1;
|
|
61617
61653
|
var lastOptionalOrRestIndex = -1;
|
|
61618
|
-
var
|
|
61654
|
+
var _loop_16 = function (i) {
|
|
61619
61655
|
var type = elementTypes[i];
|
|
61620
61656
|
var flags = target.elementFlags[i];
|
|
61621
61657
|
if (flags & 8 /* Variadic */) {
|
|
@@ -61645,7 +61681,7 @@ var ts;
|
|
|
61645
61681
|
}
|
|
61646
61682
|
};
|
|
61647
61683
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
61648
|
-
var state_4 =
|
|
61684
|
+
var state_4 = _loop_16(i);
|
|
61649
61685
|
if (typeof state_4 === "object")
|
|
61650
61686
|
return state_4.value;
|
|
61651
61687
|
}
|
|
@@ -61841,7 +61877,7 @@ var ts;
|
|
|
61841
61877
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
61842
61878
|
if (templates.length) {
|
|
61843
61879
|
var i = types.length;
|
|
61844
|
-
var
|
|
61880
|
+
var _loop_17 = function () {
|
|
61845
61881
|
i--;
|
|
61846
61882
|
var t = types[i];
|
|
61847
61883
|
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -61849,7 +61885,7 @@ var ts;
|
|
|
61849
61885
|
}
|
|
61850
61886
|
};
|
|
61851
61887
|
while (i > 0) {
|
|
61852
|
-
|
|
61888
|
+
_loop_17();
|
|
61853
61889
|
}
|
|
61854
61890
|
}
|
|
61855
61891
|
}
|
|
@@ -61926,14 +61962,14 @@ var ts;
|
|
|
61926
61962
|
var namedUnions = [];
|
|
61927
61963
|
addNamedUnions(namedUnions, types);
|
|
61928
61964
|
var reducedTypes = [];
|
|
61929
|
-
var
|
|
61965
|
+
var _loop_18 = function (t) {
|
|
61930
61966
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
61931
61967
|
reducedTypes.push(t);
|
|
61932
61968
|
}
|
|
61933
61969
|
};
|
|
61934
61970
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
61935
61971
|
var t = typeSet_1[_i];
|
|
61936
|
-
|
|
61972
|
+
_loop_18(t);
|
|
61937
61973
|
}
|
|
61938
61974
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
61939
61975
|
return namedUnions[0];
|
|
@@ -63157,7 +63193,7 @@ var ts;
|
|
|
63157
63193
|
var result;
|
|
63158
63194
|
var extraTypes;
|
|
63159
63195
|
var tailCount = 0;
|
|
63160
|
-
var
|
|
63196
|
+
var _loop_19 = function () {
|
|
63161
63197
|
if (tailCount === 1000) {
|
|
63162
63198
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
63163
63199
|
result = errorType;
|
|
@@ -63278,7 +63314,7 @@ var ts;
|
|
|
63278
63314
|
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
63279
63315
|
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
63280
63316
|
while (true) {
|
|
63281
|
-
var state_5 =
|
|
63317
|
+
var state_5 = _loop_19();
|
|
63282
63318
|
if (typeof state_5 === "object")
|
|
63283
63319
|
return state_5.value;
|
|
63284
63320
|
if (state_5 === "break")
|
|
@@ -63908,7 +63944,7 @@ var ts;
|
|
|
63908
63944
|
switch (mapper.kind) {
|
|
63909
63945
|
case 0 /* Simple */:
|
|
63910
63946
|
return type === mapper.source ? mapper.target : type;
|
|
63911
|
-
case 1 /* Array */:
|
|
63947
|
+
case 1 /* Array */: {
|
|
63912
63948
|
var sources = mapper.sources;
|
|
63913
63949
|
var targets = mapper.targets;
|
|
63914
63950
|
for (var i = 0; i < sources.length; i++) {
|
|
@@ -63917,25 +63953,45 @@ var ts;
|
|
|
63917
63953
|
}
|
|
63918
63954
|
}
|
|
63919
63955
|
return type;
|
|
63920
|
-
|
|
63956
|
+
}
|
|
63957
|
+
case 2 /* Deferred */: {
|
|
63958
|
+
var sources = mapper.sources;
|
|
63959
|
+
var targets = mapper.targets;
|
|
63960
|
+
for (var i = 0; i < sources.length; i++) {
|
|
63961
|
+
if (type === sources[i]) {
|
|
63962
|
+
return targets[i]();
|
|
63963
|
+
}
|
|
63964
|
+
}
|
|
63965
|
+
return type;
|
|
63966
|
+
}
|
|
63967
|
+
case 3 /* Function */:
|
|
63921
63968
|
return mapper.func(type);
|
|
63922
|
-
case
|
|
63923
|
-
case
|
|
63969
|
+
case 4 /* Composite */:
|
|
63970
|
+
case 5 /* Merged */:
|
|
63924
63971
|
var t1 = getMappedType(type, mapper.mapper1);
|
|
63925
|
-
return t1 !== type && mapper.kind ===
|
|
63972
|
+
return t1 !== type && mapper.kind === 4 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2);
|
|
63926
63973
|
}
|
|
63927
63974
|
}
|
|
63975
|
+
function attachDebugPrototypeIfDebug(mapper) {
|
|
63976
|
+
if (ts.Debug.isDebugging) {
|
|
63977
|
+
return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype);
|
|
63978
|
+
}
|
|
63979
|
+
return mapper;
|
|
63980
|
+
}
|
|
63928
63981
|
function makeUnaryTypeMapper(source, target) {
|
|
63929
|
-
return { kind: 0 /* Simple */, source: source, target: target };
|
|
63982
|
+
return attachDebugPrototypeIfDebug({ kind: 0 /* Simple */, source: source, target: target });
|
|
63930
63983
|
}
|
|
63931
63984
|
function makeArrayTypeMapper(sources, targets) {
|
|
63932
|
-
return { kind: 1 /* Array */, sources: sources, targets: targets };
|
|
63985
|
+
return attachDebugPrototypeIfDebug({ kind: 1 /* Array */, sources: sources, targets: targets });
|
|
63933
63986
|
}
|
|
63934
|
-
function makeFunctionTypeMapper(func) {
|
|
63935
|
-
return { kind:
|
|
63987
|
+
function makeFunctionTypeMapper(func, debugInfo) {
|
|
63988
|
+
return attachDebugPrototypeIfDebug({ kind: 3 /* Function */, func: func, debugInfo: ts.Debug.isDebugging ? debugInfo : undefined });
|
|
63989
|
+
}
|
|
63990
|
+
function makeDeferredTypeMapper(sources, targets) {
|
|
63991
|
+
return attachDebugPrototypeIfDebug({ kind: 2 /* Deferred */, sources: sources, targets: targets });
|
|
63936
63992
|
}
|
|
63937
63993
|
function makeCompositeTypeMapper(kind, mapper1, mapper2) {
|
|
63938
|
-
return { kind: kind, mapper1: mapper1, mapper2: mapper2 };
|
|
63994
|
+
return attachDebugPrototypeIfDebug({ kind: kind, mapper1: mapper1, mapper2: mapper2 });
|
|
63939
63995
|
}
|
|
63940
63996
|
function createTypeEraser(sources) {
|
|
63941
63997
|
return createTypeMapper(sources, /*targets*/ undefined);
|
|
@@ -63945,19 +64001,20 @@ var ts;
|
|
|
63945
64001
|
* This is used during inference when instantiating type parameter defaults.
|
|
63946
64002
|
*/
|
|
63947
64003
|
function createBackreferenceMapper(context, index) {
|
|
63948
|
-
|
|
64004
|
+
var forwardInferences = context.inferences.slice(index);
|
|
64005
|
+
return createTypeMapper(ts.map(forwardInferences, function (i) { return i.typeParameter; }), ts.map(forwardInferences, function () { return unknownType; }));
|
|
63949
64006
|
}
|
|
63950
64007
|
function combineTypeMappers(mapper1, mapper2) {
|
|
63951
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
64008
|
+
return mapper1 ? makeCompositeTypeMapper(4 /* Composite */, mapper1, mapper2) : mapper2;
|
|
63952
64009
|
}
|
|
63953
64010
|
function mergeTypeMappers(mapper1, mapper2) {
|
|
63954
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
64011
|
+
return mapper1 ? makeCompositeTypeMapper(5 /* Merged */, mapper1, mapper2) : mapper2;
|
|
63955
64012
|
}
|
|
63956
64013
|
function prependTypeMapping(source, target, mapper) {
|
|
63957
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
64014
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, makeUnaryTypeMapper(source, target), mapper);
|
|
63958
64015
|
}
|
|
63959
64016
|
function appendTypeMapping(mapper, source, target) {
|
|
63960
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
64017
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5 /* Merged */, mapper, makeUnaryTypeMapper(source, target));
|
|
63961
64018
|
}
|
|
63962
64019
|
function getRestrictiveTypeParameter(tp) {
|
|
63963
64020
|
return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol),
|
|
@@ -65853,7 +65910,7 @@ var ts;
|
|
|
65853
65910
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
65854
65911
|
checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
|
|
65855
65912
|
}
|
|
65856
|
-
var
|
|
65913
|
+
var _loop_20 = function (prop) {
|
|
65857
65914
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
65858
65915
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
65859
65916
|
if (reportErrors) {
|
|
@@ -65916,7 +65973,7 @@ var ts;
|
|
|
65916
65973
|
};
|
|
65917
65974
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
65918
65975
|
var prop = _b[_i];
|
|
65919
|
-
var state_6 =
|
|
65976
|
+
var state_6 = _loop_20(prop);
|
|
65920
65977
|
if (typeof state_6 === "object")
|
|
65921
65978
|
return state_6.value;
|
|
65922
65979
|
}
|
|
@@ -66148,10 +66205,10 @@ var ts;
|
|
|
66148
66205
|
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
|
|
66149
66206
|
var saved = entry & 24 /* ReportsMask */;
|
|
66150
66207
|
if (saved & 8 /* ReportsUnmeasurable */) {
|
|
66151
|
-
instantiateType(source,
|
|
66208
|
+
instantiateType(source, reportUnmeasurableMapper);
|
|
66152
66209
|
}
|
|
66153
66210
|
if (saved & 16 /* ReportsUnreliable */) {
|
|
66154
|
-
instantiateType(source,
|
|
66211
|
+
instantiateType(source, reportUnreliableMapper);
|
|
66155
66212
|
}
|
|
66156
66213
|
}
|
|
66157
66214
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
@@ -66577,7 +66634,7 @@ var ts;
|
|
|
66577
66634
|
}
|
|
66578
66635
|
// Report unreliable variance for type variables referenced in template literal type placeholders.
|
|
66579
66636
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
66580
|
-
instantiateType(source,
|
|
66637
|
+
instantiateType(source, reportUnreliableMapper);
|
|
66581
66638
|
}
|
|
66582
66639
|
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
66583
66640
|
return -1 /* True */;
|
|
@@ -66849,18 +66906,6 @@ var ts;
|
|
|
66849
66906
|
}
|
|
66850
66907
|
}
|
|
66851
66908
|
}
|
|
66852
|
-
function reportUnmeasurableMarkers(p) {
|
|
66853
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
66854
|
-
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false);
|
|
66855
|
-
}
|
|
66856
|
-
return p;
|
|
66857
|
-
}
|
|
66858
|
-
function reportUnreliableMarkers(p) {
|
|
66859
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
66860
|
-
outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true);
|
|
66861
|
-
}
|
|
66862
|
-
return p;
|
|
66863
|
-
}
|
|
66864
66909
|
// A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is
|
|
66865
66910
|
// related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice
|
|
66866
66911
|
// that S and T are contra-variant whereas X and Y are co-variant.
|
|
@@ -66870,7 +66915,7 @@ var ts;
|
|
|
66870
66915
|
if (modifiersRelated) {
|
|
66871
66916
|
var result_10;
|
|
66872
66917
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
66873
|
-
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source),
|
|
66918
|
+
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
|
|
66874
66919
|
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
66875
66920
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
66876
66921
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
@@ -66924,11 +66969,11 @@ var ts;
|
|
|
66924
66969
|
// constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
|
|
66925
66970
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
66926
66971
|
var matchingTypes = [];
|
|
66927
|
-
var
|
|
66972
|
+
var _loop_21 = function (combination) {
|
|
66928
66973
|
var hasMatch = false;
|
|
66929
66974
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
66930
66975
|
var type = _d[_c];
|
|
66931
|
-
var
|
|
66976
|
+
var _loop_22 = function (i) {
|
|
66932
66977
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
66933
66978
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
66934
66979
|
if (!targetProperty)
|
|
@@ -66944,7 +66989,7 @@ var ts;
|
|
|
66944
66989
|
}
|
|
66945
66990
|
};
|
|
66946
66991
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
66947
|
-
var state_8 =
|
|
66992
|
+
var state_8 = _loop_22(i);
|
|
66948
66993
|
switch (state_8) {
|
|
66949
66994
|
case "continue-outer": continue outer;
|
|
66950
66995
|
}
|
|
@@ -66958,7 +67003,7 @@ var ts;
|
|
|
66958
67003
|
};
|
|
66959
67004
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
66960
67005
|
var combination = discriminantCombinations_1[_a];
|
|
66961
|
-
var state_7 =
|
|
67006
|
+
var state_7 = _loop_21(combination);
|
|
66962
67007
|
if (typeof state_7 === "object")
|
|
66963
67008
|
return state_7.value;
|
|
66964
67009
|
}
|
|
@@ -67406,7 +67451,7 @@ var ts;
|
|
|
67406
67451
|
* See signatureAssignableTo, compareSignaturesIdentical
|
|
67407
67452
|
*/
|
|
67408
67453
|
function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
|
|
67409
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker,
|
|
67454
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper);
|
|
67410
67455
|
}
|
|
67411
67456
|
function signaturesIdenticalTo(source, target, kind) {
|
|
67412
67457
|
var sourceSignatures = getSignaturesOfType(source, kind);
|
|
@@ -67665,7 +67710,7 @@ var ts;
|
|
|
67665
67710
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
67666
67711
|
links.variances = ts.emptyArray;
|
|
67667
67712
|
var variances = [];
|
|
67668
|
-
var
|
|
67713
|
+
var _loop_23 = function (tp) {
|
|
67669
67714
|
var modifiers = getVarianceModifiers(tp);
|
|
67670
67715
|
var variance = modifiers & 65536 /* Out */ ?
|
|
67671
67716
|
modifiers & 32768 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ :
|
|
@@ -67701,9 +67746,9 @@ var ts;
|
|
|
67701
67746
|
}
|
|
67702
67747
|
variances.push(variance);
|
|
67703
67748
|
};
|
|
67704
|
-
for (var _i = 0,
|
|
67705
|
-
var tp =
|
|
67706
|
-
|
|
67749
|
+
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
67750
|
+
var tp = typeParameters_2[_i];
|
|
67751
|
+
_loop_23(tp);
|
|
67707
67752
|
}
|
|
67708
67753
|
links.variances = variances;
|
|
67709
67754
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -68698,27 +68743,29 @@ var ts;
|
|
|
68698
68743
|
signature: signature,
|
|
68699
68744
|
flags: flags,
|
|
68700
68745
|
compareTypes: compareTypes,
|
|
68701
|
-
mapper:
|
|
68702
|
-
nonFixingMapper:
|
|
68746
|
+
mapper: reportUnmeasurableMapper,
|
|
68747
|
+
nonFixingMapper: reportUnmeasurableMapper,
|
|
68703
68748
|
};
|
|
68749
|
+
context.mapper = makeFixingMapperForContext(context);
|
|
68750
|
+
context.nonFixingMapper = makeNonFixingMapperForContext(context);
|
|
68704
68751
|
return context;
|
|
68705
68752
|
}
|
|
68706
|
-
function
|
|
68707
|
-
|
|
68708
|
-
|
|
68709
|
-
|
|
68710
|
-
|
|
68711
|
-
|
|
68712
|
-
|
|
68713
|
-
|
|
68714
|
-
inferFromIntraExpressionSites(context);
|
|
68715
|
-
clearCachedInferences(inferences);
|
|
68716
|
-
inference.isFixed = true;
|
|
68717
|
-
}
|
|
68718
|
-
return getInferredType(context, i);
|
|
68753
|
+
function makeFixingMapperForContext(context) {
|
|
68754
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (inference, i) { return function () {
|
|
68755
|
+
if (!inference.isFixed) {
|
|
68756
|
+
// Before we commit to a particular inference (and thus lock out any further inferences),
|
|
68757
|
+
// we infer from any intra-expression inference sites we have collected.
|
|
68758
|
+
inferFromIntraExpressionSites(context);
|
|
68759
|
+
clearCachedInferences(context.inferences);
|
|
68760
|
+
inference.isFixed = true;
|
|
68719
68761
|
}
|
|
68720
|
-
|
|
68721
|
-
|
|
68762
|
+
return getInferredType(context, i);
|
|
68763
|
+
}; }));
|
|
68764
|
+
}
|
|
68765
|
+
function makeNonFixingMapperForContext(context) {
|
|
68766
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (_, i) { return function () {
|
|
68767
|
+
return getInferredType(context, i);
|
|
68768
|
+
}; }));
|
|
68722
68769
|
}
|
|
68723
68770
|
function clearCachedInferences(inferences) {
|
|
68724
68771
|
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
|
|
@@ -69638,7 +69685,7 @@ var ts;
|
|
|
69638
69685
|
// upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
|
|
69639
69686
|
// succeed. That would be a pointless and confusing outcome.
|
|
69640
69687
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
69641
|
-
var
|
|
69688
|
+
var _loop_24 = function (i) {
|
|
69642
69689
|
var source_1 = matches ? matches[i] : neverType;
|
|
69643
69690
|
var target_3 = types[i];
|
|
69644
69691
|
// If we are inferring from a string literal type to a type variable whose constraint includes one of the
|
|
@@ -69688,7 +69735,7 @@ var ts;
|
|
|
69688
69735
|
inferFromTypes(source_1, target_3);
|
|
69689
69736
|
};
|
|
69690
69737
|
for (var i = 0; i < types.length; i++) {
|
|
69691
|
-
|
|
69738
|
+
_loop_24(i);
|
|
69692
69739
|
}
|
|
69693
69740
|
}
|
|
69694
69741
|
}
|
|
@@ -70206,7 +70253,7 @@ var ts;
|
|
|
70206
70253
|
function mapTypesByKeyProperty(types, name) {
|
|
70207
70254
|
var map = new ts.Map();
|
|
70208
70255
|
var count = 0;
|
|
70209
|
-
var
|
|
70256
|
+
var _loop_25 = function (type) {
|
|
70210
70257
|
if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
70211
70258
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
70212
70259
|
if (discriminant) {
|
|
@@ -70232,7 +70279,7 @@ var ts;
|
|
|
70232
70279
|
};
|
|
70233
70280
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
70234
70281
|
var type = types_15[_i];
|
|
70235
|
-
var state_9 =
|
|
70282
|
+
var state_9 = _loop_25(type);
|
|
70236
70283
|
if (typeof state_9 === "object")
|
|
70237
70284
|
return state_9.value;
|
|
70238
70285
|
}
|
|
@@ -76581,7 +76628,7 @@ var ts;
|
|
|
76581
76628
|
if (spreadIndex >= 0) {
|
|
76582
76629
|
// Create synthetic arguments from spreads of tuple types.
|
|
76583
76630
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
76584
|
-
var
|
|
76631
|
+
var _loop_26 = function (i) {
|
|
76585
76632
|
var arg = args[i];
|
|
76586
76633
|
// We can call checkExpressionCached because spread expressions never have a contextual type.
|
|
76587
76634
|
var spreadType = arg.kind === 225 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
@@ -76598,7 +76645,7 @@ var ts;
|
|
|
76598
76645
|
}
|
|
76599
76646
|
};
|
|
76600
76647
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
76601
|
-
|
|
76648
|
+
_loop_26(i);
|
|
76602
76649
|
}
|
|
76603
76650
|
return effectiveArgs_1;
|
|
76604
76651
|
}
|
|
@@ -76927,7 +76974,7 @@ var ts;
|
|
|
76927
76974
|
var min_3 = Number.MAX_VALUE;
|
|
76928
76975
|
var minIndex = 0;
|
|
76929
76976
|
var i_1 = 0;
|
|
76930
|
-
var
|
|
76977
|
+
var _loop_27 = function (c) {
|
|
76931
76978
|
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)); };
|
|
76932
76979
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
|
|
76933
76980
|
if (diags_2) {
|
|
@@ -76945,7 +76992,7 @@ var ts;
|
|
|
76945
76992
|
};
|
|
76946
76993
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
76947
76994
|
var c = candidatesForArgumentError_1[_a];
|
|
76948
|
-
|
|
76995
|
+
_loop_27(c);
|
|
76949
76996
|
}
|
|
76950
76997
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
76951
76998
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -77103,7 +77150,7 @@ var ts;
|
|
|
77103
77150
|
}
|
|
77104
77151
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
77105
77152
|
var parameters = [];
|
|
77106
|
-
var
|
|
77153
|
+
var _loop_28 = function (i) {
|
|
77107
77154
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
77108
77155
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
77109
77156
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -77111,7 +77158,7 @@ var ts;
|
|
|
77111
77158
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
77112
77159
|
};
|
|
77113
77160
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
77114
|
-
|
|
77161
|
+
_loop_28(i);
|
|
77115
77162
|
}
|
|
77116
77163
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
77117
77164
|
var flags = 0 /* None */;
|
|
@@ -80464,8 +80511,8 @@ var ts;
|
|
|
80464
80511
|
var result = [];
|
|
80465
80512
|
var oldTypeParameters;
|
|
80466
80513
|
var newTypeParameters;
|
|
80467
|
-
for (var _i = 0,
|
|
80468
|
-
var tp =
|
|
80514
|
+
for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) {
|
|
80515
|
+
var tp = typeParameters_3[_i];
|
|
80469
80516
|
var name = tp.symbol.escapedName;
|
|
80470
80517
|
if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) {
|
|
80471
80518
|
var newName = getUniqueTypeParameterName(ts.concatenate(context.inferredTypeParameters, result), name);
|
|
@@ -81144,7 +81191,7 @@ var ts;
|
|
|
81144
81191
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
81145
81192
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
81146
81193
|
var indexSignatureMap_1 = new ts.Map();
|
|
81147
|
-
var
|
|
81194
|
+
var _loop_29 = function (declaration) {
|
|
81148
81195
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
81149
81196
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
81150
81197
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -81159,7 +81206,7 @@ var ts;
|
|
|
81159
81206
|
};
|
|
81160
81207
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
81161
81208
|
var declaration = _a[_i];
|
|
81162
|
-
|
|
81209
|
+
_loop_29(declaration);
|
|
81163
81210
|
}
|
|
81164
81211
|
indexSignatureMap_1.forEach(function (entry) {
|
|
81165
81212
|
if (entry.declarations.length > 1) {
|
|
@@ -81382,6 +81429,12 @@ var ts;
|
|
|
81382
81429
|
function checkMissingDeclaration(node) {
|
|
81383
81430
|
checkDecorators(node);
|
|
81384
81431
|
}
|
|
81432
|
+
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
81433
|
+
if (index < typeParameters.length) {
|
|
81434
|
+
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
81435
|
+
}
|
|
81436
|
+
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
81437
|
+
}
|
|
81385
81438
|
function getEffectiveTypeArguments(node, typeParameters) {
|
|
81386
81439
|
return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(node));
|
|
81387
81440
|
}
|
|
@@ -82849,8 +82902,8 @@ var ts;
|
|
|
82849
82902
|
return;
|
|
82850
82903
|
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
|
|
82851
82904
|
var seenParentsWithEveryUnused = new ts.Set();
|
|
82852
|
-
for (var _i = 0,
|
|
82853
|
-
var typeParameter =
|
|
82905
|
+
for (var _i = 0, typeParameters_4 = typeParameters; _i < typeParameters_4.length; _i++) {
|
|
82906
|
+
var typeParameter = typeParameters_4[_i];
|
|
82854
82907
|
if (!isTypeParameterUnused(typeParameter))
|
|
82855
82908
|
continue;
|
|
82856
82909
|
var name = ts.idText(typeParameter.name);
|
|
@@ -84669,7 +84722,7 @@ var ts;
|
|
|
84669
84722
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 258 /* InterfaceDeclaration */) : undefined;
|
|
84670
84723
|
var localPropDeclaration = declaration && declaration.kind === 221 /* BinaryExpression */ ||
|
|
84671
84724
|
name && name.kind === 162 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
84672
|
-
var
|
|
84725
|
+
var _loop_30 = function (info) {
|
|
84673
84726
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
84674
84727
|
// We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
|
|
84675
84728
|
// in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
|
|
@@ -84682,7 +84735,7 @@ var ts;
|
|
|
84682
84735
|
};
|
|
84683
84736
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
84684
84737
|
var info = indexInfos_9[_i];
|
|
84685
|
-
|
|
84738
|
+
_loop_30(info);
|
|
84686
84739
|
}
|
|
84687
84740
|
}
|
|
84688
84741
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -84690,7 +84743,7 @@ var ts;
|
|
|
84690
84743
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
84691
84744
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 258 /* InterfaceDeclaration */) : undefined;
|
|
84692
84745
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
84693
|
-
var
|
|
84746
|
+
var _loop_31 = function (info) {
|
|
84694
84747
|
if (info === checkInfo)
|
|
84695
84748
|
return "continue";
|
|
84696
84749
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -84705,7 +84758,7 @@ var ts;
|
|
|
84705
84758
|
};
|
|
84706
84759
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
84707
84760
|
var info = indexInfos_10[_i];
|
|
84708
|
-
|
|
84761
|
+
_loop_31(info);
|
|
84709
84762
|
}
|
|
84710
84763
|
}
|
|
84711
84764
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -85025,7 +85078,7 @@ var ts;
|
|
|
85025
85078
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
85026
85079
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
85027
85080
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
85028
|
-
var
|
|
85081
|
+
var _loop_32 = function (member) {
|
|
85029
85082
|
if (ts.hasAmbientModifier(member)) {
|
|
85030
85083
|
return "continue";
|
|
85031
85084
|
}
|
|
@@ -85042,7 +85095,7 @@ var ts;
|
|
|
85042
85095
|
};
|
|
85043
85096
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85044
85097
|
var member = _a[_i];
|
|
85045
|
-
|
|
85098
|
+
_loop_32(member);
|
|
85046
85099
|
}
|
|
85047
85100
|
}
|
|
85048
85101
|
/**
|
|
@@ -85130,7 +85183,7 @@ var ts;
|
|
|
85130
85183
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
85131
85184
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
85132
85185
|
var issuedMemberError = false;
|
|
85133
|
-
var
|
|
85186
|
+
var _loop_33 = function (member) {
|
|
85134
85187
|
if (ts.isStatic(member)) {
|
|
85135
85188
|
return "continue";
|
|
85136
85189
|
}
|
|
@@ -85149,7 +85202,7 @@ var ts;
|
|
|
85149
85202
|
};
|
|
85150
85203
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85151
85204
|
var member = _a[_i];
|
|
85152
|
-
|
|
85205
|
+
_loop_33(member);
|
|
85153
85206
|
}
|
|
85154
85207
|
if (!issuedMemberError) {
|
|
85155
85208
|
// check again with diagnostics to generate a less-specific error
|
|
@@ -85220,7 +85273,7 @@ var ts;
|
|
|
85220
85273
|
var _a, _b, _c, _d;
|
|
85221
85274
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
85222
85275
|
var baseProperties = getPropertiesOfType(baseType);
|
|
85223
|
-
var
|
|
85276
|
+
var _loop_34 = function (baseProperty) {
|
|
85224
85277
|
var base = getTargetSymbol(baseProperty);
|
|
85225
85278
|
if (base.flags & 4194304 /* Prototype */) {
|
|
85226
85279
|
return "continue";
|
|
@@ -85330,7 +85383,7 @@ var ts;
|
|
|
85330
85383
|
};
|
|
85331
85384
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
85332
85385
|
var baseProperty = baseProperties_1[_i];
|
|
85333
|
-
var state_10 =
|
|
85386
|
+
var state_10 = _loop_34(baseProperty);
|
|
85334
85387
|
switch (state_10) {
|
|
85335
85388
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
85336
85389
|
}
|
|
@@ -111845,7 +111898,6 @@ var ts;
|
|
|
111845
111898
|
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
|
111846
111899
|
// Update the output signature
|
|
111847
111900
|
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, createHash, changedDtsData);
|
|
111848
|
-
newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
|
|
111849
111901
|
}
|
|
111850
111902
|
// Update sourceFileInfo
|
|
111851
111903
|
var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
|
|
@@ -121232,7 +121284,7 @@ var ts;
|
|
|
121232
121284
|
state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
|
|
121233
121285
|
}
|
|
121234
121286
|
state.changedFilesSet = new ts.Set();
|
|
121235
|
-
state.
|
|
121287
|
+
state.latestChangedDtsFile = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.latestChangedDtsFile : undefined;
|
|
121236
121288
|
var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
|
|
121237
121289
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
121238
121290
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
@@ -121356,7 +121408,7 @@ var ts;
|
|
|
121356
121408
|
programEmitComplete: state.programEmitComplete,
|
|
121357
121409
|
emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
|
|
121358
121410
|
outSignature: state.outSignature,
|
|
121359
|
-
|
|
121411
|
+
latestChangedDtsFile: state.latestChangedDtsFile,
|
|
121360
121412
|
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
|
121361
121413
|
changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
|
|
121362
121414
|
};
|
|
@@ -121369,7 +121421,7 @@ var ts;
|
|
|
121369
121421
|
state.programEmitComplete = savedEmitState.programEmitComplete;
|
|
121370
121422
|
state.emitSignatures = savedEmitState.emitSignatures;
|
|
121371
121423
|
state.outSignature = savedEmitState.outSignature;
|
|
121372
|
-
state.
|
|
121424
|
+
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
|
121373
121425
|
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
|
121374
121426
|
if (savedEmitState.changedFilesSet)
|
|
121375
121427
|
state.changedFilesSet = savedEmitState.changedFilesSet;
|
|
@@ -121683,14 +121735,14 @@ var ts;
|
|
|
121683
121735
|
/**
|
|
121684
121736
|
* Gets the program information to be emitted in buildInfo so that we can use it to create new program
|
|
121685
121737
|
*/
|
|
121686
|
-
function getProgramBuildInfo(state, getCanonicalFileName
|
|
121738
|
+
function getProgramBuildInfo(state, getCanonicalFileName) {
|
|
121687
121739
|
var outFilePath = ts.outFile(state.compilerOptions);
|
|
121688
121740
|
if (outFilePath && !state.compilerOptions.composite)
|
|
121689
121741
|
return;
|
|
121690
121742
|
var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
|
|
121691
121743
|
var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
121692
|
-
//
|
|
121693
|
-
|
|
121744
|
+
// 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
|
|
121745
|
+
var latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : undefined;
|
|
121694
121746
|
if (outFilePath) {
|
|
121695
121747
|
var fileNames_1 = [];
|
|
121696
121748
|
var fileInfos_1 = [];
|
|
@@ -121706,7 +121758,7 @@ var ts;
|
|
|
121706
121758
|
fileInfos: fileInfos_1,
|
|
121707
121759
|
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
|
|
121708
121760
|
outSignature: state.outSignature,
|
|
121709
|
-
|
|
121761
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
121710
121762
|
};
|
|
121711
121763
|
return result_15;
|
|
121712
121764
|
}
|
|
@@ -121808,7 +121860,7 @@ var ts;
|
|
|
121808
121860
|
affectedFilesPendingEmit: affectedFilesPendingEmit,
|
|
121809
121861
|
changeFileSet: changeFileSet,
|
|
121810
121862
|
emitSignatures: emitSignatures,
|
|
121811
|
-
|
|
121863
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
121812
121864
|
};
|
|
121813
121865
|
return result;
|
|
121814
121866
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
@@ -121976,7 +122028,7 @@ var ts;
|
|
|
121976
122028
|
*/
|
|
121977
122029
|
var computeHash = ts.maybeBind(host, host.createHash);
|
|
121978
122030
|
var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
|
121979
|
-
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName
|
|
122031
|
+
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
|
|
121980
122032
|
// To ensure that we arent storing any references to old program or new program without state
|
|
121981
122033
|
newProgram = undefined; // TODO: GH#18217
|
|
121982
122034
|
oldProgram = undefined;
|
|
@@ -121986,6 +122038,7 @@ var ts;
|
|
|
121986
122038
|
builderProgram.getState = getState;
|
|
121987
122039
|
builderProgram.saveEmitState = function () { return backupBuilderProgramEmitState(state); };
|
|
121988
122040
|
builderProgram.restoreEmitState = function (saved) { return restoreBuilderProgramEmitState(state, saved); };
|
|
122041
|
+
builderProgram.hasChangedEmitSignature = function () { return !!state.hasChangedEmitSignature; };
|
|
121989
122042
|
builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
|
|
121990
122043
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
121991
122044
|
builderProgram.emit = emit;
|
|
@@ -122093,18 +122146,22 @@ var ts;
|
|
|
122093
122146
|
var filePath = sourceFiles[0].resolvedPath;
|
|
122094
122147
|
var oldSignature = (_f = state.emitSignatures) === null || _f === void 0 ? void 0 : _f.get(filePath);
|
|
122095
122148
|
emitSignature !== null && emitSignature !== void 0 ? emitSignature : (emitSignature = computeSignature(text, computeHash, data));
|
|
122096
|
-
if
|
|
122097
|
-
|
|
122098
|
-
|
|
122099
|
-
|
|
122149
|
+
// Dont write dts files if they didn't change
|
|
122150
|
+
if (emitSignature === oldSignature)
|
|
122151
|
+
return;
|
|
122152
|
+
((_g = state.emitSignatures) !== null && _g !== void 0 ? _g : (state.emitSignatures = new ts.Map())).set(filePath, emitSignature);
|
|
122153
|
+
state.hasChangedEmitSignature = true;
|
|
122154
|
+
state.latestChangedDtsFile = fileName;
|
|
122100
122155
|
}
|
|
122101
122156
|
}
|
|
122102
122157
|
else if (state.compilerOptions.composite) {
|
|
122103
122158
|
var newSignature = computeSignature(text, computeHash, data);
|
|
122104
|
-
if
|
|
122105
|
-
|
|
122106
|
-
|
|
122107
|
-
|
|
122159
|
+
// Dont write dts files if they didn't change
|
|
122160
|
+
if (newSignature === state.outSignature)
|
|
122161
|
+
return;
|
|
122162
|
+
state.outSignature = newSignature;
|
|
122163
|
+
state.hasChangedEmitSignature = true;
|
|
122164
|
+
state.latestChangedDtsFile = fileName;
|
|
122108
122165
|
}
|
|
122109
122166
|
}
|
|
122110
122167
|
if (writeFile)
|
|
@@ -122267,11 +122324,12 @@ var ts;
|
|
|
122267
122324
|
var state;
|
|
122268
122325
|
var filePaths;
|
|
122269
122326
|
var filePathsSetList;
|
|
122327
|
+
var latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : undefined;
|
|
122270
122328
|
if (isProgramBundleEmitBuildInfo(program)) {
|
|
122271
122329
|
state = {
|
|
122272
122330
|
fileInfos: new ts.Map(),
|
|
122273
122331
|
compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
|
|
122274
|
-
|
|
122332
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
122275
122333
|
outSignature: program.outSignature,
|
|
122276
122334
|
};
|
|
122277
122335
|
}
|
|
@@ -122304,7 +122362,7 @@ var ts;
|
|
|
122304
122362
|
affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
|
|
122305
122363
|
affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
|
|
122306
122364
|
changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
|
|
122307
|
-
|
|
122365
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
122308
122366
|
emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
|
|
122309
122367
|
};
|
|
122310
122368
|
}
|
|
@@ -122331,6 +122389,7 @@ var ts;
|
|
|
122331
122389
|
getSemanticDiagnosticsOfNextAffectedFile: ts.notImplemented,
|
|
122332
122390
|
emitBuildInfo: ts.notImplemented,
|
|
122333
122391
|
close: ts.noop,
|
|
122392
|
+
hasChangedEmitSignature: ts.returnFalse,
|
|
122334
122393
|
};
|
|
122335
122394
|
function toPath(path) {
|
|
122336
122395
|
return ts.toPath(path, buildInfoDirectory, getCanonicalFileName);
|
|
@@ -123645,7 +123704,7 @@ var ts;
|
|
|
123645
123704
|
});
|
|
123646
123705
|
// Sort by paths closest to importing file Name directory
|
|
123647
123706
|
var sortedPaths = [];
|
|
123648
|
-
var
|
|
123707
|
+
var _loop_35 = function (directory) {
|
|
123649
123708
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
123650
123709
|
var pathsInDirectory;
|
|
123651
123710
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -123669,7 +123728,7 @@ var ts;
|
|
|
123669
123728
|
};
|
|
123670
123729
|
var out_directory_1;
|
|
123671
123730
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
123672
|
-
var state_11 =
|
|
123731
|
+
var state_11 = _loop_35(directory);
|
|
123673
123732
|
directory = out_directory_1;
|
|
123674
123733
|
if (state_11 === "break")
|
|
123675
123734
|
break;
|
|
@@ -124513,7 +124572,6 @@ var ts;
|
|
|
124513
124572
|
readDirectory: ts.maybeBind(host, host.readDirectory),
|
|
124514
124573
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
124515
124574
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
124516
|
-
now: ts.maybeBind(host, host.now),
|
|
124517
124575
|
};
|
|
124518
124576
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
124519
124577
|
try {
|
|
@@ -124671,7 +124729,6 @@ var ts;
|
|
|
124671
124729
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
124672
124730
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
124673
124731
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
124674
|
-
host.now = ts.maybeBind(system, system.now);
|
|
124675
124732
|
ts.setGetSourceFileAsHashVersioned(host, system);
|
|
124676
124733
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
124677
124734
|
return host;
|
|
@@ -125999,8 +126056,7 @@ var ts;
|
|
|
125999
126056
|
}
|
|
126000
126057
|
// Actual Emit
|
|
126001
126058
|
var host = state.host, compilerHost = state.compilerHost;
|
|
126002
|
-
var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
|
|
126003
|
-
var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
|
|
126059
|
+
var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
|
|
126004
126060
|
var emitterDiagnostics = ts.createDiagnosticCollection();
|
|
126005
126061
|
var emittedOutputs = new ts.Map();
|
|
126006
126062
|
var options = program.getCompilerOptions();
|
|
@@ -126008,17 +126064,11 @@ var ts;
|
|
|
126008
126064
|
var outputTimeStampMap;
|
|
126009
126065
|
var now;
|
|
126010
126066
|
outputFiles.forEach(function (_a) {
|
|
126011
|
-
var _b, _c;
|
|
126012
126067
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
126013
126068
|
var path = toPath(state, name);
|
|
126014
126069
|
emittedOutputs.set(toPath(state, name), name);
|
|
126015
|
-
if (buildInfo)
|
|
126016
|
-
setBuildInfo(state, buildInfo, projectPath, options);
|
|
126017
|
-
// Buildinfo has information on when last dts change time
|
|
126018
|
-
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)) {
|
|
126019
|
-
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
126020
|
-
}
|
|
126021
|
-
}
|
|
126070
|
+
if (buildInfo)
|
|
126071
|
+
setBuildInfo(state, buildInfo, projectPath, options, resultFlags);
|
|
126022
126072
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
126023
126073
|
if (!isIncremental && state.watch) {
|
|
126024
126074
|
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
|
|
@@ -126032,7 +126082,7 @@ var ts;
|
|
|
126032
126082
|
ts.Debug.assert(step === BuildStep.EmitBuildInfo);
|
|
126033
126083
|
var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
126034
126084
|
if (data === null || data === void 0 ? void 0 : data.buildInfo)
|
|
126035
|
-
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
|
|
126085
|
+
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions(), BuildResultFlags.DeclarationOutputUnchanged);
|
|
126036
126086
|
if (writeFileCallback)
|
|
126037
126087
|
writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
126038
126088
|
else
|
|
@@ -126065,7 +126115,6 @@ var ts;
|
|
|
126065
126115
|
state.diagnostics.delete(projectPath);
|
|
126066
126116
|
state.projectStatus.set(projectPath, {
|
|
126067
126117
|
type: ts.UpToDateStatusType.UpToDate,
|
|
126068
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
|
|
126069
126118
|
oldestOutputFileName: oldestOutputFileName
|
|
126070
126119
|
});
|
|
126071
126120
|
afterProgramDone(state, program, config);
|
|
@@ -126107,10 +126156,10 @@ var ts;
|
|
|
126107
126156
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
126108
126157
|
emittedOutputs.set(toPath(state, name), name);
|
|
126109
126158
|
if (buildInfo) {
|
|
126110
|
-
|
|
126111
|
-
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
|
|
126159
|
+
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.outSignature) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) {
|
|
126112
126160
|
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
126113
126161
|
}
|
|
126162
|
+
setBuildInfo(state, buildInfo, projectPath, config.options, resultFlags);
|
|
126114
126163
|
}
|
|
126115
126164
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
126116
126165
|
});
|
|
@@ -126369,15 +126418,23 @@ var ts;
|
|
|
126369
126418
|
state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
|
|
126370
126419
|
return result;
|
|
126371
126420
|
}
|
|
126372
|
-
function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
|
|
126421
|
+
function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) {
|
|
126373
126422
|
var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
|
|
126374
126423
|
var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
|
|
126424
|
+
var modifiedTime = getCurrentTime(state.host);
|
|
126375
126425
|
if (existing) {
|
|
126376
126426
|
existing.buildInfo = buildInfo;
|
|
126377
|
-
existing.modifiedTime =
|
|
126427
|
+
existing.modifiedTime = modifiedTime;
|
|
126428
|
+
if (!(resultFlags & BuildResultFlags.DeclarationOutputUnchanged))
|
|
126429
|
+
existing.latestChangedDtsTime = modifiedTime;
|
|
126378
126430
|
}
|
|
126379
126431
|
else {
|
|
126380
|
-
state.buildInfoCache.set(resolvedConfigPath, {
|
|
126432
|
+
state.buildInfoCache.set(resolvedConfigPath, {
|
|
126433
|
+
path: toPath(state, buildInfoPath),
|
|
126434
|
+
buildInfo: buildInfo,
|
|
126435
|
+
modifiedTime: modifiedTime,
|
|
126436
|
+
latestChangedDtsTime: resultFlags & BuildResultFlags.DeclarationOutputUnchanged ? undefined : modifiedTime,
|
|
126437
|
+
});
|
|
126381
126438
|
}
|
|
126382
126439
|
}
|
|
126383
126440
|
function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
|
|
@@ -126409,7 +126466,7 @@ var ts;
|
|
|
126409
126466
|
}
|
|
126410
126467
|
}
|
|
126411
126468
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
126412
|
-
var _a, _b
|
|
126469
|
+
var _a, _b;
|
|
126413
126470
|
// Container if no files are specified in the project
|
|
126414
126471
|
if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
|
|
126415
126472
|
return {
|
|
@@ -126421,8 +126478,8 @@ var ts;
|
|
|
126421
126478
|
var force = !!state.options.force;
|
|
126422
126479
|
if (project.projectReferences) {
|
|
126423
126480
|
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
|
|
126424
|
-
for (var _i = 0,
|
|
126425
|
-
var ref =
|
|
126481
|
+
for (var _i = 0, _c = project.projectReferences; _i < _c.length; _i++) {
|
|
126482
|
+
var ref = _c[_i];
|
|
126426
126483
|
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
126427
126484
|
var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
|
|
126428
126485
|
var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
|
|
@@ -126462,7 +126519,6 @@ var ts;
|
|
|
126462
126519
|
var buildInfoTime;
|
|
126463
126520
|
var buildInfoProgram;
|
|
126464
126521
|
var buildInfoVersionMap;
|
|
126465
|
-
var newestDeclarationFileContentChangedTime;
|
|
126466
126522
|
if (buildInfoPath) {
|
|
126467
126523
|
var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
126468
126524
|
buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
|
|
@@ -126499,8 +126555,6 @@ var ts;
|
|
|
126499
126555
|
}
|
|
126500
126556
|
oldestOutputFileTime = buildInfoTime;
|
|
126501
126557
|
oldestOutputFileName = buildInfoPath;
|
|
126502
|
-
// Get the last dtsChange time from build info
|
|
126503
|
-
newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
|
|
126504
126558
|
}
|
|
126505
126559
|
// Check input files
|
|
126506
126560
|
var newestInputFileName = undefined;
|
|
@@ -126508,8 +126562,8 @@ var ts;
|
|
|
126508
126562
|
/** 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 */
|
|
126509
126563
|
var pseudoInputUpToDate = false;
|
|
126510
126564
|
// Get timestamps of input files
|
|
126511
|
-
for (var
|
|
126512
|
-
var inputFile =
|
|
126565
|
+
for (var _d = 0, _e = project.fileNames; _d < _e.length; _d++) {
|
|
126566
|
+
var inputFile = _e[_d];
|
|
126513
126567
|
var inputTime = getModifiedTime(state, inputFile);
|
|
126514
126568
|
if (inputTime === ts.missingFileModifiedTime) {
|
|
126515
126569
|
return {
|
|
@@ -126550,8 +126604,8 @@ var ts;
|
|
|
126550
126604
|
// Collect the expected outputs of this project
|
|
126551
126605
|
var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
|
|
126552
126606
|
var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
|
|
126553
|
-
for (var
|
|
126554
|
-
var output = outputs_1[
|
|
126607
|
+
for (var _f = 0, outputs_1 = outputs; _f < outputs_1.length; _f++) {
|
|
126608
|
+
var output = outputs_1[_f];
|
|
126555
126609
|
var path = toPath(state, output);
|
|
126556
126610
|
// Output is missing; can stop checking
|
|
126557
126611
|
var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
|
|
@@ -126589,8 +126643,8 @@ var ts;
|
|
|
126589
126643
|
var usesPrepend = false;
|
|
126590
126644
|
var upstreamChangedProject;
|
|
126591
126645
|
if (referenceStatuses) {
|
|
126592
|
-
for (var
|
|
126593
|
-
var
|
|
126646
|
+
for (var _g = 0, referenceStatuses_1 = referenceStatuses; _g < referenceStatuses_1.length; _g++) {
|
|
126647
|
+
var _h = referenceStatuses_1[_g], ref = _h.ref, refStatus = _h.refStatus, resolvedConfig = _h.resolvedConfig, resolvedRefPath = _h.resolvedRefPath;
|
|
126594
126648
|
usesPrepend = usesPrepend || !!(ref.prepend);
|
|
126595
126649
|
// If the upstream project's newest file is older than our oldest output, we
|
|
126596
126650
|
// can't be out of date because of it
|
|
@@ -126607,7 +126661,8 @@ var ts;
|
|
|
126607
126661
|
}
|
|
126608
126662
|
// If the upstream project has only change .d.ts files, and we've built
|
|
126609
126663
|
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
|
|
126610
|
-
|
|
126664
|
+
var newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath);
|
|
126665
|
+
if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
|
126611
126666
|
pseudoUpToDate = true;
|
|
126612
126667
|
upstreamChangedProject = ref.path;
|
|
126613
126668
|
continue;
|
|
@@ -126650,7 +126705,6 @@ var ts;
|
|
|
126650
126705
|
pseudoInputUpToDate ?
|
|
126651
126706
|
ts.UpToDateStatusType.UpToDateWithInputFileText :
|
|
126652
126707
|
ts.UpToDateStatusType.UpToDate,
|
|
126653
|
-
newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
|
|
126654
126708
|
newestInputFileTime: newestInputFileTime,
|
|
126655
126709
|
newestInputFileName: newestInputFileName,
|
|
126656
126710
|
oldestOutputFileName: oldestOutputFileName
|
|
@@ -126734,13 +126788,17 @@ var ts;
|
|
|
126734
126788
|
outputTimeStampMap.delete(key);
|
|
126735
126789
|
});
|
|
126736
126790
|
}
|
|
126737
|
-
function
|
|
126738
|
-
var _a;
|
|
126791
|
+
function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
126739
126792
|
if (!options.composite)
|
|
126740
126793
|
return undefined;
|
|
126741
|
-
var
|
|
126742
|
-
|
|
126743
|
-
|
|
126794
|
+
var entry = ts.Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
126795
|
+
if (entry.latestChangedDtsTime !== undefined)
|
|
126796
|
+
return entry.latestChangedDtsTime || undefined;
|
|
126797
|
+
var latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ?
|
|
126798
|
+
state.host.getModifiedTime(ts.getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, ts.getDirectoryPath(entry.path))) :
|
|
126799
|
+
undefined;
|
|
126800
|
+
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
126801
|
+
return latestChangedDtsTime;
|
|
126744
126802
|
}
|
|
126745
126803
|
function updateOutputTimestamps(state, proj, resolvedPath) {
|
|
126746
126804
|
if (state.options.dry) {
|
|
@@ -126749,7 +126807,6 @@ var ts;
|
|
|
126749
126807
|
updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
|
|
126750
126808
|
state.projectStatus.set(resolvedPath, {
|
|
126751
126809
|
type: ts.UpToDateStatusType.UpToDate,
|
|
126752
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
|
|
126753
126810
|
oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
|
|
126754
126811
|
});
|
|
126755
126812
|
}
|