@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
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -9102,6 +9102,7 @@ var ts;
|
|
|
9102
9102
|
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."),
|
|
9103
9103
|
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."),
|
|
9104
9104
|
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."),
|
|
9105
|
+
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"),
|
|
9105
9106
|
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}'."),
|
|
9106
9107
|
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}'."),
|
|
9107
9108
|
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}'."),
|
|
@@ -44371,8 +44372,8 @@ var ts;
|
|
|
44371
44372
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
44372
44373
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
44373
44374
|
if (!pathAndExtension && packageInfo
|
|
44374
|
-
|
|
44375
|
-
&& packageInfo.packageJsonContent.
|
|
44375
|
+
// eslint-disable-next-line no-null/no-null
|
|
44376
|
+
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
44376
44377
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
44377
44378
|
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
44378
44379
|
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
@@ -48037,7 +48038,10 @@ var ts;
|
|
|
48037
48038
|
TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
|
|
48038
48039
|
TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
|
|
48039
48040
|
TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
|
|
48040
|
-
TypeFacts[TypeFacts["
|
|
48041
|
+
TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
|
|
48042
|
+
TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
|
|
48043
|
+
TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
|
|
48044
|
+
TypeFacts[TypeFacts["All"] = 134217727] = "All";
|
|
48041
48045
|
// The following members encode facts about particular kinds of types for use in the getTypeFacts function.
|
|
48042
48046
|
// The presence of a particular fact means that the given test is true for some (and possibly all) values
|
|
48043
48047
|
// of that kind of type.
|
|
@@ -48079,14 +48083,16 @@ var ts;
|
|
|
48079
48083
|
TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
|
|
48080
48084
|
TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
|
|
48081
48085
|
TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
|
|
48082
|
-
TypeFacts[TypeFacts["
|
|
48083
|
-
TypeFacts[TypeFacts["
|
|
48084
|
-
TypeFacts[TypeFacts["
|
|
48086
|
+
TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
|
|
48087
|
+
TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
|
|
48088
|
+
TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
|
|
48089
|
+
TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
|
|
48090
|
+
TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
|
|
48091
|
+
TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
|
|
48085
48092
|
TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
|
|
48086
|
-
TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
|
|
48087
48093
|
// Masks
|
|
48088
48094
|
TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
|
|
48089
|
-
TypeFacts[TypeFacts["AndFactsMask"] =
|
|
48095
|
+
TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
48090
48096
|
})(TypeFacts || (TypeFacts = {}));
|
|
48091
48097
|
var typeofEQFacts = new ts.Map(ts.getEntries({
|
|
48092
48098
|
string: 1 /* TypeofEQString */,
|
|
@@ -50250,7 +50256,12 @@ var ts;
|
|
|
50250
50256
|
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
|
|
50251
50257
|
if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
|
|
50252
50258
|
if (isPrimitiveTypeName(name)) {
|
|
50253
|
-
|
|
50259
|
+
if (isExtendedByInterface(errorLocation)) {
|
|
50260
|
+
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));
|
|
50261
|
+
}
|
|
50262
|
+
else {
|
|
50263
|
+
error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
|
|
50264
|
+
}
|
|
50254
50265
|
return true;
|
|
50255
50266
|
}
|
|
50256
50267
|
var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
|
|
@@ -50270,6 +50281,16 @@ var ts;
|
|
|
50270
50281
|
}
|
|
50271
50282
|
return false;
|
|
50272
50283
|
}
|
|
50284
|
+
function isExtendedByInterface(node) {
|
|
50285
|
+
var grandparent = node.parent.parent;
|
|
50286
|
+
var parentOfGrandparent = grandparent.parent;
|
|
50287
|
+
if (grandparent && parentOfGrandparent) {
|
|
50288
|
+
var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
|
|
50289
|
+
var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
|
|
50290
|
+
return isExtending && isInterface;
|
|
50291
|
+
}
|
|
50292
|
+
return false;
|
|
50293
|
+
}
|
|
50273
50294
|
function maybeMappedType(node, symbol) {
|
|
50274
50295
|
var container = ts.findAncestor(node.parent, function (n) {
|
|
50275
50296
|
return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
|
|
@@ -53110,7 +53131,7 @@ var ts;
|
|
|
53110
53131
|
anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
53111
53132
|
var saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
53112
53133
|
context.enclosingDeclaration = undefined;
|
|
53113
|
-
if (context.tracker.trackSymbol &&
|
|
53134
|
+
if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
|
|
53114
53135
|
if (propertySymbol.declarations) {
|
|
53115
53136
|
var decl = ts.first(propertySymbol.declarations);
|
|
53116
53137
|
if (hasLateBindableName(decl)) {
|
|
@@ -54794,7 +54815,7 @@ var ts;
|
|
|
54794
54815
|
? getBaseConstructorTypeOfClass(staticType)
|
|
54795
54816
|
: anyType;
|
|
54796
54817
|
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);
|
|
54797
|
-
var symbolProps =
|
|
54818
|
+
var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
54798
54819
|
var publicSymbolProps = ts.filter(symbolProps, function (s) {
|
|
54799
54820
|
// `valueDeclaration` could be undefined if inherited from
|
|
54800
54821
|
// a union/intersection base type, but inherited properties
|
|
@@ -55932,7 +55953,7 @@ var ts;
|
|
|
55932
55953
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
55933
55954
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
55934
55955
|
// undefined from the final type.
|
|
55935
|
-
return strictNullChecks && !(
|
|
55956
|
+
return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
|
|
55936
55957
|
}
|
|
55937
55958
|
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
55938
55959
|
}
|
|
@@ -59135,7 +59156,7 @@ var ts;
|
|
|
59135
59156
|
var objectType;
|
|
59136
59157
|
return !!(type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ &&
|
|
59137
59158
|
!isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
|
|
59138
|
-
!objectType
|
|
59159
|
+
!(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
59139
59160
|
}
|
|
59140
59161
|
/**
|
|
59141
59162
|
* For a type parameter, return the base constraint of the type parameter. For the string, number,
|
|
@@ -64427,7 +64448,7 @@ var ts;
|
|
|
64427
64448
|
var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
|
|
64428
64449
|
var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
|
|
64429
64450
|
var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
|
|
64430
|
-
(
|
|
64451
|
+
(getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
|
|
64431
64452
|
var related = callbacks ?
|
|
64432
64453
|
compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
|
|
64433
64454
|
!(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
|
|
@@ -67645,30 +67666,8 @@ var ts;
|
|
|
67645
67666
|
var value = _a.value;
|
|
67646
67667
|
return value.base10Value === "0";
|
|
67647
67668
|
}
|
|
67648
|
-
function getFalsyFlagsOfTypes(types) {
|
|
67649
|
-
var result = 0;
|
|
67650
|
-
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
67651
|
-
var t = types_14[_i];
|
|
67652
|
-
result |= getFalsyFlags(t);
|
|
67653
|
-
}
|
|
67654
|
-
return result;
|
|
67655
|
-
}
|
|
67656
|
-
// Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
|
|
67657
|
-
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
|
67658
|
-
// no flags for all other types (including non-falsy literal types).
|
|
67659
|
-
function getFalsyFlags(type) {
|
|
67660
|
-
var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
|
|
67661
|
-
return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
|
|
67662
|
-
t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
|
|
67663
|
-
t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
|
|
67664
|
-
t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
|
|
67665
|
-
t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
|
|
67666
|
-
t.flags & 117724 /* PossiblyFalsy */;
|
|
67667
|
-
}
|
|
67668
67669
|
function removeDefinitelyFalsyTypes(type) {
|
|
67669
|
-
return
|
|
67670
|
-
filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
|
|
67671
|
-
type;
|
|
67670
|
+
return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
|
|
67672
67671
|
}
|
|
67673
67672
|
function extractDefinitelyFalsyTypes(type) {
|
|
67674
67673
|
return mapType(type, getDefinitelyFalsyPartOfType);
|
|
@@ -67711,14 +67710,7 @@ var ts;
|
|
|
67711
67710
|
getIntersectionType([type, emptyObjectType]);
|
|
67712
67711
|
}
|
|
67713
67712
|
function getNonNullableType(type) {
|
|
67714
|
-
|
|
67715
|
-
// First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
|
|
67716
|
-
// 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
|
|
67717
|
-
// that isn't eliminated by a NonNullable<T> instantiation.
|
|
67718
|
-
var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
67719
|
-
return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
|
|
67720
|
-
}
|
|
67721
|
-
return type;
|
|
67713
|
+
return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
67722
67714
|
}
|
|
67723
67715
|
function addOptionalTypeMarker(type) {
|
|
67724
67716
|
return strictNullChecks ? getUnionType([type, optionalType]) : type;
|
|
@@ -68862,8 +68854,8 @@ var ts;
|
|
|
68862
68854
|
}
|
|
68863
68855
|
function getSingleTypeVariableFromIntersectionTypes(types) {
|
|
68864
68856
|
var typeVariable;
|
|
68865
|
-
for (var _i = 0,
|
|
68866
|
-
var type =
|
|
68857
|
+
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
68858
|
+
var type = types_14[_i];
|
|
68867
68859
|
var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
|
|
68868
68860
|
if (!t || typeVariable && t !== typeVariable) {
|
|
68869
68861
|
return undefined;
|
|
@@ -69616,8 +69608,8 @@ var ts;
|
|
|
69616
69608
|
}
|
|
69617
69609
|
}
|
|
69618
69610
|
};
|
|
69619
|
-
for (var _i = 0,
|
|
69620
|
-
var type =
|
|
69611
|
+
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
69612
|
+
var type = types_15[_i];
|
|
69621
69613
|
var state_9 = _loop_24(type);
|
|
69622
69614
|
if (typeof state_9 === "object")
|
|
69623
69615
|
return state_9.value;
|
|
@@ -69732,14 +69724,16 @@ var ts;
|
|
|
69732
69724
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
|
|
69733
69725
|
resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
69734
69726
|
}
|
|
69735
|
-
function getTypeFacts(type
|
|
69736
|
-
if (
|
|
69727
|
+
function getTypeFacts(type) {
|
|
69728
|
+
if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
|
|
69729
|
+
type = getBaseConstraintOfType(type) || unknownType;
|
|
69730
|
+
}
|
|
69737
69731
|
var flags = type.flags;
|
|
69738
|
-
if (flags & 4 /* String */) {
|
|
69732
|
+
if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
|
|
69739
69733
|
return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
|
|
69740
69734
|
}
|
|
69741
|
-
if (flags & 128 /* StringLiteral */) {
|
|
69742
|
-
var isEmpty = type.value === "";
|
|
69735
|
+
if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
|
|
69736
|
+
var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
|
|
69743
69737
|
return strictNullChecks ?
|
|
69744
69738
|
isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
|
|
69745
69739
|
isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
@@ -69771,20 +69765,20 @@ var ts;
|
|
|
69771
69765
|
(type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
|
|
69772
69766
|
}
|
|
69773
69767
|
if (flags & 524288 /* Object */) {
|
|
69774
|
-
if (ignoreObjects) {
|
|
69775
|
-
return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
|
|
69776
|
-
}
|
|
69777
69768
|
return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
|
|
69778
|
-
strictNullChecks ?
|
|
69769
|
+
strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
|
|
69779
69770
|
isFunctionObjectType(type) ?
|
|
69780
69771
|
strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
|
|
69781
69772
|
strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
|
|
69782
69773
|
}
|
|
69783
|
-
if (flags &
|
|
69784
|
-
return 9830144 /*
|
|
69774
|
+
if (flags & 16384 /* Void */) {
|
|
69775
|
+
return 9830144 /* VoidFacts */;
|
|
69776
|
+
}
|
|
69777
|
+
if (flags & 32768 /* Undefined */) {
|
|
69778
|
+
return 26607360 /* UndefinedFacts */;
|
|
69785
69779
|
}
|
|
69786
69780
|
if (flags & 65536 /* Null */) {
|
|
69787
|
-
return
|
|
69781
|
+
return 42917664 /* NullFacts */;
|
|
69788
69782
|
}
|
|
69789
69783
|
if (flags & 12288 /* ESSymbolLike */) {
|
|
69790
69784
|
return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
|
|
@@ -69795,38 +69789,39 @@ var ts;
|
|
|
69795
69789
|
if (flags & 131072 /* Never */) {
|
|
69796
69790
|
return 0 /* None */;
|
|
69797
69791
|
}
|
|
69798
|
-
if (flags & 465829888 /* Instantiable */) {
|
|
69799
|
-
return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
|
|
69800
|
-
strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
69801
|
-
}
|
|
69802
69792
|
if (flags & 1048576 /* Union */) {
|
|
69803
|
-
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t
|
|
69793
|
+
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
|
|
69804
69794
|
}
|
|
69805
69795
|
if (flags & 2097152 /* Intersection */) {
|
|
69806
|
-
|
|
69807
|
-
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69808
|
-
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
|
|
69809
|
-
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
69796
|
+
return getIntersectionTypeFacts(type);
|
|
69810
69797
|
}
|
|
69811
|
-
return
|
|
69798
|
+
return 83886079 /* UnknownFacts */;
|
|
69812
69799
|
}
|
|
69813
|
-
function getIntersectionTypeFacts(type
|
|
69800
|
+
function getIntersectionTypeFacts(type) {
|
|
69801
|
+
// When an intersection contains a primitive type we ignore object type constituents as they are
|
|
69802
|
+
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69803
|
+
var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
|
|
69814
69804
|
// When computing the type facts of an intersection type, certain type facts are computed as `and`
|
|
69815
69805
|
// and others are computed as `or`.
|
|
69816
69806
|
var oredFacts = 0 /* None */;
|
|
69817
|
-
var andedFacts =
|
|
69807
|
+
var andedFacts = 134217727 /* All */;
|
|
69818
69808
|
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
69819
69809
|
var t = _a[_i];
|
|
69820
|
-
|
|
69821
|
-
|
|
69822
|
-
|
|
69810
|
+
if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
|
|
69811
|
+
var f = getTypeFacts(t);
|
|
69812
|
+
oredFacts |= f;
|
|
69813
|
+
andedFacts &= f;
|
|
69814
|
+
}
|
|
69823
69815
|
}
|
|
69824
|
-
return oredFacts & 8256 /* OrFactsMask */ | andedFacts &
|
|
69816
|
+
return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
|
|
69825
69817
|
}
|
|
69826
69818
|
function getTypeWithFacts(type, include) {
|
|
69827
69819
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
69828
69820
|
}
|
|
69829
|
-
function
|
|
69821
|
+
// This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
|
|
69822
|
+
// unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
|
|
69823
|
+
// instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
|
|
69824
|
+
function getAdjustedTypeWithFacts(type, facts) {
|
|
69830
69825
|
var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
|
|
69831
69826
|
if (strictNullChecks) {
|
|
69832
69827
|
switch (facts) {
|
|
@@ -70092,8 +70087,8 @@ var ts;
|
|
|
70092
70087
|
var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
|
|
70093
70088
|
var mappedTypes;
|
|
70094
70089
|
var changed = false;
|
|
70095
|
-
for (var _i = 0,
|
|
70096
|
-
var t =
|
|
70090
|
+
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
|
|
70091
|
+
var t = types_16[_i];
|
|
70097
70092
|
var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
|
|
70098
70093
|
changed || (changed = t !== mapped);
|
|
70099
70094
|
if (mapped) {
|
|
@@ -70179,8 +70174,8 @@ var ts;
|
|
|
70179
70174
|
}
|
|
70180
70175
|
function isEvolvingArrayTypeList(types) {
|
|
70181
70176
|
var hasEvolvingArrayType = false;
|
|
70182
|
-
for (var _i = 0,
|
|
70183
|
-
var t =
|
|
70177
|
+
for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
|
|
70178
|
+
var t = types_17[_i];
|
|
70184
70179
|
if (!(t.flags & 131072 /* Never */)) {
|
|
70185
70180
|
if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
|
|
70186
70181
|
return false;
|
|
@@ -71003,10 +70998,10 @@ var ts;
|
|
|
71003
70998
|
}
|
|
71004
70999
|
function narrowTypeByTruthiness(type, expr, assumeTrue) {
|
|
71005
71000
|
if (isMatchingReference(reference, expr)) {
|
|
71006
|
-
return
|
|
71001
|
+
return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
|
|
71007
71002
|
}
|
|
71008
71003
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
|
|
71009
|
-
type =
|
|
71004
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71010
71005
|
}
|
|
71011
71006
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
71012
71007
|
if (access) {
|
|
@@ -71146,7 +71141,7 @@ var ts;
|
|
|
71146
71141
|
// Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
|
|
71147
71142
|
var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
|
|
71148
71143
|
equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
|
|
71149
|
-
return removeNullable ?
|
|
71144
|
+
return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
71150
71145
|
}
|
|
71151
71146
|
function narrowTypeByEquality(type, operator, value, assumeTrue) {
|
|
71152
71147
|
if (type.flags & 1 /* Any */) {
|
|
@@ -71175,7 +71170,7 @@ var ts;
|
|
|
71175
71170
|
valueType.flags & 65536 /* Null */ ?
|
|
71176
71171
|
assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
|
|
71177
71172
|
assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
|
|
71178
|
-
return
|
|
71173
|
+
return getAdjustedTypeWithFacts(type, facts);
|
|
71179
71174
|
}
|
|
71180
71175
|
if (assumeTrue) {
|
|
71181
71176
|
var filterFn = operator === 34 /* EqualsEqualsToken */ ?
|
|
@@ -71196,7 +71191,7 @@ var ts;
|
|
|
71196
71191
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
71197
71192
|
if (!isMatchingReference(reference, target)) {
|
|
71198
71193
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
71199
|
-
return
|
|
71194
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71200
71195
|
}
|
|
71201
71196
|
return type;
|
|
71202
71197
|
}
|
|
@@ -71400,7 +71395,7 @@ var ts;
|
|
|
71400
71395
|
var left = getReferenceCandidate(expr.left);
|
|
71401
71396
|
if (!isMatchingReference(reference, left)) {
|
|
71402
71397
|
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
|
71403
|
-
return
|
|
71398
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71404
71399
|
}
|
|
71405
71400
|
return type;
|
|
71406
71401
|
}
|
|
@@ -71488,7 +71483,7 @@ var ts;
|
|
|
71488
71483
|
}
|
|
71489
71484
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
|
|
71490
71485
|
!(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
|
|
71491
|
-
type =
|
|
71486
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71492
71487
|
}
|
|
71493
71488
|
var access = getDiscriminantPropertyAccess(predicateArgument, type);
|
|
71494
71489
|
if (access) {
|
|
@@ -71545,7 +71540,7 @@ var ts;
|
|
|
71545
71540
|
}
|
|
71546
71541
|
function narrowTypeByOptionality(type, expr, assumePresent) {
|
|
71547
71542
|
if (isMatchingReference(reference, expr)) {
|
|
71548
|
-
return
|
|
71543
|
+
return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
|
|
71549
71544
|
}
|
|
71550
71545
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
71551
71546
|
if (access) {
|
|
@@ -71631,8 +71626,8 @@ var ts;
|
|
|
71631
71626
|
var annotationIncludesUndefined = strictNullChecks &&
|
|
71632
71627
|
declaration.kind === 164 /* Parameter */ &&
|
|
71633
71628
|
declaration.initializer &&
|
|
71634
|
-
|
|
71635
|
-
!(
|
|
71629
|
+
getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
|
|
71630
|
+
!(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
|
|
71636
71631
|
popTypeResolution();
|
|
71637
71632
|
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
|
|
71638
71633
|
}
|
|
@@ -71960,7 +71955,7 @@ var ts;
|
|
|
71960
71955
|
return convertAutoToAny(flowType);
|
|
71961
71956
|
}
|
|
71962
71957
|
}
|
|
71963
|
-
else if (!assumeInitialized && !(
|
|
71958
|
+
else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
71964
71959
|
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
|
71965
71960
|
// Return the declared type to reduce follow-on errors
|
|
71966
71961
|
return type;
|
|
@@ -73489,8 +73484,8 @@ var ts;
|
|
|
73489
73484
|
}
|
|
73490
73485
|
var signatureList;
|
|
73491
73486
|
var types = type.types;
|
|
73492
|
-
for (var _i = 0,
|
|
73493
|
-
var current =
|
|
73487
|
+
for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
|
|
73488
|
+
var current = types_18[_i];
|
|
73494
73489
|
var signature = getContextualCallSignature(current, node);
|
|
73495
73490
|
if (signature) {
|
|
73496
73491
|
if (!signatureList) {
|
|
@@ -74652,19 +74647,19 @@ var ts;
|
|
|
74652
74647
|
return checkNonNullType(checkExpression(node), node);
|
|
74653
74648
|
}
|
|
74654
74649
|
function isNullableType(type) {
|
|
74655
|
-
return !!((
|
|
74650
|
+
return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
|
|
74656
74651
|
}
|
|
74657
74652
|
function getNonNullableTypeIfNeeded(type) {
|
|
74658
74653
|
return isNullableType(type) ? getNonNullableType(type) : type;
|
|
74659
74654
|
}
|
|
74660
|
-
function reportObjectPossiblyNullOrUndefinedError(node,
|
|
74661
|
-
error(node,
|
|
74655
|
+
function reportObjectPossiblyNullOrUndefinedError(node, facts) {
|
|
74656
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74662
74657
|
ts.Diagnostics.Object_is_possibly_null_or_undefined :
|
|
74663
74658
|
ts.Diagnostics.Object_is_possibly_undefined :
|
|
74664
74659
|
ts.Diagnostics.Object_is_possibly_null);
|
|
74665
74660
|
}
|
|
74666
|
-
function reportCannotInvokePossiblyNullOrUndefinedError(node,
|
|
74667
|
-
error(node,
|
|
74661
|
+
function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
|
|
74662
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74668
74663
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
|
|
74669
74664
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
|
|
74670
74665
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
|
|
@@ -74674,9 +74669,9 @@ var ts;
|
|
|
74674
74669
|
error(node, ts.Diagnostics.Object_is_of_type_unknown);
|
|
74675
74670
|
return errorType;
|
|
74676
74671
|
}
|
|
74677
|
-
var
|
|
74678
|
-
if (
|
|
74679
|
-
reportError(node,
|
|
74672
|
+
var facts = getTypeFacts(type);
|
|
74673
|
+
if (facts & 50331648 /* IsUndefinedOrNull */) {
|
|
74674
|
+
reportError(node, facts);
|
|
74680
74675
|
var t = getNonNullableType(type);
|
|
74681
74676
|
return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
|
|
74682
74677
|
}
|
|
@@ -74971,7 +74966,7 @@ var ts;
|
|
|
74971
74966
|
assumeUninitialized = true;
|
|
74972
74967
|
}
|
|
74973
74968
|
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
|
|
74974
|
-
if (assumeUninitialized && !(
|
|
74969
|
+
if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
74975
74970
|
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
|
|
74976
74971
|
// Return the declared type to reduce follow-on errors
|
|
74977
74972
|
return propType;
|
|
@@ -76887,8 +76882,8 @@ var ts;
|
|
|
76887
76882
|
if (apparentType.flags & 1048576 /* Union */) {
|
|
76888
76883
|
var types = apparentType.types;
|
|
76889
76884
|
var hasSignatures = false;
|
|
76890
|
-
for (var _i = 0,
|
|
76891
|
-
var constituent =
|
|
76885
|
+
for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
|
|
76886
|
+
var constituent = types_19[_i];
|
|
76892
76887
|
var signatures = getSignaturesOfType(constituent, kind);
|
|
76893
76888
|
if (signatures.length !== 0) {
|
|
76894
76889
|
hasSignatures = true;
|
|
@@ -78579,7 +78574,7 @@ var ts;
|
|
|
78579
78574
|
var type = getTypeOfSymbol(symbol);
|
|
78580
78575
|
if (strictNullChecks &&
|
|
78581
78576
|
!(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
|
|
78582
|
-
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ :
|
|
78577
|
+
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
78583
78578
|
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
78584
78579
|
}
|
|
78585
78580
|
}
|
|
@@ -78747,8 +78742,8 @@ var ts;
|
|
|
78747
78742
|
}
|
|
78748
78743
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
78749
78744
|
var types = type.types;
|
|
78750
|
-
for (var _i = 0,
|
|
78751
|
-
var t =
|
|
78745
|
+
for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
|
|
78746
|
+
var t = types_20[_i];
|
|
78752
78747
|
if (maybeTypeOfKind(t, kind)) {
|
|
78753
78748
|
return true;
|
|
78754
78749
|
}
|
|
@@ -78975,7 +78970,7 @@ var ts;
|
|
|
78975
78970
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
78976
78971
|
// undefined from the final type.
|
|
78977
78972
|
if (strictNullChecks &&
|
|
78978
|
-
!(
|
|
78973
|
+
!(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
|
|
78979
78974
|
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
|
|
78980
78975
|
}
|
|
78981
78976
|
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
|
|
@@ -79375,7 +79370,7 @@ var ts;
|
|
|
79375
79370
|
case 56 /* BarBarToken */:
|
|
79376
79371
|
case 75 /* BarBarEqualsToken */: {
|
|
79377
79372
|
var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
|
|
79378
|
-
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
|
|
79373
|
+
getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
|
|
79379
79374
|
leftType;
|
|
79380
79375
|
if (operator === 75 /* BarBarEqualsToken */) {
|
|
79381
79376
|
checkAssignmentOperator(rightType);
|
|
@@ -81916,8 +81911,8 @@ var ts;
|
|
|
81916
81911
|
}
|
|
81917
81912
|
function getEntityNameForDecoratorMetadataFromTypeList(types) {
|
|
81918
81913
|
var commonEntityName;
|
|
81919
|
-
for (var _i = 0,
|
|
81920
|
-
var typeNode =
|
|
81914
|
+
for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
|
|
81915
|
+
var typeNode = types_21[_i];
|
|
81921
81916
|
while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
|
|
81922
81917
|
typeNode = typeNode.type; // Skip parens if need be
|
|
81923
81918
|
}
|
|
@@ -82936,7 +82931,7 @@ var ts;
|
|
|
82936
82931
|
return;
|
|
82937
82932
|
var type = checkTruthinessExpression(location);
|
|
82938
82933
|
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
82939
|
-
if (
|
|
82934
|
+
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
82940
82935
|
return;
|
|
82941
82936
|
// While it technically should be invalid for any known-truthy value
|
|
82942
82937
|
// to be tested, we de-scope to functions and Promises unreferenced in
|
|
@@ -84622,18 +84617,17 @@ var ts;
|
|
|
84622
84617
|
// but not by other kinds of members.
|
|
84623
84618
|
// Base class instance member variables and accessors can be overridden by
|
|
84624
84619
|
// derived class instance member variables and accessors, but not by other kinds of members.
|
|
84625
|
-
var _a, _b;
|
|
84620
|
+
var _a, _b, _c, _d;
|
|
84626
84621
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
84627
84622
|
var baseProperties = getPropertiesOfType(baseType);
|
|
84628
|
-
|
|
84629
|
-
var baseProperty = baseProperties_1[_i];
|
|
84623
|
+
var _loop_33 = function (baseProperty) {
|
|
84630
84624
|
var base = getTargetSymbol(baseProperty);
|
|
84631
84625
|
if (base.flags & 4194304 /* Prototype */) {
|
|
84632
|
-
continue;
|
|
84626
|
+
return "continue";
|
|
84633
84627
|
}
|
|
84634
84628
|
var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
|
|
84635
84629
|
if (!baseSymbol) {
|
|
84636
|
-
continue;
|
|
84630
|
+
return "continue";
|
|
84637
84631
|
}
|
|
84638
84632
|
var derived = getTargetSymbol(baseSymbol);
|
|
84639
84633
|
var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
|
|
@@ -84651,14 +84645,14 @@ var ts;
|
|
|
84651
84645
|
// Searches other base types for a declaration that would satisfy the inherited abstract member.
|
|
84652
84646
|
// (The class may have more than one base type via declaration merging with an interface with the
|
|
84653
84647
|
// same name.)
|
|
84654
|
-
for (var
|
|
84655
|
-
var otherBaseType =
|
|
84648
|
+
for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
|
|
84649
|
+
var otherBaseType = _f[_e];
|
|
84656
84650
|
if (otherBaseType === baseType)
|
|
84657
84651
|
continue;
|
|
84658
84652
|
var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
|
|
84659
84653
|
var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
|
|
84660
84654
|
if (derivedElsewhere && derivedElsewhere !== base) {
|
|
84661
|
-
continue
|
|
84655
|
+
return "continue-basePropertyCheck";
|
|
84662
84656
|
}
|
|
84663
84657
|
}
|
|
84664
84658
|
if (derivedClassDecl.kind === 226 /* ClassExpression */) {
|
|
@@ -84673,20 +84667,19 @@ var ts;
|
|
|
84673
84667
|
// derived overrides base.
|
|
84674
84668
|
var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
|
|
84675
84669
|
if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
|
|
84676
|
-
|
|
84677
|
-
continue;
|
|
84670
|
+
return "continue";
|
|
84678
84671
|
}
|
|
84679
84672
|
var errorMessage = void 0;
|
|
84680
84673
|
var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
84681
84674
|
var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
84682
84675
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
84683
84676
|
// property/accessor is overridden with property/accessor
|
|
84684
|
-
if (
|
|
84685
|
-
|
|
84677
|
+
if ((ts.getCheckFlags(base) & 6 /* Synthetic */
|
|
84678
|
+
? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
|
|
84679
|
+
: (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
|
|
84680
|
+
|| ts.getCheckFlags(base) & 262144 /* Mapped */
|
|
84686
84681
|
|| derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
|
|
84687
|
-
|
|
84688
|
-
// same when the derived property is from an assignment
|
|
84689
|
-
continue;
|
|
84682
|
+
return "continue";
|
|
84690
84683
|
}
|
|
84691
84684
|
var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
84692
84685
|
var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
|
|
@@ -84697,12 +84690,12 @@ var ts;
|
|
|
84697
84690
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
84698
84691
|
}
|
|
84699
84692
|
else if (useDefineForClassFields) {
|
|
84700
|
-
var uninitialized = (
|
|
84693
|
+
var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
|
|
84701
84694
|
if (uninitialized
|
|
84702
84695
|
&& !(derived.flags & 33554432 /* Transient */)
|
|
84703
84696
|
&& !(baseDeclarationFlags & 128 /* Abstract */)
|
|
84704
84697
|
&& !(derivedDeclarationFlags & 128 /* Abstract */)
|
|
84705
|
-
&& !((
|
|
84698
|
+
&& !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
|
|
84706
84699
|
var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
|
|
84707
84700
|
var propName = uninitialized.name;
|
|
84708
84701
|
if (uninitialized.exclamationToken
|
|
@@ -84715,13 +84708,11 @@ var ts;
|
|
|
84715
84708
|
}
|
|
84716
84709
|
}
|
|
84717
84710
|
}
|
|
84718
|
-
|
|
84719
|
-
continue;
|
|
84711
|
+
return "continue";
|
|
84720
84712
|
}
|
|
84721
84713
|
else if (isPrototypeProperty(base)) {
|
|
84722
84714
|
if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
|
|
84723
|
-
|
|
84724
|
-
continue;
|
|
84715
|
+
return "continue";
|
|
84725
84716
|
}
|
|
84726
84717
|
else {
|
|
84727
84718
|
ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
|
|
@@ -84736,9 +84727,20 @@ var ts;
|
|
|
84736
84727
|
}
|
|
84737
84728
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
|
|
84738
84729
|
}
|
|
84730
|
+
};
|
|
84731
|
+
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
84732
|
+
var baseProperty = baseProperties_1[_i];
|
|
84733
|
+
var state_10 = _loop_33(baseProperty);
|
|
84734
|
+
switch (state_10) {
|
|
84735
|
+
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
84736
|
+
}
|
|
84739
84737
|
}
|
|
84740
84738
|
}
|
|
84741
|
-
function
|
|
84739
|
+
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
84740
|
+
return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
|
|
84741
|
+
|| ts.isInterfaceDeclaration(declaration.parent);
|
|
84742
|
+
}
|
|
84743
|
+
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
84742
84744
|
if (!ts.length(baseTypes)) {
|
|
84743
84745
|
return properties;
|
|
84744
84746
|
}
|
|
@@ -84807,7 +84809,7 @@ var ts;
|
|
|
84807
84809
|
var propName = member.name;
|
|
84808
84810
|
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
84809
84811
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
84810
|
-
if (!(type.flags & 3 /* AnyOrUnknown */ ||
|
|
84812
|
+
if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
84811
84813
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
84812
84814
|
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
|
|
84813
84815
|
}
|
|
@@ -84832,7 +84834,7 @@ var ts;
|
|
|
84832
84834
|
ts.setParent(reference, staticBlock);
|
|
84833
84835
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
84834
84836
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84835
|
-
if (!(
|
|
84837
|
+
if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
|
|
84836
84838
|
return true;
|
|
84837
84839
|
}
|
|
84838
84840
|
}
|
|
@@ -84847,7 +84849,7 @@ var ts;
|
|
|
84847
84849
|
ts.setParent(reference, constructor);
|
|
84848
84850
|
reference.flowNode = constructor.returnFlowNode;
|
|
84849
84851
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84850
|
-
return !(
|
|
84852
|
+
return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
|
|
84851
84853
|
}
|
|
84852
84854
|
function checkInterfaceDeclaration(node) {
|
|
84853
84855
|
// Grammar checking
|
|
@@ -93135,8 +93137,8 @@ var ts;
|
|
|
93135
93137
|
// Note when updating logic here also update getEntityNameForDecoratorMetadata
|
|
93136
93138
|
// so that aliases can be marked as referenced
|
|
93137
93139
|
var serializedUnion;
|
|
93138
|
-
for (var _i = 0,
|
|
93139
|
-
var typeNode =
|
|
93140
|
+
for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
|
|
93141
|
+
var typeNode = types_22[_i];
|
|
93140
93142
|
while (typeNode.kind === 191 /* ParenthesizedType */) {
|
|
93141
93143
|
typeNode = typeNode.type; // Skip parens if need be
|
|
93142
93144
|
}
|
|
@@ -113751,8 +113753,8 @@ var ts;
|
|
|
113751
113753
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
113752
113754
|
writeLine();
|
|
113753
113755
|
}
|
|
113754
|
-
for (var _d = 0,
|
|
113755
|
-
var directive =
|
|
113756
|
+
for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
|
|
113757
|
+
var directive = types_23[_d];
|
|
113756
113758
|
var pos = writer.getTextPos();
|
|
113757
113759
|
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
113758
113760
|
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
@@ -122520,7 +122522,7 @@ var ts;
|
|
|
122520
122522
|
});
|
|
122521
122523
|
// Sort by paths closest to importing file Name directory
|
|
122522
122524
|
var sortedPaths = [];
|
|
122523
|
-
var
|
|
122525
|
+
var _loop_34 = function (directory) {
|
|
122524
122526
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
122525
122527
|
var pathsInDirectory;
|
|
122526
122528
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -122544,9 +122546,9 @@ var ts;
|
|
|
122544
122546
|
};
|
|
122545
122547
|
var out_directory_1;
|
|
122546
122548
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
122547
|
-
var
|
|
122549
|
+
var state_11 = _loop_34(directory);
|
|
122548
122550
|
directory = out_directory_1;
|
|
122549
|
-
if (
|
|
122551
|
+
if (state_11 === "break")
|
|
122550
122552
|
break;
|
|
122551
122553
|
}
|
|
122552
122554
|
if (allFileNames.size) {
|
|
@@ -144707,7 +144709,7 @@ var ts;
|
|
|
144707
144709
|
if (!ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
|
|
144708
144710
|
return;
|
|
144709
144711
|
}
|
|
144710
|
-
if (ts.isTypeNode(node)) {
|
|
144712
|
+
if (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node)) {
|
|
144711
144713
|
return;
|
|
144712
144714
|
}
|
|
144713
144715
|
if (preferences.includeInlayVariableTypeHints && ts.isVariableDeclaration(node)) {
|
|
@@ -147818,7 +147820,6 @@ var ts;
|
|
|
147818
147820
|
case 280 /* JsxOpeningElement */:
|
|
147819
147821
|
case 281 /* JsxClosingElement */:
|
|
147820
147822
|
case 279 /* JsxSelfClosingElement */:
|
|
147821
|
-
case 228 /* ExpressionWithTypeArguments */:
|
|
147822
147823
|
return false;
|
|
147823
147824
|
}
|
|
147824
147825
|
break;
|
|
@@ -147988,7 +147989,7 @@ var ts;
|
|
|
147988
147989
|
var listEndToken = getCloseTokenForOpenToken(listStartToken);
|
|
147989
147990
|
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
|
|
147990
147991
|
var tokenInfo = formattingScanner.readTokenInfo(parent);
|
|
147991
|
-
if (tokenInfo.token.kind === 27 /* CommaToken */
|
|
147992
|
+
if (tokenInfo.token.kind === 27 /* CommaToken */) {
|
|
147992
147993
|
// consume the comma
|
|
147993
147994
|
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
|
|
147994
147995
|
tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent) : undefined;
|
|
@@ -148392,6 +148393,12 @@ var ts;
|
|
|
148392
148393
|
case 169 /* MethodDeclaration */:
|
|
148393
148394
|
case 168 /* MethodSignature */:
|
|
148394
148395
|
case 214 /* ArrowFunction */:
|
|
148396
|
+
case 174 /* CallSignature */:
|
|
148397
|
+
case 175 /* ConstructSignature */:
|
|
148398
|
+
case 179 /* FunctionType */:
|
|
148399
|
+
case 180 /* ConstructorType */:
|
|
148400
|
+
case 172 /* GetAccessor */:
|
|
148401
|
+
case 173 /* SetAccessor */:
|
|
148395
148402
|
if (node.typeParameters === list) {
|
|
148396
148403
|
return 29 /* LessThanToken */;
|
|
148397
148404
|
}
|
|
@@ -148408,7 +148415,19 @@ var ts;
|
|
|
148408
148415
|
return 20 /* OpenParenToken */;
|
|
148409
148416
|
}
|
|
148410
148417
|
break;
|
|
148418
|
+
case 257 /* ClassDeclaration */:
|
|
148419
|
+
case 226 /* ClassExpression */:
|
|
148420
|
+
case 258 /* InterfaceDeclaration */:
|
|
148421
|
+
case 259 /* TypeAliasDeclaration */:
|
|
148422
|
+
if (node.typeParameters === list) {
|
|
148423
|
+
return 29 /* LessThanToken */;
|
|
148424
|
+
}
|
|
148425
|
+
break;
|
|
148411
148426
|
case 178 /* TypeReference */:
|
|
148427
|
+
case 210 /* TaggedTemplateExpression */:
|
|
148428
|
+
case 181 /* TypeQuery */:
|
|
148429
|
+
case 228 /* ExpressionWithTypeArguments */:
|
|
148430
|
+
case 200 /* ImportType */:
|
|
148412
148431
|
if (node.typeArguments === list) {
|
|
148413
148432
|
return 29 /* LessThanToken */;
|
|
148414
148433
|
}
|