@typescript-deploys/pr-build 4.8.0-pr-49285-2 → 4.8.0-pr-49285-5
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 +131 -127
- package/lib/tsserver.js +169 -150
- package/lib/tsserverlibrary.js +169 -150
- package/lib/typescript.js +169 -150
- package/lib/typescriptServices.js +169 -150
- package/lib/typingsInstaller.js +149 -147
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -8897,6 +8897,7 @@ var ts;
|
|
|
8897
8897
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8898
8898
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
8899
8899
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
8900
|
+
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, ts.DiagnosticCategory.Error, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
8900
8901
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8901
8902
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8902
8903
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -44166,8 +44167,8 @@ var ts;
|
|
|
44166
44167
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
44167
44168
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
44168
44169
|
if (!pathAndExtension && packageInfo
|
|
44169
|
-
|
|
44170
|
-
&& packageInfo.packageJsonContent.
|
|
44170
|
+
// eslint-disable-next-line no-null/no-null
|
|
44171
|
+
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
44171
44172
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
44172
44173
|
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
44173
44174
|
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
@@ -47832,7 +47833,10 @@ var ts;
|
|
|
47832
47833
|
TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
|
|
47833
47834
|
TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
|
|
47834
47835
|
TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
|
|
47835
|
-
TypeFacts[TypeFacts["
|
|
47836
|
+
TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
|
|
47837
|
+
TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
|
|
47838
|
+
TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
|
|
47839
|
+
TypeFacts[TypeFacts["All"] = 134217727] = "All";
|
|
47836
47840
|
// The following members encode facts about particular kinds of types for use in the getTypeFacts function.
|
|
47837
47841
|
// The presence of a particular fact means that the given test is true for some (and possibly all) values
|
|
47838
47842
|
// of that kind of type.
|
|
@@ -47874,14 +47878,16 @@ var ts;
|
|
|
47874
47878
|
TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
|
|
47875
47879
|
TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
|
|
47876
47880
|
TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
|
|
47877
|
-
TypeFacts[TypeFacts["
|
|
47878
|
-
TypeFacts[TypeFacts["
|
|
47879
|
-
TypeFacts[TypeFacts["
|
|
47881
|
+
TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
|
|
47882
|
+
TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
|
|
47883
|
+
TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
|
|
47884
|
+
TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
|
|
47885
|
+
TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
|
|
47886
|
+
TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
|
|
47880
47887
|
TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
|
|
47881
|
-
TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
|
|
47882
47888
|
// Masks
|
|
47883
47889
|
TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
|
|
47884
|
-
TypeFacts[TypeFacts["AndFactsMask"] =
|
|
47890
|
+
TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
47885
47891
|
})(TypeFacts || (TypeFacts = {}));
|
|
47886
47892
|
var typeofEQFacts = new ts.Map(ts.getEntries({
|
|
47887
47893
|
string: 1 /* TypeofEQString */,
|
|
@@ -50045,7 +50051,12 @@ var ts;
|
|
|
50045
50051
|
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
|
|
50046
50052
|
if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
|
|
50047
50053
|
if (isPrimitiveTypeName(name)) {
|
|
50048
|
-
|
|
50054
|
+
if (isExtendedByInterface(errorLocation)) {
|
|
50055
|
+
error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
|
|
50056
|
+
}
|
|
50057
|
+
else {
|
|
50058
|
+
error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
|
|
50059
|
+
}
|
|
50049
50060
|
return true;
|
|
50050
50061
|
}
|
|
50051
50062
|
var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
|
|
@@ -50065,6 +50076,16 @@ var ts;
|
|
|
50065
50076
|
}
|
|
50066
50077
|
return false;
|
|
50067
50078
|
}
|
|
50079
|
+
function isExtendedByInterface(node) {
|
|
50080
|
+
var grandparent = node.parent.parent;
|
|
50081
|
+
var parentOfGrandparent = grandparent.parent;
|
|
50082
|
+
if (grandparent && parentOfGrandparent) {
|
|
50083
|
+
var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
|
|
50084
|
+
var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
|
|
50085
|
+
return isExtending && isInterface;
|
|
50086
|
+
}
|
|
50087
|
+
return false;
|
|
50088
|
+
}
|
|
50068
50089
|
function maybeMappedType(node, symbol) {
|
|
50069
50090
|
var container = ts.findAncestor(node.parent, function (n) {
|
|
50070
50091
|
return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
|
|
@@ -52905,7 +52926,7 @@ var ts;
|
|
|
52905
52926
|
anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
52906
52927
|
var saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
52907
52928
|
context.enclosingDeclaration = undefined;
|
|
52908
|
-
if (context.tracker.trackSymbol &&
|
|
52929
|
+
if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
|
|
52909
52930
|
if (propertySymbol.declarations) {
|
|
52910
52931
|
var decl = ts.first(propertySymbol.declarations);
|
|
52911
52932
|
if (hasLateBindableName(decl)) {
|
|
@@ -54589,7 +54610,7 @@ var ts;
|
|
|
54589
54610
|
? getBaseConstructorTypeOfClass(staticType)
|
|
54590
54611
|
: anyType;
|
|
54591
54612
|
var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(94 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))], true), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(117 /* ImplementsKeyword */, implementsExpressions)], true);
|
|
54592
|
-
var symbolProps =
|
|
54613
|
+
var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
54593
54614
|
var publicSymbolProps = ts.filter(symbolProps, function (s) {
|
|
54594
54615
|
// `valueDeclaration` could be undefined if inherited from
|
|
54595
54616
|
// a union/intersection base type, but inherited properties
|
|
@@ -55727,7 +55748,7 @@ var ts;
|
|
|
55727
55748
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
55728
55749
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
55729
55750
|
// undefined from the final type.
|
|
55730
|
-
return strictNullChecks && !(
|
|
55751
|
+
return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
|
|
55731
55752
|
}
|
|
55732
55753
|
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
55733
55754
|
}
|
|
@@ -58930,7 +58951,7 @@ var ts;
|
|
|
58930
58951
|
var objectType;
|
|
58931
58952
|
return !!(type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ &&
|
|
58932
58953
|
!isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
|
|
58933
|
-
!objectType
|
|
58954
|
+
!(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
58934
58955
|
}
|
|
58935
58956
|
/**
|
|
58936
58957
|
* For a type parameter, return the base constraint of the type parameter. For the string, number,
|
|
@@ -64222,7 +64243,7 @@ var ts;
|
|
|
64222
64243
|
var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
|
|
64223
64244
|
var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
|
|
64224
64245
|
var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
|
|
64225
|
-
(
|
|
64246
|
+
(getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
|
|
64226
64247
|
var related = callbacks ?
|
|
64227
64248
|
compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
|
|
64228
64249
|
!(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
|
|
@@ -67440,30 +67461,8 @@ var ts;
|
|
|
67440
67461
|
var value = _a.value;
|
|
67441
67462
|
return value.base10Value === "0";
|
|
67442
67463
|
}
|
|
67443
|
-
function getFalsyFlagsOfTypes(types) {
|
|
67444
|
-
var result = 0;
|
|
67445
|
-
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
67446
|
-
var t = types_14[_i];
|
|
67447
|
-
result |= getFalsyFlags(t);
|
|
67448
|
-
}
|
|
67449
|
-
return result;
|
|
67450
|
-
}
|
|
67451
|
-
// Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
|
|
67452
|
-
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
|
67453
|
-
// no flags for all other types (including non-falsy literal types).
|
|
67454
|
-
function getFalsyFlags(type) {
|
|
67455
|
-
var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
|
|
67456
|
-
return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
|
|
67457
|
-
t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
|
|
67458
|
-
t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
|
|
67459
|
-
t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
|
|
67460
|
-
t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
|
|
67461
|
-
t.flags & 117724 /* PossiblyFalsy */;
|
|
67462
|
-
}
|
|
67463
67464
|
function removeDefinitelyFalsyTypes(type) {
|
|
67464
|
-
return
|
|
67465
|
-
filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
|
|
67466
|
-
type;
|
|
67465
|
+
return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
|
|
67467
67466
|
}
|
|
67468
67467
|
function extractDefinitelyFalsyTypes(type) {
|
|
67469
67468
|
return mapType(type, getDefinitelyFalsyPartOfType);
|
|
@@ -67506,14 +67505,7 @@ var ts;
|
|
|
67506
67505
|
getIntersectionType([type, emptyObjectType]);
|
|
67507
67506
|
}
|
|
67508
67507
|
function getNonNullableType(type) {
|
|
67509
|
-
|
|
67510
|
-
// First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
|
|
67511
|
-
// 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
|
|
67512
|
-
// that isn't eliminated by a NonNullable<T> instantiation.
|
|
67513
|
-
var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
67514
|
-
return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
|
|
67515
|
-
}
|
|
67516
|
-
return type;
|
|
67508
|
+
return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
67517
67509
|
}
|
|
67518
67510
|
function addOptionalTypeMarker(type) {
|
|
67519
67511
|
return strictNullChecks ? getUnionType([type, optionalType]) : type;
|
|
@@ -68657,8 +68649,8 @@ var ts;
|
|
|
68657
68649
|
}
|
|
68658
68650
|
function getSingleTypeVariableFromIntersectionTypes(types) {
|
|
68659
68651
|
var typeVariable;
|
|
68660
|
-
for (var _i = 0,
|
|
68661
|
-
var type =
|
|
68652
|
+
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
68653
|
+
var type = types_14[_i];
|
|
68662
68654
|
var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
|
|
68663
68655
|
if (!t || typeVariable && t !== typeVariable) {
|
|
68664
68656
|
return undefined;
|
|
@@ -69411,8 +69403,8 @@ var ts;
|
|
|
69411
69403
|
}
|
|
69412
69404
|
}
|
|
69413
69405
|
};
|
|
69414
|
-
for (var _i = 0,
|
|
69415
|
-
var type =
|
|
69406
|
+
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
69407
|
+
var type = types_15[_i];
|
|
69416
69408
|
var state_9 = _loop_24(type);
|
|
69417
69409
|
if (typeof state_9 === "object")
|
|
69418
69410
|
return state_9.value;
|
|
@@ -69527,14 +69519,16 @@ var ts;
|
|
|
69527
69519
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
|
|
69528
69520
|
resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
69529
69521
|
}
|
|
69530
|
-
function getTypeFacts(type
|
|
69531
|
-
if (
|
|
69522
|
+
function getTypeFacts(type) {
|
|
69523
|
+
if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
|
|
69524
|
+
type = getBaseConstraintOfType(type) || unknownType;
|
|
69525
|
+
}
|
|
69532
69526
|
var flags = type.flags;
|
|
69533
|
-
if (flags & 4 /* String */) {
|
|
69527
|
+
if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
|
|
69534
69528
|
return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
|
|
69535
69529
|
}
|
|
69536
|
-
if (flags & 128 /* StringLiteral */) {
|
|
69537
|
-
var isEmpty = type.value === "";
|
|
69530
|
+
if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
|
|
69531
|
+
var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
|
|
69538
69532
|
return strictNullChecks ?
|
|
69539
69533
|
isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
|
|
69540
69534
|
isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
@@ -69566,20 +69560,20 @@ var ts;
|
|
|
69566
69560
|
(type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
|
|
69567
69561
|
}
|
|
69568
69562
|
if (flags & 524288 /* Object */) {
|
|
69569
|
-
if (ignoreObjects) {
|
|
69570
|
-
return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
|
|
69571
|
-
}
|
|
69572
69563
|
return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
|
|
69573
|
-
strictNullChecks ?
|
|
69564
|
+
strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
|
|
69574
69565
|
isFunctionObjectType(type) ?
|
|
69575
69566
|
strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
|
|
69576
69567
|
strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
|
|
69577
69568
|
}
|
|
69578
|
-
if (flags &
|
|
69579
|
-
return 9830144 /*
|
|
69569
|
+
if (flags & 16384 /* Void */) {
|
|
69570
|
+
return 9830144 /* VoidFacts */;
|
|
69571
|
+
}
|
|
69572
|
+
if (flags & 32768 /* Undefined */) {
|
|
69573
|
+
return 26607360 /* UndefinedFacts */;
|
|
69580
69574
|
}
|
|
69581
69575
|
if (flags & 65536 /* Null */) {
|
|
69582
|
-
return
|
|
69576
|
+
return 42917664 /* NullFacts */;
|
|
69583
69577
|
}
|
|
69584
69578
|
if (flags & 12288 /* ESSymbolLike */) {
|
|
69585
69579
|
return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
|
|
@@ -69590,38 +69584,39 @@ var ts;
|
|
|
69590
69584
|
if (flags & 131072 /* Never */) {
|
|
69591
69585
|
return 0 /* None */;
|
|
69592
69586
|
}
|
|
69593
|
-
if (flags & 465829888 /* Instantiable */) {
|
|
69594
|
-
return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
|
|
69595
|
-
strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
69596
|
-
}
|
|
69597
69587
|
if (flags & 1048576 /* Union */) {
|
|
69598
|
-
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t
|
|
69588
|
+
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
|
|
69599
69589
|
}
|
|
69600
69590
|
if (flags & 2097152 /* Intersection */) {
|
|
69601
|
-
|
|
69602
|
-
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69603
|
-
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
|
|
69604
|
-
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
69591
|
+
return getIntersectionTypeFacts(type);
|
|
69605
69592
|
}
|
|
69606
|
-
return
|
|
69593
|
+
return 83886079 /* UnknownFacts */;
|
|
69607
69594
|
}
|
|
69608
|
-
function getIntersectionTypeFacts(type
|
|
69595
|
+
function getIntersectionTypeFacts(type) {
|
|
69596
|
+
// When an intersection contains a primitive type we ignore object type constituents as they are
|
|
69597
|
+
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69598
|
+
var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
|
|
69609
69599
|
// When computing the type facts of an intersection type, certain type facts are computed as `and`
|
|
69610
69600
|
// and others are computed as `or`.
|
|
69611
69601
|
var oredFacts = 0 /* None */;
|
|
69612
|
-
var andedFacts =
|
|
69602
|
+
var andedFacts = 134217727 /* All */;
|
|
69613
69603
|
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
69614
69604
|
var t = _a[_i];
|
|
69615
|
-
|
|
69616
|
-
|
|
69617
|
-
|
|
69605
|
+
if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
|
|
69606
|
+
var f = getTypeFacts(t);
|
|
69607
|
+
oredFacts |= f;
|
|
69608
|
+
andedFacts &= f;
|
|
69609
|
+
}
|
|
69618
69610
|
}
|
|
69619
|
-
return oredFacts & 8256 /* OrFactsMask */ | andedFacts &
|
|
69611
|
+
return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
|
|
69620
69612
|
}
|
|
69621
69613
|
function getTypeWithFacts(type, include) {
|
|
69622
69614
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
69623
69615
|
}
|
|
69624
|
-
function
|
|
69616
|
+
// This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
|
|
69617
|
+
// unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
|
|
69618
|
+
// instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
|
|
69619
|
+
function getAdjustedTypeWithFacts(type, facts) {
|
|
69625
69620
|
var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
|
|
69626
69621
|
if (strictNullChecks) {
|
|
69627
69622
|
switch (facts) {
|
|
@@ -69887,8 +69882,8 @@ var ts;
|
|
|
69887
69882
|
var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
|
|
69888
69883
|
var mappedTypes;
|
|
69889
69884
|
var changed = false;
|
|
69890
|
-
for (var _i = 0,
|
|
69891
|
-
var t =
|
|
69885
|
+
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
|
|
69886
|
+
var t = types_16[_i];
|
|
69892
69887
|
var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
|
|
69893
69888
|
changed || (changed = t !== mapped);
|
|
69894
69889
|
if (mapped) {
|
|
@@ -69974,8 +69969,8 @@ var ts;
|
|
|
69974
69969
|
}
|
|
69975
69970
|
function isEvolvingArrayTypeList(types) {
|
|
69976
69971
|
var hasEvolvingArrayType = false;
|
|
69977
|
-
for (var _i = 0,
|
|
69978
|
-
var t =
|
|
69972
|
+
for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
|
|
69973
|
+
var t = types_17[_i];
|
|
69979
69974
|
if (!(t.flags & 131072 /* Never */)) {
|
|
69980
69975
|
if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
|
|
69981
69976
|
return false;
|
|
@@ -70798,10 +70793,10 @@ var ts;
|
|
|
70798
70793
|
}
|
|
70799
70794
|
function narrowTypeByTruthiness(type, expr, assumeTrue) {
|
|
70800
70795
|
if (isMatchingReference(reference, expr)) {
|
|
70801
|
-
return
|
|
70796
|
+
return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
|
|
70802
70797
|
}
|
|
70803
70798
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
|
|
70804
|
-
type =
|
|
70799
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
70805
70800
|
}
|
|
70806
70801
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
70807
70802
|
if (access) {
|
|
@@ -70941,7 +70936,7 @@ var ts;
|
|
|
70941
70936
|
// Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
|
|
70942
70937
|
var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
|
|
70943
70938
|
equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
|
|
70944
|
-
return removeNullable ?
|
|
70939
|
+
return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
70945
70940
|
}
|
|
70946
70941
|
function narrowTypeByEquality(type, operator, value, assumeTrue) {
|
|
70947
70942
|
if (type.flags & 1 /* Any */) {
|
|
@@ -70970,7 +70965,7 @@ var ts;
|
|
|
70970
70965
|
valueType.flags & 65536 /* Null */ ?
|
|
70971
70966
|
assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
|
|
70972
70967
|
assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
|
|
70973
|
-
return
|
|
70968
|
+
return getAdjustedTypeWithFacts(type, facts);
|
|
70974
70969
|
}
|
|
70975
70970
|
if (assumeTrue) {
|
|
70976
70971
|
var filterFn = operator === 34 /* EqualsEqualsToken */ ?
|
|
@@ -70991,7 +70986,7 @@ var ts;
|
|
|
70991
70986
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
70992
70987
|
if (!isMatchingReference(reference, target)) {
|
|
70993
70988
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
70994
|
-
return
|
|
70989
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
70995
70990
|
}
|
|
70996
70991
|
return type;
|
|
70997
70992
|
}
|
|
@@ -71195,7 +71190,7 @@ var ts;
|
|
|
71195
71190
|
var left = getReferenceCandidate(expr.left);
|
|
71196
71191
|
if (!isMatchingReference(reference, left)) {
|
|
71197
71192
|
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
|
71198
|
-
return
|
|
71193
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71199
71194
|
}
|
|
71200
71195
|
return type;
|
|
71201
71196
|
}
|
|
@@ -71283,7 +71278,7 @@ var ts;
|
|
|
71283
71278
|
}
|
|
71284
71279
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
|
|
71285
71280
|
!(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
|
|
71286
|
-
type =
|
|
71281
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71287
71282
|
}
|
|
71288
71283
|
var access = getDiscriminantPropertyAccess(predicateArgument, type);
|
|
71289
71284
|
if (access) {
|
|
@@ -71340,7 +71335,7 @@ var ts;
|
|
|
71340
71335
|
}
|
|
71341
71336
|
function narrowTypeByOptionality(type, expr, assumePresent) {
|
|
71342
71337
|
if (isMatchingReference(reference, expr)) {
|
|
71343
|
-
return
|
|
71338
|
+
return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
|
|
71344
71339
|
}
|
|
71345
71340
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
71346
71341
|
if (access) {
|
|
@@ -71426,8 +71421,8 @@ var ts;
|
|
|
71426
71421
|
var annotationIncludesUndefined = strictNullChecks &&
|
|
71427
71422
|
declaration.kind === 164 /* Parameter */ &&
|
|
71428
71423
|
declaration.initializer &&
|
|
71429
|
-
|
|
71430
|
-
!(
|
|
71424
|
+
getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
|
|
71425
|
+
!(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
|
|
71431
71426
|
popTypeResolution();
|
|
71432
71427
|
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
|
|
71433
71428
|
}
|
|
@@ -71755,7 +71750,7 @@ var ts;
|
|
|
71755
71750
|
return convertAutoToAny(flowType);
|
|
71756
71751
|
}
|
|
71757
71752
|
}
|
|
71758
|
-
else if (!assumeInitialized && !(
|
|
71753
|
+
else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
71759
71754
|
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
|
71760
71755
|
// Return the declared type to reduce follow-on errors
|
|
71761
71756
|
return type;
|
|
@@ -73284,8 +73279,8 @@ var ts;
|
|
|
73284
73279
|
}
|
|
73285
73280
|
var signatureList;
|
|
73286
73281
|
var types = type.types;
|
|
73287
|
-
for (var _i = 0,
|
|
73288
|
-
var current =
|
|
73282
|
+
for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
|
|
73283
|
+
var current = types_18[_i];
|
|
73289
73284
|
var signature = getContextualCallSignature(current, node);
|
|
73290
73285
|
if (signature) {
|
|
73291
73286
|
if (!signatureList) {
|
|
@@ -74447,19 +74442,19 @@ var ts;
|
|
|
74447
74442
|
return checkNonNullType(checkExpression(node), node);
|
|
74448
74443
|
}
|
|
74449
74444
|
function isNullableType(type) {
|
|
74450
|
-
return !!((
|
|
74445
|
+
return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
|
|
74451
74446
|
}
|
|
74452
74447
|
function getNonNullableTypeIfNeeded(type) {
|
|
74453
74448
|
return isNullableType(type) ? getNonNullableType(type) : type;
|
|
74454
74449
|
}
|
|
74455
|
-
function reportObjectPossiblyNullOrUndefinedError(node,
|
|
74456
|
-
error(node,
|
|
74450
|
+
function reportObjectPossiblyNullOrUndefinedError(node, facts) {
|
|
74451
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74457
74452
|
ts.Diagnostics.Object_is_possibly_null_or_undefined :
|
|
74458
74453
|
ts.Diagnostics.Object_is_possibly_undefined :
|
|
74459
74454
|
ts.Diagnostics.Object_is_possibly_null);
|
|
74460
74455
|
}
|
|
74461
|
-
function reportCannotInvokePossiblyNullOrUndefinedError(node,
|
|
74462
|
-
error(node,
|
|
74456
|
+
function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
|
|
74457
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74463
74458
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
|
|
74464
74459
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
|
|
74465
74460
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
|
|
@@ -74469,9 +74464,9 @@ var ts;
|
|
|
74469
74464
|
error(node, ts.Diagnostics.Object_is_of_type_unknown);
|
|
74470
74465
|
return errorType;
|
|
74471
74466
|
}
|
|
74472
|
-
var
|
|
74473
|
-
if (
|
|
74474
|
-
reportError(node,
|
|
74467
|
+
var facts = getTypeFacts(type);
|
|
74468
|
+
if (facts & 50331648 /* IsUndefinedOrNull */) {
|
|
74469
|
+
reportError(node, facts);
|
|
74475
74470
|
var t = getNonNullableType(type);
|
|
74476
74471
|
return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
|
|
74477
74472
|
}
|
|
@@ -74766,7 +74761,7 @@ var ts;
|
|
|
74766
74761
|
assumeUninitialized = true;
|
|
74767
74762
|
}
|
|
74768
74763
|
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
|
|
74769
|
-
if (assumeUninitialized && !(
|
|
74764
|
+
if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
74770
74765
|
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
|
|
74771
74766
|
// Return the declared type to reduce follow-on errors
|
|
74772
74767
|
return propType;
|
|
@@ -76682,8 +76677,8 @@ var ts;
|
|
|
76682
76677
|
if (apparentType.flags & 1048576 /* Union */) {
|
|
76683
76678
|
var types = apparentType.types;
|
|
76684
76679
|
var hasSignatures = false;
|
|
76685
|
-
for (var _i = 0,
|
|
76686
|
-
var constituent =
|
|
76680
|
+
for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
|
|
76681
|
+
var constituent = types_19[_i];
|
|
76687
76682
|
var signatures = getSignaturesOfType(constituent, kind);
|
|
76688
76683
|
if (signatures.length !== 0) {
|
|
76689
76684
|
hasSignatures = true;
|
|
@@ -78374,7 +78369,7 @@ var ts;
|
|
|
78374
78369
|
var type = getTypeOfSymbol(symbol);
|
|
78375
78370
|
if (strictNullChecks &&
|
|
78376
78371
|
!(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
|
|
78377
|
-
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ :
|
|
78372
|
+
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
78378
78373
|
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
78379
78374
|
}
|
|
78380
78375
|
}
|
|
@@ -78542,8 +78537,8 @@ var ts;
|
|
|
78542
78537
|
}
|
|
78543
78538
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
78544
78539
|
var types = type.types;
|
|
78545
|
-
for (var _i = 0,
|
|
78546
|
-
var t =
|
|
78540
|
+
for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
|
|
78541
|
+
var t = types_20[_i];
|
|
78547
78542
|
if (maybeTypeOfKind(t, kind)) {
|
|
78548
78543
|
return true;
|
|
78549
78544
|
}
|
|
@@ -78770,7 +78765,7 @@ var ts;
|
|
|
78770
78765
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
78771
78766
|
// undefined from the final type.
|
|
78772
78767
|
if (strictNullChecks &&
|
|
78773
|
-
!(
|
|
78768
|
+
!(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
|
|
78774
78769
|
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
|
|
78775
78770
|
}
|
|
78776
78771
|
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
|
|
@@ -79170,7 +79165,7 @@ var ts;
|
|
|
79170
79165
|
case 56 /* BarBarToken */:
|
|
79171
79166
|
case 75 /* BarBarEqualsToken */: {
|
|
79172
79167
|
var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
|
|
79173
|
-
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
|
|
79168
|
+
getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
|
|
79174
79169
|
leftType;
|
|
79175
79170
|
if (operator === 75 /* BarBarEqualsToken */) {
|
|
79176
79171
|
checkAssignmentOperator(rightType);
|
|
@@ -81711,8 +81706,8 @@ var ts;
|
|
|
81711
81706
|
}
|
|
81712
81707
|
function getEntityNameForDecoratorMetadataFromTypeList(types) {
|
|
81713
81708
|
var commonEntityName;
|
|
81714
|
-
for (var _i = 0,
|
|
81715
|
-
var typeNode =
|
|
81709
|
+
for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
|
|
81710
|
+
var typeNode = types_21[_i];
|
|
81716
81711
|
while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
|
|
81717
81712
|
typeNode = typeNode.type; // Skip parens if need be
|
|
81718
81713
|
}
|
|
@@ -82731,7 +82726,7 @@ var ts;
|
|
|
82731
82726
|
return;
|
|
82732
82727
|
var type = checkTruthinessExpression(location);
|
|
82733
82728
|
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
82734
|
-
if (
|
|
82729
|
+
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
82735
82730
|
return;
|
|
82736
82731
|
// While it technically should be invalid for any known-truthy value
|
|
82737
82732
|
// to be tested, we de-scope to functions and Promises unreferenced in
|
|
@@ -84417,18 +84412,17 @@ var ts;
|
|
|
84417
84412
|
// but not by other kinds of members.
|
|
84418
84413
|
// Base class instance member variables and accessors can be overridden by
|
|
84419
84414
|
// derived class instance member variables and accessors, but not by other kinds of members.
|
|
84420
|
-
var _a, _b;
|
|
84415
|
+
var _a, _b, _c, _d;
|
|
84421
84416
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
84422
84417
|
var baseProperties = getPropertiesOfType(baseType);
|
|
84423
|
-
|
|
84424
|
-
var baseProperty = baseProperties_1[_i];
|
|
84418
|
+
var _loop_33 = function (baseProperty) {
|
|
84425
84419
|
var base = getTargetSymbol(baseProperty);
|
|
84426
84420
|
if (base.flags & 4194304 /* Prototype */) {
|
|
84427
|
-
continue;
|
|
84421
|
+
return "continue";
|
|
84428
84422
|
}
|
|
84429
84423
|
var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
|
|
84430
84424
|
if (!baseSymbol) {
|
|
84431
|
-
continue;
|
|
84425
|
+
return "continue";
|
|
84432
84426
|
}
|
|
84433
84427
|
var derived = getTargetSymbol(baseSymbol);
|
|
84434
84428
|
var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
|
|
@@ -84446,14 +84440,14 @@ var ts;
|
|
|
84446
84440
|
// Searches other base types for a declaration that would satisfy the inherited abstract member.
|
|
84447
84441
|
// (The class may have more than one base type via declaration merging with an interface with the
|
|
84448
84442
|
// same name.)
|
|
84449
|
-
for (var
|
|
84450
|
-
var otherBaseType =
|
|
84443
|
+
for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
|
|
84444
|
+
var otherBaseType = _f[_e];
|
|
84451
84445
|
if (otherBaseType === baseType)
|
|
84452
84446
|
continue;
|
|
84453
84447
|
var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
|
|
84454
84448
|
var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
|
|
84455
84449
|
if (derivedElsewhere && derivedElsewhere !== base) {
|
|
84456
|
-
continue
|
|
84450
|
+
return "continue-basePropertyCheck";
|
|
84457
84451
|
}
|
|
84458
84452
|
}
|
|
84459
84453
|
if (derivedClassDecl.kind === 226 /* ClassExpression */) {
|
|
@@ -84468,20 +84462,19 @@ var ts;
|
|
|
84468
84462
|
// derived overrides base.
|
|
84469
84463
|
var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
|
|
84470
84464
|
if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
|
|
84471
|
-
|
|
84472
|
-
continue;
|
|
84465
|
+
return "continue";
|
|
84473
84466
|
}
|
|
84474
84467
|
var errorMessage = void 0;
|
|
84475
84468
|
var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
84476
84469
|
var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
84477
84470
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
84478
84471
|
// property/accessor is overridden with property/accessor
|
|
84479
|
-
if (
|
|
84480
|
-
|
|
84472
|
+
if ((ts.getCheckFlags(base) & 6 /* Synthetic */
|
|
84473
|
+
? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
|
|
84474
|
+
: (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
|
|
84475
|
+
|| ts.getCheckFlags(base) & 262144 /* Mapped */
|
|
84481
84476
|
|| derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
|
|
84482
|
-
|
|
84483
|
-
// same when the derived property is from an assignment
|
|
84484
|
-
continue;
|
|
84477
|
+
return "continue";
|
|
84485
84478
|
}
|
|
84486
84479
|
var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
84487
84480
|
var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
|
|
@@ -84492,12 +84485,12 @@ var ts;
|
|
|
84492
84485
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
84493
84486
|
}
|
|
84494
84487
|
else if (useDefineForClassFields) {
|
|
84495
|
-
var uninitialized = (
|
|
84488
|
+
var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
|
|
84496
84489
|
if (uninitialized
|
|
84497
84490
|
&& !(derived.flags & 33554432 /* Transient */)
|
|
84498
84491
|
&& !(baseDeclarationFlags & 128 /* Abstract */)
|
|
84499
84492
|
&& !(derivedDeclarationFlags & 128 /* Abstract */)
|
|
84500
|
-
&& !((
|
|
84493
|
+
&& !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
|
|
84501
84494
|
var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
|
|
84502
84495
|
var propName = uninitialized.name;
|
|
84503
84496
|
if (uninitialized.exclamationToken
|
|
@@ -84510,13 +84503,11 @@ var ts;
|
|
|
84510
84503
|
}
|
|
84511
84504
|
}
|
|
84512
84505
|
}
|
|
84513
|
-
|
|
84514
|
-
continue;
|
|
84506
|
+
return "continue";
|
|
84515
84507
|
}
|
|
84516
84508
|
else if (isPrototypeProperty(base)) {
|
|
84517
84509
|
if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
|
|
84518
|
-
|
|
84519
|
-
continue;
|
|
84510
|
+
return "continue";
|
|
84520
84511
|
}
|
|
84521
84512
|
else {
|
|
84522
84513
|
ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
|
|
@@ -84531,9 +84522,20 @@ var ts;
|
|
|
84531
84522
|
}
|
|
84532
84523
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
|
|
84533
84524
|
}
|
|
84525
|
+
};
|
|
84526
|
+
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
84527
|
+
var baseProperty = baseProperties_1[_i];
|
|
84528
|
+
var state_10 = _loop_33(baseProperty);
|
|
84529
|
+
switch (state_10) {
|
|
84530
|
+
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
84531
|
+
}
|
|
84534
84532
|
}
|
|
84535
84533
|
}
|
|
84536
|
-
function
|
|
84534
|
+
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
84535
|
+
return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
|
|
84536
|
+
|| ts.isInterfaceDeclaration(declaration.parent);
|
|
84537
|
+
}
|
|
84538
|
+
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
84537
84539
|
if (!ts.length(baseTypes)) {
|
|
84538
84540
|
return properties;
|
|
84539
84541
|
}
|
|
@@ -84602,7 +84604,7 @@ var ts;
|
|
|
84602
84604
|
var propName = member.name;
|
|
84603
84605
|
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
84604
84606
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
84605
|
-
if (!(type.flags & 3 /* AnyOrUnknown */ ||
|
|
84607
|
+
if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
84606
84608
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
84607
84609
|
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
|
|
84608
84610
|
}
|
|
@@ -84627,7 +84629,7 @@ var ts;
|
|
|
84627
84629
|
ts.setParent(reference, staticBlock);
|
|
84628
84630
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
84629
84631
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84630
|
-
if (!(
|
|
84632
|
+
if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
|
|
84631
84633
|
return true;
|
|
84632
84634
|
}
|
|
84633
84635
|
}
|
|
@@ -84642,7 +84644,7 @@ var ts;
|
|
|
84642
84644
|
ts.setParent(reference, constructor);
|
|
84643
84645
|
reference.flowNode = constructor.returnFlowNode;
|
|
84644
84646
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84645
|
-
return !(
|
|
84647
|
+
return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
|
|
84646
84648
|
}
|
|
84647
84649
|
function checkInterfaceDeclaration(node) {
|
|
84648
84650
|
// Grammar checking
|
|
@@ -92930,8 +92932,8 @@ var ts;
|
|
|
92930
92932
|
// Note when updating logic here also update getEntityNameForDecoratorMetadata
|
|
92931
92933
|
// so that aliases can be marked as referenced
|
|
92932
92934
|
var serializedUnion;
|
|
92933
|
-
for (var _i = 0,
|
|
92934
|
-
var typeNode =
|
|
92935
|
+
for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
|
|
92936
|
+
var typeNode = types_22[_i];
|
|
92935
92937
|
while (typeNode.kind === 191 /* ParenthesizedType */) {
|
|
92936
92938
|
typeNode = typeNode.type; // Skip parens if need be
|
|
92937
92939
|
}
|
|
@@ -113546,8 +113548,8 @@ var ts;
|
|
|
113546
113548
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
113547
113549
|
writeLine();
|
|
113548
113550
|
}
|
|
113549
|
-
for (var _d = 0,
|
|
113550
|
-
var directive =
|
|
113551
|
+
for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
|
|
113552
|
+
var directive = types_23[_d];
|
|
113551
113553
|
var pos = writer.getTextPos();
|
|
113552
113554
|
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
113553
113555
|
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
@@ -122315,7 +122317,7 @@ var ts;
|
|
|
122315
122317
|
});
|
|
122316
122318
|
// Sort by paths closest to importing file Name directory
|
|
122317
122319
|
var sortedPaths = [];
|
|
122318
|
-
var
|
|
122320
|
+
var _loop_34 = function (directory) {
|
|
122319
122321
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
122320
122322
|
var pathsInDirectory;
|
|
122321
122323
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -122339,9 +122341,9 @@ var ts;
|
|
|
122339
122341
|
};
|
|
122340
122342
|
var out_directory_1;
|
|
122341
122343
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
122342
|
-
var
|
|
122344
|
+
var state_11 = _loop_34(directory);
|
|
122343
122345
|
directory = out_directory_1;
|
|
122344
|
-
if (
|
|
122346
|
+
if (state_11 === "break")
|
|
122345
122347
|
break;
|
|
122346
122348
|
}
|
|
122347
122349
|
if (allFileNames.size) {
|