typescript 4.8.0-dev.20220628 → 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 +264 -180
- package/lib/tsserver.js +302 -218
- package/lib/tsserverlibrary.js +302 -218
- package/lib/typescript.js +302 -218
- package/lib/typescriptServices.js +302 -218
- package/lib/typingsInstaller.js +274 -189
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220701";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2667,6 +2667,22 @@ var ts;
|
|
|
2667
2667
|
return wrapFunction(deprecation, func);
|
|
2668
2668
|
}
|
|
2669
2669
|
Debug.deprecate = deprecate;
|
|
2670
|
+
function formatVariance(varianceFlags) {
|
|
2671
|
+
var variance = varianceFlags & 7;
|
|
2672
|
+
var result = variance === 0 ? "in out" :
|
|
2673
|
+
variance === 3 ? "[bivariant]" :
|
|
2674
|
+
variance === 2 ? "in" :
|
|
2675
|
+
variance === 1 ? "out" :
|
|
2676
|
+
variance === 4 ? "[independent]" : "";
|
|
2677
|
+
if (varianceFlags & 8) {
|
|
2678
|
+
result += " (unmeasurable)";
|
|
2679
|
+
}
|
|
2680
|
+
else if (varianceFlags & 16) {
|
|
2681
|
+
result += " (unreliable)";
|
|
2682
|
+
}
|
|
2683
|
+
return result;
|
|
2684
|
+
}
|
|
2685
|
+
Debug.formatVariance = formatVariance;
|
|
2670
2686
|
})(Debug = ts.Debug || (ts.Debug = {}));
|
|
2671
2687
|
})(ts || (ts = {}));
|
|
2672
2688
|
var ts;
|
|
@@ -3239,9 +3255,9 @@ var ts;
|
|
|
3239
3255
|
eventStack.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp(), separateBeginAndEnd: separateBeginAndEnd });
|
|
3240
3256
|
}
|
|
3241
3257
|
tracingEnabled.push = push;
|
|
3242
|
-
function pop() {
|
|
3258
|
+
function pop(results) {
|
|
3243
3259
|
ts.Debug.assert(eventStack.length > 0);
|
|
3244
|
-
writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp());
|
|
3260
|
+
writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp(), results);
|
|
3245
3261
|
eventStack.length--;
|
|
3246
3262
|
}
|
|
3247
3263
|
tracingEnabled.pop = pop;
|
|
@@ -3254,13 +3270,14 @@ var ts;
|
|
|
3254
3270
|
}
|
|
3255
3271
|
tracingEnabled.popAll = popAll;
|
|
3256
3272
|
var sampleInterval = 1000 * 10;
|
|
3257
|
-
function writeStackEvent(index, endTime) {
|
|
3273
|
+
function writeStackEvent(index, endTime, results) {
|
|
3258
3274
|
var _a = eventStack[index], phase = _a.phase, name = _a.name, args = _a.args, time = _a.time, separateBeginAndEnd = _a.separateBeginAndEnd;
|
|
3259
3275
|
if (separateBeginAndEnd) {
|
|
3276
|
+
ts.Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`");
|
|
3260
3277
|
writeEvent("E", phase, name, args, undefined, endTime);
|
|
3261
3278
|
}
|
|
3262
3279
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3263
|
-
writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
|
|
3280
|
+
writeEvent("X", phase, name, __assign(__assign({}, args), { results: results }), "\"dur\":" + (endTime - time), time);
|
|
3264
3281
|
}
|
|
3265
3282
|
}
|
|
3266
3283
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -39809,6 +39826,24 @@ var ts;
|
|
|
39809
39826
|
var Symbol = ts.objectAllocator.getSymbolConstructor();
|
|
39810
39827
|
var Type = ts.objectAllocator.getTypeConstructor();
|
|
39811
39828
|
var Signature = ts.objectAllocator.getSignatureConstructor();
|
|
39829
|
+
var DebugTypeMapper = (function () {
|
|
39830
|
+
function DebugTypeMapper() {
|
|
39831
|
+
}
|
|
39832
|
+
DebugTypeMapper.prototype.__debugToString = function () {
|
|
39833
|
+
var _a;
|
|
39834
|
+
ts.Debug.type(this);
|
|
39835
|
+
switch (this.kind) {
|
|
39836
|
+
case 3: return ((_a = this.debugInfo) === null || _a === void 0 ? void 0 : _a.call(this)) || "(function mapper)";
|
|
39837
|
+
case 0: return this.source.__debugTypeToString() + " -> " + this.target.__debugTypeToString();
|
|
39838
|
+
case 1: return ts.zipWith(this.sources, this.targets || ts.map(this.sources, function () { return anyType; }), function (s, t) { return s.__debugTypeToString() + " -> " + t.__debugTypeToString(); }).join(", ");
|
|
39839
|
+
case 2: return ts.zipWith(this.sources, this.targets, function (s, t) { return s.__debugTypeToString() + " -> " + t().__debugTypeToString(); }).join(", ");
|
|
39840
|
+
case 5:
|
|
39841
|
+
case 4: return "m1: " + this.mapper1.__debugToString().split("\n").join("\n ") + "\nm2: " + this.mapper2.__debugToString().split("\n").join("\n ");
|
|
39842
|
+
default: return ts.Debug.assertNever(this);
|
|
39843
|
+
}
|
|
39844
|
+
};
|
|
39845
|
+
return DebugTypeMapper;
|
|
39846
|
+
}());
|
|
39812
39847
|
var typeCount = 0;
|
|
39813
39848
|
var symbolCount = 0;
|
|
39814
39849
|
var enumCount = 0;
|
|
@@ -40256,10 +40291,23 @@ var ts;
|
|
|
40256
40291
|
var numberOrBigIntType = getUnionType([numberType, bigintType]);
|
|
40257
40292
|
var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
|
|
40258
40293
|
var numericStringType = getTemplateLiteralType(["", ""], [numberType]);
|
|
40259
|
-
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? getRestrictiveTypeParameter(t) : t; });
|
|
40260
|
-
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? wildcardType : t; });
|
|
40294
|
+
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? getRestrictiveTypeParameter(t) : t; }, function () { return "(restrictive mapper)"; });
|
|
40295
|
+
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? wildcardType : t; }, function () { return "(permissive mapper)"; });
|
|
40261
40296
|
var uniqueLiteralType = createIntrinsicType(131072, "never");
|
|
40262
|
-
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? uniqueLiteralType : t; });
|
|
40297
|
+
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? uniqueLiteralType : t; }, function () { return "(unique literal mapper)"; });
|
|
40298
|
+
var outofbandVarianceMarkerHandler;
|
|
40299
|
+
var reportUnreliableMapper = makeFunctionTypeMapper(function (t) {
|
|
40300
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
40301
|
+
outofbandVarianceMarkerHandler(true);
|
|
40302
|
+
}
|
|
40303
|
+
return t;
|
|
40304
|
+
}, function () { return "(unmeasurable reporter)"; });
|
|
40305
|
+
var reportUnmeasurableMapper = makeFunctionTypeMapper(function (t) {
|
|
40306
|
+
if (outofbandVarianceMarkerHandler && (t === markerSuperType || t === markerSubType || t === markerOtherType)) {
|
|
40307
|
+
outofbandVarianceMarkerHandler(false);
|
|
40308
|
+
}
|
|
40309
|
+
return t;
|
|
40310
|
+
}, function () { return "(unreliable reporter)"; });
|
|
40263
40311
|
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40264
40312
|
var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40265
40313
|
emptyJsxObjectType.objectFlags |= 2048;
|
|
@@ -40408,7 +40456,6 @@ var ts;
|
|
|
40408
40456
|
var typeofType = createTypeofType();
|
|
40409
40457
|
var _jsxNamespace;
|
|
40410
40458
|
var _jsxFactoryEntity;
|
|
40411
|
-
var outofbandVarianceMarkerHandler;
|
|
40412
40459
|
var subtypeRelation = new ts.Map();
|
|
40413
40460
|
var strictSubtypeRelation = new ts.Map();
|
|
40414
40461
|
var assignableRelation = new ts.Map();
|
|
@@ -43704,7 +43751,7 @@ var ts;
|
|
|
43704
43751
|
var name = typeParameterToName(newParam, context);
|
|
43705
43752
|
var newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
43706
43753
|
context.approximateLength += 37;
|
|
43707
|
-
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.
|
|
43754
|
+
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.mapper);
|
|
43708
43755
|
var saveInferTypeParameters_1 = context.inferTypeParameters;
|
|
43709
43756
|
context.inferTypeParameters = type.root.inferTypeParameters;
|
|
43710
43757
|
var extendsTypeNode_1 = typeToTypeNodeHelper(instantiateType(type.root.extendsType, newMapper), context);
|
|
@@ -50128,19 +50175,20 @@ var ts;
|
|
|
50128
50175
|
var _a;
|
|
50129
50176
|
var inferences;
|
|
50130
50177
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
50131
|
-
|
|
50132
|
-
var declaration = _b[_i];
|
|
50178
|
+
var _loop_15 = function (declaration) {
|
|
50133
50179
|
if (declaration.parent.kind === 190) {
|
|
50134
50180
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
50135
50181
|
if (grandParent.kind === 178 && !omitTypeReferences) {
|
|
50136
|
-
var
|
|
50137
|
-
var
|
|
50138
|
-
if (
|
|
50139
|
-
var index =
|
|
50140
|
-
if (index <
|
|
50141
|
-
var declaredConstraint = getConstraintOfTypeParameter(
|
|
50182
|
+
var typeReference_1 = grandParent;
|
|
50183
|
+
var typeParameters_1 = getTypeParametersForTypeReference(typeReference_1);
|
|
50184
|
+
if (typeParameters_1) {
|
|
50185
|
+
var index = typeReference_1.typeArguments.indexOf(childTypeParameter);
|
|
50186
|
+
if (index < typeParameters_1.length) {
|
|
50187
|
+
var declaredConstraint = getConstraintOfTypeParameter(typeParameters_1[index]);
|
|
50142
50188
|
if (declaredConstraint) {
|
|
50143
|
-
var mapper =
|
|
50189
|
+
var mapper = makeDeferredTypeMapper(typeParameters_1, typeParameters_1.map(function (_, index) { return function () {
|
|
50190
|
+
return getEffectiveTypeArgumentAtIndex(typeReference_1, typeParameters_1, index);
|
|
50191
|
+
}; }));
|
|
50144
50192
|
var constraint = instantiateType(declaredConstraint, mapper);
|
|
50145
50193
|
if (constraint !== typeParameter) {
|
|
50146
50194
|
inferences = ts.append(inferences, constraint);
|
|
@@ -50169,6 +50217,10 @@ var ts;
|
|
|
50169
50217
|
inferences = ts.append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfNode(checkMappedType_1.typeParameter)), checkMappedType_1.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType_1.typeParameter.constraint) : keyofConstraintType)));
|
|
50170
50218
|
}
|
|
50171
50219
|
}
|
|
50220
|
+
};
|
|
50221
|
+
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
50222
|
+
var declaration = _b[_i];
|
|
50223
|
+
_loop_15(declaration);
|
|
50172
50224
|
}
|
|
50173
50225
|
}
|
|
50174
50226
|
return inferences && getIntersectionType(inferences);
|
|
@@ -50976,7 +51028,7 @@ var ts;
|
|
|
50976
51028
|
var lastRequiredIndex = -1;
|
|
50977
51029
|
var firstRestIndex = -1;
|
|
50978
51030
|
var lastOptionalOrRestIndex = -1;
|
|
50979
|
-
var
|
|
51031
|
+
var _loop_16 = function (i) {
|
|
50980
51032
|
var type = elementTypes[i];
|
|
50981
51033
|
var flags = target.elementFlags[i];
|
|
50982
51034
|
if (flags & 8) {
|
|
@@ -51002,7 +51054,7 @@ var ts;
|
|
|
51002
51054
|
}
|
|
51003
51055
|
};
|
|
51004
51056
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
51005
|
-
var state_4 =
|
|
51057
|
+
var state_4 = _loop_16(i);
|
|
51006
51058
|
if (typeof state_4 === "object")
|
|
51007
51059
|
return state_4.value;
|
|
51008
51060
|
}
|
|
@@ -51179,7 +51231,7 @@ var ts;
|
|
|
51179
51231
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
51180
51232
|
if (templates.length) {
|
|
51181
51233
|
var i = types.length;
|
|
51182
|
-
var
|
|
51234
|
+
var _loop_17 = function () {
|
|
51183
51235
|
i--;
|
|
51184
51236
|
var t = types[i];
|
|
51185
51237
|
if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -51187,7 +51239,7 @@ var ts;
|
|
|
51187
51239
|
}
|
|
51188
51240
|
};
|
|
51189
51241
|
while (i > 0) {
|
|
51190
|
-
|
|
51242
|
+
_loop_17();
|
|
51191
51243
|
}
|
|
51192
51244
|
}
|
|
51193
51245
|
}
|
|
@@ -51257,14 +51309,14 @@ var ts;
|
|
|
51257
51309
|
var namedUnions = [];
|
|
51258
51310
|
addNamedUnions(namedUnions, types);
|
|
51259
51311
|
var reducedTypes = [];
|
|
51260
|
-
var
|
|
51312
|
+
var _loop_18 = function (t) {
|
|
51261
51313
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
51262
51314
|
reducedTypes.push(t);
|
|
51263
51315
|
}
|
|
51264
51316
|
};
|
|
51265
51317
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
51266
51318
|
var t = typeSet_1[_i];
|
|
51267
|
-
|
|
51319
|
+
_loop_18(t);
|
|
51268
51320
|
}
|
|
51269
51321
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
51270
51322
|
return namedUnions[0];
|
|
@@ -52340,7 +52392,7 @@ var ts;
|
|
|
52340
52392
|
var result;
|
|
52341
52393
|
var extraTypes;
|
|
52342
52394
|
var tailCount = 0;
|
|
52343
|
-
var
|
|
52395
|
+
var _loop_19 = function () {
|
|
52344
52396
|
if (tailCount === 1000) {
|
|
52345
52397
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
52346
52398
|
result = errorType;
|
|
@@ -52414,7 +52466,7 @@ var ts;
|
|
|
52414
52466
|
return "break";
|
|
52415
52467
|
};
|
|
52416
52468
|
while (true) {
|
|
52417
|
-
var state_5 =
|
|
52469
|
+
var state_5 = _loop_19();
|
|
52418
52470
|
if (typeof state_5 === "object")
|
|
52419
52471
|
return state_5.value;
|
|
52420
52472
|
if (state_5 === "break")
|
|
@@ -53015,7 +53067,7 @@ var ts;
|
|
|
53015
53067
|
switch (mapper.kind) {
|
|
53016
53068
|
case 0:
|
|
53017
53069
|
return type === mapper.source ? mapper.target : type;
|
|
53018
|
-
case 1:
|
|
53070
|
+
case 1: {
|
|
53019
53071
|
var sources = mapper.sources;
|
|
53020
53072
|
var targets = mapper.targets;
|
|
53021
53073
|
for (var i = 0; i < sources.length; i++) {
|
|
@@ -53024,43 +53076,64 @@ var ts;
|
|
|
53024
53076
|
}
|
|
53025
53077
|
}
|
|
53026
53078
|
return type;
|
|
53027
|
-
|
|
53028
|
-
|
|
53079
|
+
}
|
|
53080
|
+
case 2: {
|
|
53081
|
+
var sources = mapper.sources;
|
|
53082
|
+
var targets = mapper.targets;
|
|
53083
|
+
for (var i = 0; i < sources.length; i++) {
|
|
53084
|
+
if (type === sources[i]) {
|
|
53085
|
+
return targets[i]();
|
|
53086
|
+
}
|
|
53087
|
+
}
|
|
53088
|
+
return type;
|
|
53089
|
+
}
|
|
53029
53090
|
case 3:
|
|
53091
|
+
return mapper.func(type);
|
|
53030
53092
|
case 4:
|
|
53093
|
+
case 5:
|
|
53031
53094
|
var t1 = getMappedType(type, mapper.mapper1);
|
|
53032
|
-
return t1 !== type && mapper.kind ===
|
|
53095
|
+
return t1 !== type && mapper.kind === 4 ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2);
|
|
53033
53096
|
}
|
|
53034
53097
|
}
|
|
53098
|
+
function attachDebugPrototypeIfDebug(mapper) {
|
|
53099
|
+
if (ts.Debug.isDebugging) {
|
|
53100
|
+
return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype);
|
|
53101
|
+
}
|
|
53102
|
+
return mapper;
|
|
53103
|
+
}
|
|
53035
53104
|
function makeUnaryTypeMapper(source, target) {
|
|
53036
|
-
return { kind: 0, source: source, target: target };
|
|
53105
|
+
return attachDebugPrototypeIfDebug({ kind: 0, source: source, target: target });
|
|
53037
53106
|
}
|
|
53038
53107
|
function makeArrayTypeMapper(sources, targets) {
|
|
53039
|
-
return { kind: 1, sources: sources, targets: targets };
|
|
53108
|
+
return attachDebugPrototypeIfDebug({ kind: 1, sources: sources, targets: targets });
|
|
53109
|
+
}
|
|
53110
|
+
function makeFunctionTypeMapper(func, debugInfo) {
|
|
53111
|
+
return attachDebugPrototypeIfDebug({ kind: 3, func: func, debugInfo: ts.Debug.isDebugging ? debugInfo : undefined });
|
|
53040
53112
|
}
|
|
53041
|
-
function
|
|
53042
|
-
return { kind: 2,
|
|
53113
|
+
function makeDeferredTypeMapper(sources, targets) {
|
|
53114
|
+
return attachDebugPrototypeIfDebug({ kind: 2, sources: sources, targets: targets });
|
|
53043
53115
|
}
|
|
53044
53116
|
function makeCompositeTypeMapper(kind, mapper1, mapper2) {
|
|
53045
|
-
return { kind: kind, mapper1: mapper1, mapper2: mapper2 };
|
|
53117
|
+
return attachDebugPrototypeIfDebug({ kind: kind, mapper1: mapper1, mapper2: mapper2 });
|
|
53046
53118
|
}
|
|
53047
53119
|
function createTypeEraser(sources) {
|
|
53048
53120
|
return createTypeMapper(sources, undefined);
|
|
53049
53121
|
}
|
|
53050
53122
|
function createBackreferenceMapper(context, index) {
|
|
53051
|
-
|
|
53123
|
+
var forwardInferences = context.inferences.slice(index);
|
|
53124
|
+
return createTypeMapper(ts.map(forwardInferences, function (i) { return i.typeParameter; }), ts.map(forwardInferences, function () { return unknownType; }));
|
|
53052
53125
|
}
|
|
53053
53126
|
function combineTypeMappers(mapper1, mapper2) {
|
|
53054
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
53127
|
+
return mapper1 ? makeCompositeTypeMapper(4, mapper1, mapper2) : mapper2;
|
|
53055
53128
|
}
|
|
53056
53129
|
function mergeTypeMappers(mapper1, mapper2) {
|
|
53057
|
-
return mapper1 ? makeCompositeTypeMapper(
|
|
53130
|
+
return mapper1 ? makeCompositeTypeMapper(5, mapper1, mapper2) : mapper2;
|
|
53058
53131
|
}
|
|
53059
53132
|
function prependTypeMapping(source, target, mapper) {
|
|
53060
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
53133
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, makeUnaryTypeMapper(source, target), mapper);
|
|
53061
53134
|
}
|
|
53062
53135
|
function appendTypeMapping(mapper, source, target) {
|
|
53063
|
-
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(
|
|
53136
|
+
return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, mapper, makeUnaryTypeMapper(source, target));
|
|
53064
53137
|
}
|
|
53065
53138
|
function getRestrictiveTypeParameter(tp) {
|
|
53066
53139
|
return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol),
|
|
@@ -54740,7 +54813,7 @@ var ts;
|
|
|
54740
54813
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
54741
54814
|
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
|
54742
54815
|
}
|
|
54743
|
-
var
|
|
54816
|
+
var _loop_20 = function (prop) {
|
|
54744
54817
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
54745
54818
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
54746
54819
|
if (reportErrors) {
|
|
@@ -54793,7 +54866,7 @@ var ts;
|
|
|
54793
54866
|
};
|
|
54794
54867
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
54795
54868
|
var prop = _b[_i];
|
|
54796
|
-
var state_6 =
|
|
54869
|
+
var state_6 = _loop_20(prop);
|
|
54797
54870
|
if (typeof state_6 === "object")
|
|
54798
54871
|
return state_6.value;
|
|
54799
54872
|
}
|
|
@@ -54981,10 +55054,10 @@ var ts;
|
|
|
54981
55054
|
if (outofbandVarianceMarkerHandler) {
|
|
54982
55055
|
var saved = entry & 24;
|
|
54983
55056
|
if (saved & 8) {
|
|
54984
|
-
instantiateType(source,
|
|
55057
|
+
instantiateType(source, reportUnmeasurableMapper);
|
|
54985
55058
|
}
|
|
54986
55059
|
if (saved & 16) {
|
|
54987
|
-
instantiateType(source,
|
|
55060
|
+
instantiateType(source, reportUnreliableMapper);
|
|
54988
55061
|
}
|
|
54989
55062
|
}
|
|
54990
55063
|
return entry & 1 ? -1 : 0;
|
|
@@ -55321,7 +55394,7 @@ var ts;
|
|
|
55321
55394
|
if (relation === comparableRelation) {
|
|
55322
55395
|
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
|
|
55323
55396
|
}
|
|
55324
|
-
instantiateType(source,
|
|
55397
|
+
instantiateType(source, reportUnreliableMapper);
|
|
55325
55398
|
}
|
|
55326
55399
|
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
55327
55400
|
return -1;
|
|
@@ -55533,25 +55606,13 @@ var ts;
|
|
|
55533
55606
|
}
|
|
55534
55607
|
}
|
|
55535
55608
|
}
|
|
55536
|
-
function reportUnmeasurableMarkers(p) {
|
|
55537
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
55538
|
-
outofbandVarianceMarkerHandler(false);
|
|
55539
|
-
}
|
|
55540
|
-
return p;
|
|
55541
|
-
}
|
|
55542
|
-
function reportUnreliableMarkers(p) {
|
|
55543
|
-
if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {
|
|
55544
|
-
outofbandVarianceMarkerHandler(true);
|
|
55545
|
-
}
|
|
55546
|
-
return p;
|
|
55547
|
-
}
|
|
55548
55609
|
function mappedTypeRelatedTo(source, target, reportErrors) {
|
|
55549
55610
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
55550
55611
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
55551
55612
|
if (modifiersRelated) {
|
|
55552
55613
|
var result_10;
|
|
55553
55614
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
55554
|
-
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source),
|
|
55615
|
+
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
|
|
55555
55616
|
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
|
|
55556
55617
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
55557
55618
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
@@ -55587,11 +55648,11 @@ var ts;
|
|
|
55587
55648
|
}
|
|
55588
55649
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
55589
55650
|
var matchingTypes = [];
|
|
55590
|
-
var
|
|
55651
|
+
var _loop_21 = function (combination) {
|
|
55591
55652
|
var hasMatch = false;
|
|
55592
55653
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
55593
55654
|
var type = _d[_c];
|
|
55594
|
-
var
|
|
55655
|
+
var _loop_22 = function (i) {
|
|
55595
55656
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
55596
55657
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
55597
55658
|
if (!targetProperty)
|
|
@@ -55604,7 +55665,7 @@ var ts;
|
|
|
55604
55665
|
}
|
|
55605
55666
|
};
|
|
55606
55667
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
55607
|
-
var state_8 =
|
|
55668
|
+
var state_8 = _loop_22(i);
|
|
55608
55669
|
switch (state_8) {
|
|
55609
55670
|
case "continue-outer": continue outer;
|
|
55610
55671
|
}
|
|
@@ -55618,7 +55679,7 @@ var ts;
|
|
|
55618
55679
|
};
|
|
55619
55680
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
55620
55681
|
var combination = discriminantCombinations_1[_a];
|
|
55621
|
-
var state_7 =
|
|
55682
|
+
var state_7 = _loop_21(combination);
|
|
55622
55683
|
if (typeof state_7 === "object")
|
|
55623
55684
|
return state_7.value;
|
|
55624
55685
|
}
|
|
@@ -56024,7 +56085,7 @@ var ts;
|
|
|
56024
56085
|
return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); };
|
|
56025
56086
|
}
|
|
56026
56087
|
function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
|
|
56027
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker,
|
|
56088
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper);
|
|
56028
56089
|
}
|
|
56029
56090
|
function signaturesIdenticalTo(source, target, kind) {
|
|
56030
56091
|
var sourceSignatures = getSignaturesOfType(source, kind);
|
|
@@ -56262,7 +56323,7 @@ var ts;
|
|
|
56262
56323
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
56263
56324
|
links.variances = ts.emptyArray;
|
|
56264
56325
|
var variances = [];
|
|
56265
|
-
var
|
|
56326
|
+
var _loop_23 = function (tp) {
|
|
56266
56327
|
var modifiers = getVarianceModifiers(tp);
|
|
56267
56328
|
var variance = modifiers & 65536 ?
|
|
56268
56329
|
modifiers & 32768 ? 0 : 1 :
|
|
@@ -56291,12 +56352,12 @@ var ts;
|
|
|
56291
56352
|
}
|
|
56292
56353
|
variances.push(variance);
|
|
56293
56354
|
};
|
|
56294
|
-
for (var _i = 0,
|
|
56295
|
-
var tp =
|
|
56296
|
-
|
|
56355
|
+
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
56356
|
+
var tp = typeParameters_2[_i];
|
|
56357
|
+
_loop_23(tp);
|
|
56297
56358
|
}
|
|
56298
56359
|
links.variances = variances;
|
|
56299
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
56360
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
56300
56361
|
}
|
|
56301
56362
|
return links.variances;
|
|
56302
56363
|
}
|
|
@@ -57161,25 +57222,27 @@ var ts;
|
|
|
57161
57222
|
signature: signature,
|
|
57162
57223
|
flags: flags,
|
|
57163
57224
|
compareTypes: compareTypes,
|
|
57164
|
-
mapper:
|
|
57165
|
-
nonFixingMapper:
|
|
57225
|
+
mapper: reportUnmeasurableMapper,
|
|
57226
|
+
nonFixingMapper: reportUnmeasurableMapper,
|
|
57166
57227
|
};
|
|
57228
|
+
context.mapper = makeFixingMapperForContext(context);
|
|
57229
|
+
context.nonFixingMapper = makeNonFixingMapperForContext(context);
|
|
57167
57230
|
return context;
|
|
57168
57231
|
}
|
|
57169
|
-
function
|
|
57170
|
-
|
|
57171
|
-
|
|
57172
|
-
|
|
57173
|
-
|
|
57174
|
-
|
|
57175
|
-
inferFromIntraExpressionSites(context);
|
|
57176
|
-
clearCachedInferences(inferences);
|
|
57177
|
-
inference.isFixed = true;
|
|
57178
|
-
}
|
|
57179
|
-
return getInferredType(context, i);
|
|
57232
|
+
function makeFixingMapperForContext(context) {
|
|
57233
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (inference, i) { return function () {
|
|
57234
|
+
if (!inference.isFixed) {
|
|
57235
|
+
inferFromIntraExpressionSites(context);
|
|
57236
|
+
clearCachedInferences(context.inferences);
|
|
57237
|
+
inference.isFixed = true;
|
|
57180
57238
|
}
|
|
57181
|
-
|
|
57182
|
-
|
|
57239
|
+
return getInferredType(context, i);
|
|
57240
|
+
}; }));
|
|
57241
|
+
}
|
|
57242
|
+
function makeNonFixingMapperForContext(context) {
|
|
57243
|
+
return makeDeferredTypeMapper(ts.map(context.inferences, function (i) { return i.typeParameter; }), ts.map(context.inferences, function (_, i) { return function () {
|
|
57244
|
+
return getInferredType(context, i);
|
|
57245
|
+
}; }));
|
|
57183
57246
|
}
|
|
57184
57247
|
function clearCachedInferences(inferences) {
|
|
57185
57248
|
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
|
|
@@ -57929,7 +57992,7 @@ var ts;
|
|
|
57929
57992
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
57930
57993
|
var types = target.types;
|
|
57931
57994
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
57932
|
-
var
|
|
57995
|
+
var _loop_24 = function (i) {
|
|
57933
57996
|
var source_1 = matches ? matches[i] : neverType;
|
|
57934
57997
|
var target_3 = types[i];
|
|
57935
57998
|
if (source_1.flags & 128 && target_3.flags & 8650752) {
|
|
@@ -57973,7 +58036,7 @@ var ts;
|
|
|
57973
58036
|
inferFromTypes(source_1, target_3);
|
|
57974
58037
|
};
|
|
57975
58038
|
for (var i = 0; i < types.length; i++) {
|
|
57976
|
-
|
|
58039
|
+
_loop_24(i);
|
|
57977
58040
|
}
|
|
57978
58041
|
}
|
|
57979
58042
|
}
|
|
@@ -58443,7 +58506,7 @@ var ts;
|
|
|
58443
58506
|
function mapTypesByKeyProperty(types, name) {
|
|
58444
58507
|
var map = new ts.Map();
|
|
58445
58508
|
var count = 0;
|
|
58446
|
-
var
|
|
58509
|
+
var _loop_25 = function (type) {
|
|
58447
58510
|
if (type.flags & (524288 | 2097152 | 58982400)) {
|
|
58448
58511
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
58449
58512
|
if (discriminant) {
|
|
@@ -58469,7 +58532,7 @@ var ts;
|
|
|
58469
58532
|
};
|
|
58470
58533
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
58471
58534
|
var type = types_15[_i];
|
|
58472
|
-
var state_9 =
|
|
58535
|
+
var state_9 = _loop_25(type);
|
|
58473
58536
|
if (typeof state_9 === "object")
|
|
58474
58537
|
return state_9.value;
|
|
58475
58538
|
}
|
|
@@ -61329,8 +61392,8 @@ var ts;
|
|
|
61329
61392
|
var conditional = node.parent;
|
|
61330
61393
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : undefined;
|
|
61331
61394
|
}
|
|
61332
|
-
function getContextualTypeForChildJsxExpression(node, child) {
|
|
61333
|
-
var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName);
|
|
61395
|
+
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
61396
|
+
var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
61334
61397
|
var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
61335
61398
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
61336
61399
|
return undefined;
|
|
@@ -61347,24 +61410,24 @@ var ts;
|
|
|
61347
61410
|
}
|
|
61348
61411
|
}, true));
|
|
61349
61412
|
}
|
|
61350
|
-
function getContextualTypeForJsxExpression(node) {
|
|
61413
|
+
function getContextualTypeForJsxExpression(node, contextFlags) {
|
|
61351
61414
|
var exprParent = node.parent;
|
|
61352
61415
|
return ts.isJsxAttributeLike(exprParent)
|
|
61353
|
-
? getContextualType(node)
|
|
61416
|
+
? getContextualType(node, contextFlags)
|
|
61354
61417
|
: ts.isJsxElement(exprParent)
|
|
61355
|
-
? getContextualTypeForChildJsxExpression(exprParent, node)
|
|
61418
|
+
? getContextualTypeForChildJsxExpression(exprParent, node, contextFlags)
|
|
61356
61419
|
: undefined;
|
|
61357
61420
|
}
|
|
61358
|
-
function getContextualTypeForJsxAttribute(attribute) {
|
|
61421
|
+
function getContextualTypeForJsxAttribute(attribute, contextFlags) {
|
|
61359
61422
|
if (ts.isJsxAttribute(attribute)) {
|
|
61360
|
-
var attributesType = getApparentTypeOfContextualType(attribute.parent);
|
|
61423
|
+
var attributesType = getApparentTypeOfContextualType(attribute.parent, contextFlags);
|
|
61361
61424
|
if (!attributesType || isTypeAny(attributesType)) {
|
|
61362
61425
|
return undefined;
|
|
61363
61426
|
}
|
|
61364
61427
|
return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText);
|
|
61365
61428
|
}
|
|
61366
61429
|
else {
|
|
61367
|
-
return getContextualType(attribute.parent);
|
|
61430
|
+
return getContextualType(attribute.parent, contextFlags);
|
|
61368
61431
|
}
|
|
61369
61432
|
}
|
|
61370
61433
|
function isPossiblyDiscriminantValue(node) {
|
|
@@ -61488,10 +61551,10 @@ var ts;
|
|
|
61488
61551
|
case 271:
|
|
61489
61552
|
return tryGetTypeFromEffectiveTypeNode(parent);
|
|
61490
61553
|
case 288:
|
|
61491
|
-
return getContextualTypeForJsxExpression(parent);
|
|
61554
|
+
return getContextualTypeForJsxExpression(parent, contextFlags);
|
|
61492
61555
|
case 285:
|
|
61493
61556
|
case 287:
|
|
61494
|
-
return getContextualTypeForJsxAttribute(parent);
|
|
61557
|
+
return getContextualTypeForJsxAttribute(parent, contextFlags);
|
|
61495
61558
|
case 280:
|
|
61496
61559
|
case 279:
|
|
61497
61560
|
return getContextualJsxElementAttributesType(parent, contextFlags);
|
|
@@ -63878,7 +63941,7 @@ var ts;
|
|
|
63878
63941
|
var spreadIndex = getSpreadArgumentIndex(args);
|
|
63879
63942
|
if (spreadIndex >= 0) {
|
|
63880
63943
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
63881
|
-
var
|
|
63944
|
+
var _loop_26 = function (i) {
|
|
63882
63945
|
var arg = args[i];
|
|
63883
63946
|
var spreadType = arg.kind === 225 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
63884
63947
|
if (spreadType && isTupleType(spreadType)) {
|
|
@@ -63894,7 +63957,7 @@ var ts;
|
|
|
63894
63957
|
}
|
|
63895
63958
|
};
|
|
63896
63959
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
63897
|
-
|
|
63960
|
+
_loop_26(i);
|
|
63898
63961
|
}
|
|
63899
63962
|
return effectiveArgs_1;
|
|
63900
63963
|
}
|
|
@@ -64144,7 +64207,7 @@ var ts;
|
|
|
64144
64207
|
var min_3 = Number.MAX_VALUE;
|
|
64145
64208
|
var minIndex = 0;
|
|
64146
64209
|
var i_1 = 0;
|
|
64147
|
-
var
|
|
64210
|
+
var _loop_27 = function (c) {
|
|
64148
64211
|
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
64149
64212
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
|
64150
64213
|
if (diags_2) {
|
|
@@ -64162,7 +64225,7 @@ var ts;
|
|
|
64162
64225
|
};
|
|
64163
64226
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
64164
64227
|
var c = candidatesForArgumentError_1[_a];
|
|
64165
|
-
|
|
64228
|
+
_loop_27(c);
|
|
64166
64229
|
}
|
|
64167
64230
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
64168
64231
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -64305,7 +64368,7 @@ var ts;
|
|
|
64305
64368
|
}
|
|
64306
64369
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
64307
64370
|
var parameters = [];
|
|
64308
|
-
var
|
|
64371
|
+
var _loop_28 = function (i) {
|
|
64309
64372
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
64310
64373
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
64311
64374
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -64313,7 +64376,7 @@ var ts;
|
|
|
64313
64376
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
64314
64377
|
};
|
|
64315
64378
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
64316
|
-
|
|
64379
|
+
_loop_28(i);
|
|
64317
64380
|
}
|
|
64318
64381
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
64319
64382
|
var flags = 0;
|
|
@@ -67290,8 +67353,8 @@ var ts;
|
|
|
67290
67353
|
var result = [];
|
|
67291
67354
|
var oldTypeParameters;
|
|
67292
67355
|
var newTypeParameters;
|
|
67293
|
-
for (var _i = 0,
|
|
67294
|
-
var tp =
|
|
67356
|
+
for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) {
|
|
67357
|
+
var tp = typeParameters_3[_i];
|
|
67295
67358
|
var name = tp.symbol.escapedName;
|
|
67296
67359
|
if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) {
|
|
67297
67360
|
var newName = getUniqueTypeParameterName(ts.concatenate(context.inferredTypeParameters, result), name);
|
|
@@ -67584,12 +67647,14 @@ var ts;
|
|
|
67584
67647
|
error(node, ts.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
67585
67648
|
}
|
|
67586
67649
|
else if (modifiers === 32768 || modifiers === 65536) {
|
|
67650
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
67587
67651
|
var source = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
67588
67652
|
var target = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
67589
67653
|
var saveVarianceTypeParameter = typeParameter;
|
|
67590
67654
|
varianceTypeParameter = typeParameter;
|
|
67591
67655
|
checkTypeAssignableTo(source, target, node, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
67592
67656
|
varianceTypeParameter = saveVarianceTypeParameter;
|
|
67657
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
67593
67658
|
}
|
|
67594
67659
|
}
|
|
67595
67660
|
}
|
|
@@ -67899,7 +67964,7 @@ var ts;
|
|
|
67899
67964
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
67900
67965
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
67901
67966
|
var indexSignatureMap_1 = new ts.Map();
|
|
67902
|
-
var
|
|
67967
|
+
var _loop_29 = function (declaration) {
|
|
67903
67968
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
67904
67969
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
67905
67970
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -67914,7 +67979,7 @@ var ts;
|
|
|
67914
67979
|
};
|
|
67915
67980
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
67916
67981
|
var declaration = _a[_i];
|
|
67917
|
-
|
|
67982
|
+
_loop_29(declaration);
|
|
67918
67983
|
}
|
|
67919
67984
|
indexSignatureMap_1.forEach(function (entry) {
|
|
67920
67985
|
if (entry.declarations.length > 1) {
|
|
@@ -68106,6 +68171,12 @@ var ts;
|
|
|
68106
68171
|
function checkMissingDeclaration(node) {
|
|
68107
68172
|
checkDecorators(node);
|
|
68108
68173
|
}
|
|
68174
|
+
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
68175
|
+
if (index < typeParameters.length) {
|
|
68176
|
+
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
68177
|
+
}
|
|
68178
|
+
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
68179
|
+
}
|
|
68109
68180
|
function getEffectiveTypeArguments(node, typeParameters) {
|
|
68110
68181
|
return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(node));
|
|
68111
68182
|
}
|
|
@@ -68798,8 +68869,17 @@ var ts;
|
|
|
68798
68869
|
return typeAsAwaitable.awaitedTypeOfType;
|
|
68799
68870
|
}
|
|
68800
68871
|
if (type.flags & 1048576) {
|
|
68872
|
+
if (awaitedTypeStack.lastIndexOf(type.id) >= 0) {
|
|
68873
|
+
if (errorNode) {
|
|
68874
|
+
error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);
|
|
68875
|
+
}
|
|
68876
|
+
return undefined;
|
|
68877
|
+
}
|
|
68801
68878
|
var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
|
|
68802
|
-
|
|
68879
|
+
awaitedTypeStack.push(type.id);
|
|
68880
|
+
var mapped = mapType(type, mapper);
|
|
68881
|
+
awaitedTypeStack.pop();
|
|
68882
|
+
return typeAsAwaitable.awaitedTypeOfType = mapped;
|
|
68803
68883
|
}
|
|
68804
68884
|
var thisTypeForErrorOut = { value: undefined };
|
|
68805
68885
|
var promisedType = getPromisedTypeOfPromise(type, undefined, thisTypeForErrorOut);
|
|
@@ -69304,8 +69384,8 @@ var ts;
|
|
|
69304
69384
|
return;
|
|
69305
69385
|
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
|
|
69306
69386
|
var seenParentsWithEveryUnused = new ts.Set();
|
|
69307
|
-
for (var _i = 0,
|
|
69308
|
-
var typeParameter =
|
|
69387
|
+
for (var _i = 0, typeParameters_4 = typeParameters; _i < typeParameters_4.length; _i++) {
|
|
69388
|
+
var typeParameter = typeParameters_4[_i];
|
|
69309
69389
|
if (!isTypeParameterUnused(typeParameter))
|
|
69310
69390
|
continue;
|
|
69311
69391
|
var name = ts.idText(typeParameter.name);
|
|
@@ -70769,7 +70849,7 @@ var ts;
|
|
|
70769
70849
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
|
|
70770
70850
|
var localPropDeclaration = declaration && declaration.kind === 221 ||
|
|
70771
70851
|
name && name.kind === 162 || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
70772
|
-
var
|
|
70852
|
+
var _loop_30 = function (info) {
|
|
70773
70853
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
70774
70854
|
var errorNode = localPropDeclaration || localIndexDeclaration ||
|
|
70775
70855
|
(interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
|
|
@@ -70779,7 +70859,7 @@ var ts;
|
|
|
70779
70859
|
};
|
|
70780
70860
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
70781
70861
|
var info = indexInfos_9[_i];
|
|
70782
|
-
|
|
70862
|
+
_loop_30(info);
|
|
70783
70863
|
}
|
|
70784
70864
|
}
|
|
70785
70865
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -70787,7 +70867,7 @@ var ts;
|
|
|
70787
70867
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
70788
70868
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
|
|
70789
70869
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
70790
|
-
var
|
|
70870
|
+
var _loop_31 = function (info) {
|
|
70791
70871
|
if (info === checkInfo)
|
|
70792
70872
|
return "continue";
|
|
70793
70873
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -70799,7 +70879,7 @@ var ts;
|
|
|
70799
70879
|
};
|
|
70800
70880
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
70801
70881
|
var info = indexInfos_10[_i];
|
|
70802
|
-
|
|
70882
|
+
_loop_31(info);
|
|
70803
70883
|
}
|
|
70804
70884
|
}
|
|
70805
70885
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -71094,7 +71174,7 @@ var ts;
|
|
|
71094
71174
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
71095
71175
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
71096
71176
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
71097
|
-
var
|
|
71177
|
+
var _loop_32 = function (member) {
|
|
71098
71178
|
if (ts.hasAmbientModifier(member)) {
|
|
71099
71179
|
return "continue";
|
|
71100
71180
|
}
|
|
@@ -71109,7 +71189,7 @@ var ts;
|
|
|
71109
71189
|
};
|
|
71110
71190
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
71111
71191
|
var member = _a[_i];
|
|
71112
|
-
|
|
71192
|
+
_loop_32(member);
|
|
71113
71193
|
}
|
|
71114
71194
|
}
|
|
71115
71195
|
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
@@ -71184,7 +71264,7 @@ var ts;
|
|
|
71184
71264
|
}
|
|
71185
71265
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
71186
71266
|
var issuedMemberError = false;
|
|
71187
|
-
var
|
|
71267
|
+
var _loop_33 = function (member) {
|
|
71188
71268
|
if (ts.isStatic(member)) {
|
|
71189
71269
|
return "continue";
|
|
71190
71270
|
}
|
|
@@ -71202,7 +71282,7 @@ var ts;
|
|
|
71202
71282
|
};
|
|
71203
71283
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
71204
71284
|
var member = _a[_i];
|
|
71205
|
-
|
|
71285
|
+
_loop_33(member);
|
|
71206
71286
|
}
|
|
71207
71287
|
if (!issuedMemberError) {
|
|
71208
71288
|
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
|
@@ -71249,7 +71329,7 @@ var ts;
|
|
|
71249
71329
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
71250
71330
|
var _a, _b, _c, _d;
|
|
71251
71331
|
var baseProperties = getPropertiesOfType(baseType);
|
|
71252
|
-
var
|
|
71332
|
+
var _loop_34 = function (baseProperty) {
|
|
71253
71333
|
var base = getTargetSymbol(baseProperty);
|
|
71254
71334
|
if (base.flags & 4194304) {
|
|
71255
71335
|
return "continue";
|
|
@@ -71347,7 +71427,7 @@ var ts;
|
|
|
71347
71427
|
};
|
|
71348
71428
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
71349
71429
|
var baseProperty = baseProperties_1[_i];
|
|
71350
|
-
var state_10 =
|
|
71430
|
+
var state_10 = _loop_34(baseProperty);
|
|
71351
71431
|
switch (state_10) {
|
|
71352
71432
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
71353
71433
|
}
|
|
@@ -91819,7 +91899,6 @@ var ts;
|
|
|
91819
91899
|
newBuildInfo.program = buildInfo.program;
|
|
91820
91900
|
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
|
91821
91901
|
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, createHash, changedDtsData);
|
|
91822
|
-
newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
|
|
91823
91902
|
}
|
|
91824
91903
|
var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
|
|
91825
91904
|
newBuildInfo.bundle.js.sources = js.sources;
|
|
@@ -98803,7 +98882,7 @@ var ts;
|
|
|
98803
98882
|
}
|
|
98804
98883
|
}
|
|
98805
98884
|
function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
98806
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!
|
|
98885
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
|
|
98807
98886
|
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason);
|
|
98808
98887
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
98809
98888
|
}
|
|
@@ -100197,7 +100276,7 @@ var ts;
|
|
|
100197
100276
|
state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
|
|
100198
100277
|
}
|
|
100199
100278
|
state.changedFilesSet = new ts.Set();
|
|
100200
|
-
state.
|
|
100279
|
+
state.latestChangedDtsFile = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.latestChangedDtsFile : undefined;
|
|
100201
100280
|
var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
|
|
100202
100281
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
100203
100282
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
@@ -100304,7 +100383,7 @@ var ts;
|
|
|
100304
100383
|
programEmitComplete: state.programEmitComplete,
|
|
100305
100384
|
emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
|
|
100306
100385
|
outSignature: state.outSignature,
|
|
100307
|
-
|
|
100386
|
+
latestChangedDtsFile: state.latestChangedDtsFile,
|
|
100308
100387
|
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
|
100309
100388
|
changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
|
|
100310
100389
|
};
|
|
@@ -100317,7 +100396,7 @@ var ts;
|
|
|
100317
100396
|
state.programEmitComplete = savedEmitState.programEmitComplete;
|
|
100318
100397
|
state.emitSignatures = savedEmitState.emitSignatures;
|
|
100319
100398
|
state.outSignature = savedEmitState.outSignature;
|
|
100320
|
-
state.
|
|
100399
|
+
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
|
100321
100400
|
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
|
100322
100401
|
if (savedEmitState.changedFilesSet)
|
|
100323
100402
|
state.changedFilesSet = savedEmitState.changedFilesSet;
|
|
@@ -100547,13 +100626,13 @@ var ts;
|
|
|
100547
100626
|
return !!ts.outFile(info.options || {});
|
|
100548
100627
|
}
|
|
100549
100628
|
ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
|
|
100550
|
-
function getProgramBuildInfo(state, getCanonicalFileName
|
|
100629
|
+
function getProgramBuildInfo(state, getCanonicalFileName) {
|
|
100551
100630
|
var outFilePath = ts.outFile(state.compilerOptions);
|
|
100552
100631
|
if (outFilePath && !state.compilerOptions.composite)
|
|
100553
100632
|
return;
|
|
100554
100633
|
var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
|
|
100555
100634
|
var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
100556
|
-
|
|
100635
|
+
var latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : undefined;
|
|
100557
100636
|
if (outFilePath) {
|
|
100558
100637
|
var fileNames_1 = [];
|
|
100559
100638
|
var fileInfos_1 = [];
|
|
@@ -100569,7 +100648,7 @@ var ts;
|
|
|
100569
100648
|
fileInfos: fileInfos_1,
|
|
100570
100649
|
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
|
|
100571
100650
|
outSignature: state.outSignature,
|
|
100572
|
-
|
|
100651
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
100573
100652
|
};
|
|
100574
100653
|
return result_15;
|
|
100575
100654
|
}
|
|
@@ -100664,7 +100743,7 @@ var ts;
|
|
|
100664
100743
|
affectedFilesPendingEmit: affectedFilesPendingEmit,
|
|
100665
100744
|
changeFileSet: changeFileSet,
|
|
100666
100745
|
emitSignatures: emitSignatures,
|
|
100667
|
-
|
|
100746
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
100668
100747
|
};
|
|
100669
100748
|
return result;
|
|
100670
100749
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
@@ -100822,7 +100901,7 @@ var ts;
|
|
|
100822
100901
|
var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
100823
100902
|
var computeHash = ts.maybeBind(host, host.createHash);
|
|
100824
100903
|
var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
|
100825
|
-
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName
|
|
100904
|
+
newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
|
|
100826
100905
|
newProgram = undefined;
|
|
100827
100906
|
oldProgram = undefined;
|
|
100828
100907
|
oldState = undefined;
|
|
@@ -100831,6 +100910,7 @@ var ts;
|
|
|
100831
100910
|
builderProgram.getState = getState;
|
|
100832
100911
|
builderProgram.saveEmitState = function () { return backupBuilderProgramEmitState(state); };
|
|
100833
100912
|
builderProgram.restoreEmitState = function (saved) { return restoreBuilderProgramEmitState(state, saved); };
|
|
100913
|
+
builderProgram.hasChangedEmitSignature = function () { return !!state.hasChangedEmitSignature; };
|
|
100834
100914
|
builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
|
|
100835
100915
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
100836
100916
|
builderProgram.emit = emit;
|
|
@@ -100919,18 +100999,20 @@ var ts;
|
|
|
100919
100999
|
var filePath = sourceFiles[0].resolvedPath;
|
|
100920
101000
|
var oldSignature = (_f = state.emitSignatures) === null || _f === void 0 ? void 0 : _f.get(filePath);
|
|
100921
101001
|
emitSignature !== null && emitSignature !== void 0 ? emitSignature : (emitSignature = computeSignature(text, computeHash, data));
|
|
100922
|
-
if (emitSignature
|
|
100923
|
-
|
|
100924
|
-
|
|
100925
|
-
|
|
101002
|
+
if (emitSignature === oldSignature)
|
|
101003
|
+
return;
|
|
101004
|
+
((_g = state.emitSignatures) !== null && _g !== void 0 ? _g : (state.emitSignatures = new ts.Map())).set(filePath, emitSignature);
|
|
101005
|
+
state.hasChangedEmitSignature = true;
|
|
101006
|
+
state.latestChangedDtsFile = fileName;
|
|
100926
101007
|
}
|
|
100927
101008
|
}
|
|
100928
101009
|
else if (state.compilerOptions.composite) {
|
|
100929
101010
|
var newSignature = computeSignature(text, computeHash, data);
|
|
100930
|
-
if (newSignature
|
|
100931
|
-
|
|
100932
|
-
|
|
100933
|
-
|
|
101011
|
+
if (newSignature === state.outSignature)
|
|
101012
|
+
return;
|
|
101013
|
+
state.outSignature = newSignature;
|
|
101014
|
+
state.hasChangedEmitSignature = true;
|
|
101015
|
+
state.latestChangedDtsFile = fileName;
|
|
100934
101016
|
}
|
|
100935
101017
|
}
|
|
100936
101018
|
if (writeFile)
|
|
@@ -101051,11 +101133,12 @@ var ts;
|
|
|
101051
101133
|
var state;
|
|
101052
101134
|
var filePaths;
|
|
101053
101135
|
var filePathsSetList;
|
|
101136
|
+
var latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : undefined;
|
|
101054
101137
|
if (isProgramBundleEmitBuildInfo(program)) {
|
|
101055
101138
|
state = {
|
|
101056
101139
|
fileInfos: new ts.Map(),
|
|
101057
101140
|
compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
|
|
101058
|
-
|
|
101141
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
101059
101142
|
outSignature: program.outSignature,
|
|
101060
101143
|
};
|
|
101061
101144
|
}
|
|
@@ -101088,7 +101171,7 @@ var ts;
|
|
|
101088
101171
|
affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
|
|
101089
101172
|
affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
|
|
101090
101173
|
changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
|
|
101091
|
-
|
|
101174
|
+
latestChangedDtsFile: latestChangedDtsFile,
|
|
101092
101175
|
emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
|
|
101093
101176
|
};
|
|
101094
101177
|
}
|
|
@@ -101115,6 +101198,7 @@ var ts;
|
|
|
101115
101198
|
getSemanticDiagnosticsOfNextAffectedFile: ts.notImplemented,
|
|
101116
101199
|
emitBuildInfo: ts.notImplemented,
|
|
101117
101200
|
close: ts.noop,
|
|
101201
|
+
hasChangedEmitSignature: ts.returnFalse,
|
|
101118
101202
|
};
|
|
101119
101203
|
function toPath(path) {
|
|
101120
101204
|
return ts.toPath(path, buildInfoDirectory, getCanonicalFileName);
|
|
@@ -102255,7 +102339,7 @@ var ts;
|
|
|
102255
102339
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
102256
102340
|
});
|
|
102257
102341
|
var sortedPaths = [];
|
|
102258
|
-
var
|
|
102342
|
+
var _loop_35 = function (directory) {
|
|
102259
102343
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
102260
102344
|
var pathsInDirectory;
|
|
102261
102345
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -102279,7 +102363,7 @@ var ts;
|
|
|
102279
102363
|
};
|
|
102280
102364
|
var out_directory_1;
|
|
102281
102365
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
102282
|
-
var state_11 =
|
|
102366
|
+
var state_11 = _loop_35(directory);
|
|
102283
102367
|
directory = out_directory_1;
|
|
102284
102368
|
if (state_11 === "break")
|
|
102285
102369
|
break;
|
|
@@ -103052,7 +103136,6 @@ var ts;
|
|
|
103052
103136
|
readDirectory: ts.maybeBind(host, host.readDirectory),
|
|
103053
103137
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
103054
103138
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
103055
|
-
now: ts.maybeBind(host, host.now),
|
|
103056
103139
|
};
|
|
103057
103140
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
103058
103141
|
try {
|
|
@@ -103191,7 +103274,6 @@ var ts;
|
|
|
103191
103274
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
103192
103275
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
103193
103276
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
103194
|
-
host.now = ts.maybeBind(system, system.now);
|
|
103195
103277
|
ts.setGetSourceFileAsHashVersioned(host, system);
|
|
103196
103278
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
103197
103279
|
return host;
|
|
@@ -104415,8 +104497,7 @@ var ts;
|
|
|
104415
104497
|
};
|
|
104416
104498
|
}
|
|
104417
104499
|
var host = state.host, compilerHost = state.compilerHost;
|
|
104418
|
-
var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
|
|
104419
|
-
var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
|
|
104500
|
+
var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
|
|
104420
104501
|
var emitterDiagnostics = ts.createDiagnosticCollection();
|
|
104421
104502
|
var emittedOutputs = new ts.Map();
|
|
104422
104503
|
var options = program.getCompilerOptions();
|
|
@@ -104424,16 +104505,11 @@ var ts;
|
|
|
104424
104505
|
var outputTimeStampMap;
|
|
104425
104506
|
var now;
|
|
104426
104507
|
outputFiles.forEach(function (_a) {
|
|
104427
|
-
var _b, _c;
|
|
104428
104508
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
104429
104509
|
var path = toPath(state, name);
|
|
104430
104510
|
emittedOutputs.set(toPath(state, name), name);
|
|
104431
|
-
if (buildInfo)
|
|
104432
|
-
setBuildInfo(state, buildInfo, projectPath, options);
|
|
104433
|
-
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)) {
|
|
104434
|
-
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
104435
|
-
}
|
|
104436
|
-
}
|
|
104511
|
+
if (buildInfo)
|
|
104512
|
+
setBuildInfo(state, buildInfo, projectPath, options, resultFlags);
|
|
104437
104513
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
104438
104514
|
if (!isIncremental && state.watch) {
|
|
104439
104515
|
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
|
|
@@ -104447,7 +104523,7 @@ var ts;
|
|
|
104447
104523
|
ts.Debug.assert(step === BuildStep.EmitBuildInfo);
|
|
104448
104524
|
var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
104449
104525
|
if (data === null || data === void 0 ? void 0 : data.buildInfo)
|
|
104450
|
-
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
|
|
104526
|
+
setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions(), BuildResultFlags.DeclarationOutputUnchanged);
|
|
104451
104527
|
if (writeFileCallback)
|
|
104452
104528
|
writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
104453
104529
|
else
|
|
@@ -104479,7 +104555,6 @@ var ts;
|
|
|
104479
104555
|
state.diagnostics.delete(projectPath);
|
|
104480
104556
|
state.projectStatus.set(projectPath, {
|
|
104481
104557
|
type: ts.UpToDateStatusType.UpToDate,
|
|
104482
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
|
|
104483
104558
|
oldestOutputFileName: oldestOutputFileName
|
|
104484
104559
|
});
|
|
104485
104560
|
afterProgramDone(state, program, config);
|
|
@@ -104519,10 +104594,10 @@ var ts;
|
|
|
104519
104594
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
|
|
104520
104595
|
emittedOutputs.set(toPath(state, name), name);
|
|
104521
104596
|
if (buildInfo) {
|
|
104522
|
-
|
|
104523
|
-
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
|
|
104597
|
+
if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.outSignature) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) {
|
|
104524
104598
|
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
|
104525
104599
|
}
|
|
104600
|
+
setBuildInfo(state, buildInfo, projectPath, config.options, resultFlags);
|
|
104526
104601
|
}
|
|
104527
104602
|
ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
104528
104603
|
});
|
|
@@ -104771,15 +104846,23 @@ var ts;
|
|
|
104771
104846
|
state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
|
|
104772
104847
|
return result;
|
|
104773
104848
|
}
|
|
104774
|
-
function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
|
|
104849
|
+
function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) {
|
|
104775
104850
|
var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
|
|
104776
104851
|
var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
|
|
104852
|
+
var modifiedTime = getCurrentTime(state.host);
|
|
104777
104853
|
if (existing) {
|
|
104778
104854
|
existing.buildInfo = buildInfo;
|
|
104779
|
-
existing.modifiedTime =
|
|
104855
|
+
existing.modifiedTime = modifiedTime;
|
|
104856
|
+
if (!(resultFlags & BuildResultFlags.DeclarationOutputUnchanged))
|
|
104857
|
+
existing.latestChangedDtsTime = modifiedTime;
|
|
104780
104858
|
}
|
|
104781
104859
|
else {
|
|
104782
|
-
state.buildInfoCache.set(resolvedConfigPath, {
|
|
104860
|
+
state.buildInfoCache.set(resolvedConfigPath, {
|
|
104861
|
+
path: toPath(state, buildInfoPath),
|
|
104862
|
+
buildInfo: buildInfo,
|
|
104863
|
+
modifiedTime: modifiedTime,
|
|
104864
|
+
latestChangedDtsTime: resultFlags & BuildResultFlags.DeclarationOutputUnchanged ? undefined : modifiedTime,
|
|
104865
|
+
});
|
|
104783
104866
|
}
|
|
104784
104867
|
}
|
|
104785
104868
|
function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
|
|
@@ -104810,7 +104893,7 @@ var ts;
|
|
|
104810
104893
|
}
|
|
104811
104894
|
}
|
|
104812
104895
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
104813
|
-
var _a, _b
|
|
104896
|
+
var _a, _b;
|
|
104814
104897
|
if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
|
|
104815
104898
|
return {
|
|
104816
104899
|
type: ts.UpToDateStatusType.ContainerOnly
|
|
@@ -104820,8 +104903,8 @@ var ts;
|
|
|
104820
104903
|
var force = !!state.options.force;
|
|
104821
104904
|
if (project.projectReferences) {
|
|
104822
104905
|
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
|
|
104823
|
-
for (var _i = 0,
|
|
104824
|
-
var ref =
|
|
104906
|
+
for (var _i = 0, _c = project.projectReferences; _i < _c.length; _i++) {
|
|
104907
|
+
var ref = _c[_i];
|
|
104825
104908
|
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
104826
104909
|
var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
|
|
104827
104910
|
var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
|
|
@@ -104857,7 +104940,6 @@ var ts;
|
|
|
104857
104940
|
var buildInfoTime;
|
|
104858
104941
|
var buildInfoProgram;
|
|
104859
104942
|
var buildInfoVersionMap;
|
|
104860
|
-
var newestDeclarationFileContentChangedTime;
|
|
104861
104943
|
if (buildInfoPath) {
|
|
104862
104944
|
var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
104863
104945
|
buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
|
|
@@ -104893,13 +104975,12 @@ var ts;
|
|
|
104893
104975
|
}
|
|
104894
104976
|
oldestOutputFileTime = buildInfoTime;
|
|
104895
104977
|
oldestOutputFileName = buildInfoPath;
|
|
104896
|
-
newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
|
|
104897
104978
|
}
|
|
104898
104979
|
var newestInputFileName = undefined;
|
|
104899
104980
|
var newestInputFileTime = minimumDate;
|
|
104900
104981
|
var pseudoInputUpToDate = false;
|
|
104901
|
-
for (var
|
|
104902
|
-
var inputFile =
|
|
104982
|
+
for (var _d = 0, _e = project.fileNames; _d < _e.length; _d++) {
|
|
104983
|
+
var inputFile = _e[_d];
|
|
104903
104984
|
var inputTime = getModifiedTime(state, inputFile);
|
|
104904
104985
|
if (inputTime === ts.missingFileModifiedTime) {
|
|
104905
104986
|
return {
|
|
@@ -104935,8 +105016,8 @@ var ts;
|
|
|
104935
105016
|
if (!buildInfoPath) {
|
|
104936
105017
|
var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
|
|
104937
105018
|
var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
|
|
104938
|
-
for (var
|
|
104939
|
-
var output = outputs_1[
|
|
105019
|
+
for (var _f = 0, outputs_1 = outputs; _f < outputs_1.length; _f++) {
|
|
105020
|
+
var output = outputs_1[_f];
|
|
104940
105021
|
var path = toPath(state, output);
|
|
104941
105022
|
var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
|
|
104942
105023
|
if (!outputTime) {
|
|
@@ -104969,8 +105050,8 @@ var ts;
|
|
|
104969
105050
|
var usesPrepend = false;
|
|
104970
105051
|
var upstreamChangedProject;
|
|
104971
105052
|
if (referenceStatuses) {
|
|
104972
|
-
for (var
|
|
104973
|
-
var
|
|
105053
|
+
for (var _g = 0, referenceStatuses_1 = referenceStatuses; _g < referenceStatuses_1.length; _g++) {
|
|
105054
|
+
var _h = referenceStatuses_1[_g], ref = _h.ref, refStatus = _h.refStatus, resolvedConfig = _h.resolvedConfig, resolvedRefPath = _h.resolvedRefPath;
|
|
104974
105055
|
usesPrepend = usesPrepend || !!(ref.prepend);
|
|
104975
105056
|
if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
|
|
104976
105057
|
continue;
|
|
@@ -104982,7 +105063,8 @@ var ts;
|
|
|
104982
105063
|
newerProjectName: ref.path
|
|
104983
105064
|
};
|
|
104984
105065
|
}
|
|
104985
|
-
|
|
105066
|
+
var newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath);
|
|
105067
|
+
if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
|
104986
105068
|
pseudoUpToDate = true;
|
|
104987
105069
|
upstreamChangedProject = ref.path;
|
|
104988
105070
|
continue;
|
|
@@ -105020,7 +105102,6 @@ var ts;
|
|
|
105020
105102
|
pseudoInputUpToDate ?
|
|
105021
105103
|
ts.UpToDateStatusType.UpToDateWithInputFileText :
|
|
105022
105104
|
ts.UpToDateStatusType.UpToDate,
|
|
105023
|
-
newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
|
|
105024
105105
|
newestInputFileTime: newestInputFileTime,
|
|
105025
105106
|
newestInputFileName: newestInputFileName,
|
|
105026
105107
|
oldestOutputFileName: oldestOutputFileName
|
|
@@ -105099,13 +105180,17 @@ var ts;
|
|
|
105099
105180
|
outputTimeStampMap.delete(key);
|
|
105100
105181
|
});
|
|
105101
105182
|
}
|
|
105102
|
-
function
|
|
105103
|
-
var _a;
|
|
105183
|
+
function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
105104
105184
|
if (!options.composite)
|
|
105105
105185
|
return undefined;
|
|
105106
|
-
var
|
|
105107
|
-
|
|
105108
|
-
|
|
105186
|
+
var entry = ts.Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
105187
|
+
if (entry.latestChangedDtsTime !== undefined)
|
|
105188
|
+
return entry.latestChangedDtsTime || undefined;
|
|
105189
|
+
var latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ?
|
|
105190
|
+
state.host.getModifiedTime(ts.getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, ts.getDirectoryPath(entry.path))) :
|
|
105191
|
+
undefined;
|
|
105192
|
+
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
105193
|
+
return latestChangedDtsTime;
|
|
105109
105194
|
}
|
|
105110
105195
|
function updateOutputTimestamps(state, proj, resolvedPath) {
|
|
105111
105196
|
if (state.options.dry) {
|
|
@@ -105114,7 +105199,6 @@ var ts;
|
|
|
105114
105199
|
updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
|
|
105115
105200
|
state.projectStatus.set(resolvedPath, {
|
|
105116
105201
|
type: ts.UpToDateStatusType.UpToDate,
|
|
105117
|
-
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
|
|
105118
105202
|
oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
|
|
105119
105203
|
});
|
|
105120
105204
|
}
|