@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/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -8908,6 +8908,7 @@ var ts;
|
|
|
8908
8908
|
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."),
|
|
8909
8909
|
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."),
|
|
8910
8910
|
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."),
|
|
8911
|
+
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"),
|
|
8911
8912
|
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}'."),
|
|
8912
8913
|
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}'."),
|
|
8913
8914
|
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}'."),
|
|
@@ -44177,8 +44178,8 @@ var ts;
|
|
|
44177
44178
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
44178
44179
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
44179
44180
|
if (!pathAndExtension && packageInfo
|
|
44180
|
-
|
|
44181
|
-
&& packageInfo.packageJsonContent.
|
|
44181
|
+
// eslint-disable-next-line no-null/no-null
|
|
44182
|
+
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
44182
44183
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
44183
44184
|
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
44184
44185
|
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
@@ -47843,7 +47844,10 @@ var ts;
|
|
|
47843
47844
|
TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
|
|
47844
47845
|
TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
|
|
47845
47846
|
TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
|
|
47846
|
-
TypeFacts[TypeFacts["
|
|
47847
|
+
TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
|
|
47848
|
+
TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
|
|
47849
|
+
TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
|
|
47850
|
+
TypeFacts[TypeFacts["All"] = 134217727] = "All";
|
|
47847
47851
|
// The following members encode facts about particular kinds of types for use in the getTypeFacts function.
|
|
47848
47852
|
// The presence of a particular fact means that the given test is true for some (and possibly all) values
|
|
47849
47853
|
// of that kind of type.
|
|
@@ -47885,14 +47889,16 @@ var ts;
|
|
|
47885
47889
|
TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
|
|
47886
47890
|
TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
|
|
47887
47891
|
TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
|
|
47888
|
-
TypeFacts[TypeFacts["
|
|
47889
|
-
TypeFacts[TypeFacts["
|
|
47890
|
-
TypeFacts[TypeFacts["
|
|
47892
|
+
TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
|
|
47893
|
+
TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
|
|
47894
|
+
TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
|
|
47895
|
+
TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
|
|
47896
|
+
TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
|
|
47897
|
+
TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
|
|
47891
47898
|
TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
|
|
47892
|
-
TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
|
|
47893
47899
|
// Masks
|
|
47894
47900
|
TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
|
|
47895
|
-
TypeFacts[TypeFacts["AndFactsMask"] =
|
|
47901
|
+
TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
47896
47902
|
})(TypeFacts || (TypeFacts = {}));
|
|
47897
47903
|
var typeofEQFacts = new ts.Map(ts.getEntries({
|
|
47898
47904
|
string: 1 /* TypeofEQString */,
|
|
@@ -50056,7 +50062,12 @@ var ts;
|
|
|
50056
50062
|
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
|
|
50057
50063
|
if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
|
|
50058
50064
|
if (isPrimitiveTypeName(name)) {
|
|
50059
|
-
|
|
50065
|
+
if (isExtendedByInterface(errorLocation)) {
|
|
50066
|
+
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));
|
|
50067
|
+
}
|
|
50068
|
+
else {
|
|
50069
|
+
error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
|
|
50070
|
+
}
|
|
50060
50071
|
return true;
|
|
50061
50072
|
}
|
|
50062
50073
|
var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
|
|
@@ -50076,6 +50087,16 @@ var ts;
|
|
|
50076
50087
|
}
|
|
50077
50088
|
return false;
|
|
50078
50089
|
}
|
|
50090
|
+
function isExtendedByInterface(node) {
|
|
50091
|
+
var grandparent = node.parent.parent;
|
|
50092
|
+
var parentOfGrandparent = grandparent.parent;
|
|
50093
|
+
if (grandparent && parentOfGrandparent) {
|
|
50094
|
+
var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
|
|
50095
|
+
var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
|
|
50096
|
+
return isExtending && isInterface;
|
|
50097
|
+
}
|
|
50098
|
+
return false;
|
|
50099
|
+
}
|
|
50079
50100
|
function maybeMappedType(node, symbol) {
|
|
50080
50101
|
var container = ts.findAncestor(node.parent, function (n) {
|
|
50081
50102
|
return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
|
|
@@ -52916,7 +52937,7 @@ var ts;
|
|
|
52916
52937
|
anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
52917
52938
|
var saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
52918
52939
|
context.enclosingDeclaration = undefined;
|
|
52919
|
-
if (context.tracker.trackSymbol &&
|
|
52940
|
+
if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
|
|
52920
52941
|
if (propertySymbol.declarations) {
|
|
52921
52942
|
var decl = ts.first(propertySymbol.declarations);
|
|
52922
52943
|
if (hasLateBindableName(decl)) {
|
|
@@ -54600,7 +54621,7 @@ var ts;
|
|
|
54600
54621
|
? getBaseConstructorTypeOfClass(staticType)
|
|
54601
54622
|
: anyType;
|
|
54602
54623
|
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);
|
|
54603
|
-
var symbolProps =
|
|
54624
|
+
var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
54604
54625
|
var publicSymbolProps = ts.filter(symbolProps, function (s) {
|
|
54605
54626
|
// `valueDeclaration` could be undefined if inherited from
|
|
54606
54627
|
// a union/intersection base type, but inherited properties
|
|
@@ -55738,7 +55759,7 @@ var ts;
|
|
|
55738
55759
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
55739
55760
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
55740
55761
|
// undefined from the final type.
|
|
55741
|
-
return strictNullChecks && !(
|
|
55762
|
+
return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
|
|
55742
55763
|
}
|
|
55743
55764
|
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
55744
55765
|
}
|
|
@@ -58941,7 +58962,7 @@ var ts;
|
|
|
58941
58962
|
var objectType;
|
|
58942
58963
|
return !!(type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ &&
|
|
58943
58964
|
!isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
|
|
58944
|
-
!objectType
|
|
58965
|
+
!(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
58945
58966
|
}
|
|
58946
58967
|
/**
|
|
58947
58968
|
* For a type parameter, return the base constraint of the type parameter. For the string, number,
|
|
@@ -64233,7 +64254,7 @@ var ts;
|
|
|
64233
64254
|
var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
|
|
64234
64255
|
var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
|
|
64235
64256
|
var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
|
|
64236
|
-
(
|
|
64257
|
+
(getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
|
|
64237
64258
|
var related = callbacks ?
|
|
64238
64259
|
compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
|
|
64239
64260
|
!(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
|
|
@@ -67451,30 +67472,8 @@ var ts;
|
|
|
67451
67472
|
var value = _a.value;
|
|
67452
67473
|
return value.base10Value === "0";
|
|
67453
67474
|
}
|
|
67454
|
-
function getFalsyFlagsOfTypes(types) {
|
|
67455
|
-
var result = 0;
|
|
67456
|
-
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
67457
|
-
var t = types_14[_i];
|
|
67458
|
-
result |= getFalsyFlags(t);
|
|
67459
|
-
}
|
|
67460
|
-
return result;
|
|
67461
|
-
}
|
|
67462
|
-
// Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
|
|
67463
|
-
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
|
67464
|
-
// no flags for all other types (including non-falsy literal types).
|
|
67465
|
-
function getFalsyFlags(type) {
|
|
67466
|
-
var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
|
|
67467
|
-
return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
|
|
67468
|
-
t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
|
|
67469
|
-
t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
|
|
67470
|
-
t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
|
|
67471
|
-
t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
|
|
67472
|
-
t.flags & 117724 /* PossiblyFalsy */;
|
|
67473
|
-
}
|
|
67474
67475
|
function removeDefinitelyFalsyTypes(type) {
|
|
67475
|
-
return
|
|
67476
|
-
filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
|
|
67477
|
-
type;
|
|
67476
|
+
return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
|
|
67478
67477
|
}
|
|
67479
67478
|
function extractDefinitelyFalsyTypes(type) {
|
|
67480
67479
|
return mapType(type, getDefinitelyFalsyPartOfType);
|
|
@@ -67517,14 +67516,7 @@ var ts;
|
|
|
67517
67516
|
getIntersectionType([type, emptyObjectType]);
|
|
67518
67517
|
}
|
|
67519
67518
|
function getNonNullableType(type) {
|
|
67520
|
-
|
|
67521
|
-
// First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
|
|
67522
|
-
// 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
|
|
67523
|
-
// that isn't eliminated by a NonNullable<T> instantiation.
|
|
67524
|
-
var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
67525
|
-
return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
|
|
67526
|
-
}
|
|
67527
|
-
return type;
|
|
67519
|
+
return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
67528
67520
|
}
|
|
67529
67521
|
function addOptionalTypeMarker(type) {
|
|
67530
67522
|
return strictNullChecks ? getUnionType([type, optionalType]) : type;
|
|
@@ -68668,8 +68660,8 @@ var ts;
|
|
|
68668
68660
|
}
|
|
68669
68661
|
function getSingleTypeVariableFromIntersectionTypes(types) {
|
|
68670
68662
|
var typeVariable;
|
|
68671
|
-
for (var _i = 0,
|
|
68672
|
-
var type =
|
|
68663
|
+
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
|
|
68664
|
+
var type = types_14[_i];
|
|
68673
68665
|
var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
|
|
68674
68666
|
if (!t || typeVariable && t !== typeVariable) {
|
|
68675
68667
|
return undefined;
|
|
@@ -69422,8 +69414,8 @@ var ts;
|
|
|
69422
69414
|
}
|
|
69423
69415
|
}
|
|
69424
69416
|
};
|
|
69425
|
-
for (var _i = 0,
|
|
69426
|
-
var type =
|
|
69417
|
+
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
69418
|
+
var type = types_15[_i];
|
|
69427
69419
|
var state_9 = _loop_24(type);
|
|
69428
69420
|
if (typeof state_9 === "object")
|
|
69429
69421
|
return state_9.value;
|
|
@@ -69538,14 +69530,16 @@ var ts;
|
|
|
69538
69530
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
|
|
69539
69531
|
resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
69540
69532
|
}
|
|
69541
|
-
function getTypeFacts(type
|
|
69542
|
-
if (
|
|
69533
|
+
function getTypeFacts(type) {
|
|
69534
|
+
if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
|
|
69535
|
+
type = getBaseConstraintOfType(type) || unknownType;
|
|
69536
|
+
}
|
|
69543
69537
|
var flags = type.flags;
|
|
69544
|
-
if (flags & 4 /* String */) {
|
|
69538
|
+
if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
|
|
69545
69539
|
return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
|
|
69546
69540
|
}
|
|
69547
|
-
if (flags & 128 /* StringLiteral */) {
|
|
69548
|
-
var isEmpty = type.value === "";
|
|
69541
|
+
if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
|
|
69542
|
+
var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
|
|
69549
69543
|
return strictNullChecks ?
|
|
69550
69544
|
isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
|
|
69551
69545
|
isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
@@ -69577,20 +69571,20 @@ var ts;
|
|
|
69577
69571
|
(type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
|
|
69578
69572
|
}
|
|
69579
69573
|
if (flags & 524288 /* Object */) {
|
|
69580
|
-
if (ignoreObjects) {
|
|
69581
|
-
return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
|
|
69582
|
-
}
|
|
69583
69574
|
return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
|
|
69584
|
-
strictNullChecks ?
|
|
69575
|
+
strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
|
|
69585
69576
|
isFunctionObjectType(type) ?
|
|
69586
69577
|
strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
|
|
69587
69578
|
strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
|
|
69588
69579
|
}
|
|
69589
|
-
if (flags &
|
|
69590
|
-
return 9830144 /*
|
|
69580
|
+
if (flags & 16384 /* Void */) {
|
|
69581
|
+
return 9830144 /* VoidFacts */;
|
|
69582
|
+
}
|
|
69583
|
+
if (flags & 32768 /* Undefined */) {
|
|
69584
|
+
return 26607360 /* UndefinedFacts */;
|
|
69591
69585
|
}
|
|
69592
69586
|
if (flags & 65536 /* Null */) {
|
|
69593
|
-
return
|
|
69587
|
+
return 42917664 /* NullFacts */;
|
|
69594
69588
|
}
|
|
69595
69589
|
if (flags & 12288 /* ESSymbolLike */) {
|
|
69596
69590
|
return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
|
|
@@ -69601,38 +69595,39 @@ var ts;
|
|
|
69601
69595
|
if (flags & 131072 /* Never */) {
|
|
69602
69596
|
return 0 /* None */;
|
|
69603
69597
|
}
|
|
69604
|
-
if (flags & 465829888 /* Instantiable */) {
|
|
69605
|
-
return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
|
|
69606
|
-
strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
|
|
69607
|
-
}
|
|
69608
69598
|
if (flags & 1048576 /* Union */) {
|
|
69609
|
-
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t
|
|
69599
|
+
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
|
|
69610
69600
|
}
|
|
69611
69601
|
if (flags & 2097152 /* Intersection */) {
|
|
69612
|
-
|
|
69613
|
-
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69614
|
-
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
|
|
69615
|
-
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
69602
|
+
return getIntersectionTypeFacts(type);
|
|
69616
69603
|
}
|
|
69617
|
-
return
|
|
69604
|
+
return 83886079 /* UnknownFacts */;
|
|
69618
69605
|
}
|
|
69619
|
-
function getIntersectionTypeFacts(type
|
|
69606
|
+
function getIntersectionTypeFacts(type) {
|
|
69607
|
+
// When an intersection contains a primitive type we ignore object type constituents as they are
|
|
69608
|
+
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
69609
|
+
var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
|
|
69620
69610
|
// When computing the type facts of an intersection type, certain type facts are computed as `and`
|
|
69621
69611
|
// and others are computed as `or`.
|
|
69622
69612
|
var oredFacts = 0 /* None */;
|
|
69623
|
-
var andedFacts =
|
|
69613
|
+
var andedFacts = 134217727 /* All */;
|
|
69624
69614
|
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
69625
69615
|
var t = _a[_i];
|
|
69626
|
-
|
|
69627
|
-
|
|
69628
|
-
|
|
69616
|
+
if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
|
|
69617
|
+
var f = getTypeFacts(t);
|
|
69618
|
+
oredFacts |= f;
|
|
69619
|
+
andedFacts &= f;
|
|
69620
|
+
}
|
|
69629
69621
|
}
|
|
69630
|
-
return oredFacts & 8256 /* OrFactsMask */ | andedFacts &
|
|
69622
|
+
return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
|
|
69631
69623
|
}
|
|
69632
69624
|
function getTypeWithFacts(type, include) {
|
|
69633
69625
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
69634
69626
|
}
|
|
69635
|
-
function
|
|
69627
|
+
// This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
|
|
69628
|
+
// unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
|
|
69629
|
+
// instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
|
|
69630
|
+
function getAdjustedTypeWithFacts(type, facts) {
|
|
69636
69631
|
var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
|
|
69637
69632
|
if (strictNullChecks) {
|
|
69638
69633
|
switch (facts) {
|
|
@@ -69898,8 +69893,8 @@ var ts;
|
|
|
69898
69893
|
var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
|
|
69899
69894
|
var mappedTypes;
|
|
69900
69895
|
var changed = false;
|
|
69901
|
-
for (var _i = 0,
|
|
69902
|
-
var t =
|
|
69896
|
+
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
|
|
69897
|
+
var t = types_16[_i];
|
|
69903
69898
|
var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
|
|
69904
69899
|
changed || (changed = t !== mapped);
|
|
69905
69900
|
if (mapped) {
|
|
@@ -69985,8 +69980,8 @@ var ts;
|
|
|
69985
69980
|
}
|
|
69986
69981
|
function isEvolvingArrayTypeList(types) {
|
|
69987
69982
|
var hasEvolvingArrayType = false;
|
|
69988
|
-
for (var _i = 0,
|
|
69989
|
-
var t =
|
|
69983
|
+
for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
|
|
69984
|
+
var t = types_17[_i];
|
|
69990
69985
|
if (!(t.flags & 131072 /* Never */)) {
|
|
69991
69986
|
if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
|
|
69992
69987
|
return false;
|
|
@@ -70809,10 +70804,10 @@ var ts;
|
|
|
70809
70804
|
}
|
|
70810
70805
|
function narrowTypeByTruthiness(type, expr, assumeTrue) {
|
|
70811
70806
|
if (isMatchingReference(reference, expr)) {
|
|
70812
|
-
return
|
|
70807
|
+
return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
|
|
70813
70808
|
}
|
|
70814
70809
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
|
|
70815
|
-
type =
|
|
70810
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
70816
70811
|
}
|
|
70817
70812
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
70818
70813
|
if (access) {
|
|
@@ -70952,7 +70947,7 @@ var ts;
|
|
|
70952
70947
|
// Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
|
|
70953
70948
|
var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
|
|
70954
70949
|
equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
|
|
70955
|
-
return removeNullable ?
|
|
70950
|
+
return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
|
|
70956
70951
|
}
|
|
70957
70952
|
function narrowTypeByEquality(type, operator, value, assumeTrue) {
|
|
70958
70953
|
if (type.flags & 1 /* Any */) {
|
|
@@ -70981,7 +70976,7 @@ var ts;
|
|
|
70981
70976
|
valueType.flags & 65536 /* Null */ ?
|
|
70982
70977
|
assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
|
|
70983
70978
|
assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
|
|
70984
|
-
return
|
|
70979
|
+
return getAdjustedTypeWithFacts(type, facts);
|
|
70985
70980
|
}
|
|
70986
70981
|
if (assumeTrue) {
|
|
70987
70982
|
var filterFn = operator === 34 /* EqualsEqualsToken */ ?
|
|
@@ -71002,7 +70997,7 @@ var ts;
|
|
|
71002
70997
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
71003
70998
|
if (!isMatchingReference(reference, target)) {
|
|
71004
70999
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
71005
|
-
return
|
|
71000
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71006
71001
|
}
|
|
71007
71002
|
return type;
|
|
71008
71003
|
}
|
|
@@ -71206,7 +71201,7 @@ var ts;
|
|
|
71206
71201
|
var left = getReferenceCandidate(expr.left);
|
|
71207
71202
|
if (!isMatchingReference(reference, left)) {
|
|
71208
71203
|
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
|
71209
|
-
return
|
|
71204
|
+
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71210
71205
|
}
|
|
71211
71206
|
return type;
|
|
71212
71207
|
}
|
|
@@ -71294,7 +71289,7 @@ var ts;
|
|
|
71294
71289
|
}
|
|
71295
71290
|
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
|
|
71296
71291
|
!(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
|
|
71297
|
-
type =
|
|
71292
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
71298
71293
|
}
|
|
71299
71294
|
var access = getDiscriminantPropertyAccess(predicateArgument, type);
|
|
71300
71295
|
if (access) {
|
|
@@ -71351,7 +71346,7 @@ var ts;
|
|
|
71351
71346
|
}
|
|
71352
71347
|
function narrowTypeByOptionality(type, expr, assumePresent) {
|
|
71353
71348
|
if (isMatchingReference(reference, expr)) {
|
|
71354
|
-
return
|
|
71349
|
+
return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
|
|
71355
71350
|
}
|
|
71356
71351
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
71357
71352
|
if (access) {
|
|
@@ -71437,8 +71432,8 @@ var ts;
|
|
|
71437
71432
|
var annotationIncludesUndefined = strictNullChecks &&
|
|
71438
71433
|
declaration.kind === 164 /* Parameter */ &&
|
|
71439
71434
|
declaration.initializer &&
|
|
71440
|
-
|
|
71441
|
-
!(
|
|
71435
|
+
getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
|
|
71436
|
+
!(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
|
|
71442
71437
|
popTypeResolution();
|
|
71443
71438
|
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
|
|
71444
71439
|
}
|
|
@@ -71766,7 +71761,7 @@ var ts;
|
|
|
71766
71761
|
return convertAutoToAny(flowType);
|
|
71767
71762
|
}
|
|
71768
71763
|
}
|
|
71769
|
-
else if (!assumeInitialized && !(
|
|
71764
|
+
else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
71770
71765
|
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
|
71771
71766
|
// Return the declared type to reduce follow-on errors
|
|
71772
71767
|
return type;
|
|
@@ -73295,8 +73290,8 @@ var ts;
|
|
|
73295
73290
|
}
|
|
73296
73291
|
var signatureList;
|
|
73297
73292
|
var types = type.types;
|
|
73298
|
-
for (var _i = 0,
|
|
73299
|
-
var current =
|
|
73293
|
+
for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
|
|
73294
|
+
var current = types_18[_i];
|
|
73300
73295
|
var signature = getContextualCallSignature(current, node);
|
|
73301
73296
|
if (signature) {
|
|
73302
73297
|
if (!signatureList) {
|
|
@@ -74458,19 +74453,19 @@ var ts;
|
|
|
74458
74453
|
return checkNonNullType(checkExpression(node), node);
|
|
74459
74454
|
}
|
|
74460
74455
|
function isNullableType(type) {
|
|
74461
|
-
return !!((
|
|
74456
|
+
return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
|
|
74462
74457
|
}
|
|
74463
74458
|
function getNonNullableTypeIfNeeded(type) {
|
|
74464
74459
|
return isNullableType(type) ? getNonNullableType(type) : type;
|
|
74465
74460
|
}
|
|
74466
|
-
function reportObjectPossiblyNullOrUndefinedError(node,
|
|
74467
|
-
error(node,
|
|
74461
|
+
function reportObjectPossiblyNullOrUndefinedError(node, facts) {
|
|
74462
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74468
74463
|
ts.Diagnostics.Object_is_possibly_null_or_undefined :
|
|
74469
74464
|
ts.Diagnostics.Object_is_possibly_undefined :
|
|
74470
74465
|
ts.Diagnostics.Object_is_possibly_null);
|
|
74471
74466
|
}
|
|
74472
|
-
function reportCannotInvokePossiblyNullOrUndefinedError(node,
|
|
74473
|
-
error(node,
|
|
74467
|
+
function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
|
|
74468
|
+
error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
|
|
74474
74469
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
|
|
74475
74470
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
|
|
74476
74471
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
|
|
@@ -74480,9 +74475,9 @@ var ts;
|
|
|
74480
74475
|
error(node, ts.Diagnostics.Object_is_of_type_unknown);
|
|
74481
74476
|
return errorType;
|
|
74482
74477
|
}
|
|
74483
|
-
var
|
|
74484
|
-
if (
|
|
74485
|
-
reportError(node,
|
|
74478
|
+
var facts = getTypeFacts(type);
|
|
74479
|
+
if (facts & 50331648 /* IsUndefinedOrNull */) {
|
|
74480
|
+
reportError(node, facts);
|
|
74486
74481
|
var t = getNonNullableType(type);
|
|
74487
74482
|
return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
|
|
74488
74483
|
}
|
|
@@ -74777,7 +74772,7 @@ var ts;
|
|
|
74777
74772
|
assumeUninitialized = true;
|
|
74778
74773
|
}
|
|
74779
74774
|
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
|
|
74780
|
-
if (assumeUninitialized && !(
|
|
74775
|
+
if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
|
|
74781
74776
|
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
|
|
74782
74777
|
// Return the declared type to reduce follow-on errors
|
|
74783
74778
|
return propType;
|
|
@@ -76693,8 +76688,8 @@ var ts;
|
|
|
76693
76688
|
if (apparentType.flags & 1048576 /* Union */) {
|
|
76694
76689
|
var types = apparentType.types;
|
|
76695
76690
|
var hasSignatures = false;
|
|
76696
|
-
for (var _i = 0,
|
|
76697
|
-
var constituent =
|
|
76691
|
+
for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
|
|
76692
|
+
var constituent = types_19[_i];
|
|
76698
76693
|
var signatures = getSignaturesOfType(constituent, kind);
|
|
76699
76694
|
if (signatures.length !== 0) {
|
|
76700
76695
|
hasSignatures = true;
|
|
@@ -78385,7 +78380,7 @@ var ts;
|
|
|
78385
78380
|
var type = getTypeOfSymbol(symbol);
|
|
78386
78381
|
if (strictNullChecks &&
|
|
78387
78382
|
!(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
|
|
78388
|
-
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ :
|
|
78383
|
+
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
78389
78384
|
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
78390
78385
|
}
|
|
78391
78386
|
}
|
|
@@ -78553,8 +78548,8 @@ var ts;
|
|
|
78553
78548
|
}
|
|
78554
78549
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
78555
78550
|
var types = type.types;
|
|
78556
|
-
for (var _i = 0,
|
|
78557
|
-
var t =
|
|
78551
|
+
for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
|
|
78552
|
+
var t = types_20[_i];
|
|
78558
78553
|
if (maybeTypeOfKind(t, kind)) {
|
|
78559
78554
|
return true;
|
|
78560
78555
|
}
|
|
@@ -78781,7 +78776,7 @@ var ts;
|
|
|
78781
78776
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
78782
78777
|
// undefined from the final type.
|
|
78783
78778
|
if (strictNullChecks &&
|
|
78784
|
-
!(
|
|
78779
|
+
!(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
|
|
78785
78780
|
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
|
|
78786
78781
|
}
|
|
78787
78782
|
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
|
|
@@ -79181,7 +79176,7 @@ var ts;
|
|
|
79181
79176
|
case 56 /* BarBarToken */:
|
|
79182
79177
|
case 75 /* BarBarEqualsToken */: {
|
|
79183
79178
|
var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
|
|
79184
|
-
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
|
|
79179
|
+
getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
|
|
79185
79180
|
leftType;
|
|
79186
79181
|
if (operator === 75 /* BarBarEqualsToken */) {
|
|
79187
79182
|
checkAssignmentOperator(rightType);
|
|
@@ -81722,8 +81717,8 @@ var ts;
|
|
|
81722
81717
|
}
|
|
81723
81718
|
function getEntityNameForDecoratorMetadataFromTypeList(types) {
|
|
81724
81719
|
var commonEntityName;
|
|
81725
|
-
for (var _i = 0,
|
|
81726
|
-
var typeNode =
|
|
81720
|
+
for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
|
|
81721
|
+
var typeNode = types_21[_i];
|
|
81727
81722
|
while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
|
|
81728
81723
|
typeNode = typeNode.type; // Skip parens if need be
|
|
81729
81724
|
}
|
|
@@ -82742,7 +82737,7 @@ var ts;
|
|
|
82742
82737
|
return;
|
|
82743
82738
|
var type = checkTruthinessExpression(location);
|
|
82744
82739
|
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
82745
|
-
if (
|
|
82740
|
+
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
82746
82741
|
return;
|
|
82747
82742
|
// While it technically should be invalid for any known-truthy value
|
|
82748
82743
|
// to be tested, we de-scope to functions and Promises unreferenced in
|
|
@@ -84428,18 +84423,17 @@ var ts;
|
|
|
84428
84423
|
// but not by other kinds of members.
|
|
84429
84424
|
// Base class instance member variables and accessors can be overridden by
|
|
84430
84425
|
// derived class instance member variables and accessors, but not by other kinds of members.
|
|
84431
|
-
var _a, _b;
|
|
84426
|
+
var _a, _b, _c, _d;
|
|
84432
84427
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
84433
84428
|
var baseProperties = getPropertiesOfType(baseType);
|
|
84434
|
-
|
|
84435
|
-
var baseProperty = baseProperties_1[_i];
|
|
84429
|
+
var _loop_33 = function (baseProperty) {
|
|
84436
84430
|
var base = getTargetSymbol(baseProperty);
|
|
84437
84431
|
if (base.flags & 4194304 /* Prototype */) {
|
|
84438
|
-
continue;
|
|
84432
|
+
return "continue";
|
|
84439
84433
|
}
|
|
84440
84434
|
var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
|
|
84441
84435
|
if (!baseSymbol) {
|
|
84442
|
-
continue;
|
|
84436
|
+
return "continue";
|
|
84443
84437
|
}
|
|
84444
84438
|
var derived = getTargetSymbol(baseSymbol);
|
|
84445
84439
|
var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
|
|
@@ -84457,14 +84451,14 @@ var ts;
|
|
|
84457
84451
|
// Searches other base types for a declaration that would satisfy the inherited abstract member.
|
|
84458
84452
|
// (The class may have more than one base type via declaration merging with an interface with the
|
|
84459
84453
|
// same name.)
|
|
84460
|
-
for (var
|
|
84461
|
-
var otherBaseType =
|
|
84454
|
+
for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
|
|
84455
|
+
var otherBaseType = _f[_e];
|
|
84462
84456
|
if (otherBaseType === baseType)
|
|
84463
84457
|
continue;
|
|
84464
84458
|
var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
|
|
84465
84459
|
var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
|
|
84466
84460
|
if (derivedElsewhere && derivedElsewhere !== base) {
|
|
84467
|
-
continue
|
|
84461
|
+
return "continue-basePropertyCheck";
|
|
84468
84462
|
}
|
|
84469
84463
|
}
|
|
84470
84464
|
if (derivedClassDecl.kind === 226 /* ClassExpression */) {
|
|
@@ -84479,20 +84473,19 @@ var ts;
|
|
|
84479
84473
|
// derived overrides base.
|
|
84480
84474
|
var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
|
|
84481
84475
|
if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
|
|
84482
|
-
|
|
84483
|
-
continue;
|
|
84476
|
+
return "continue";
|
|
84484
84477
|
}
|
|
84485
84478
|
var errorMessage = void 0;
|
|
84486
84479
|
var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
84487
84480
|
var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
84488
84481
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
84489
84482
|
// property/accessor is overridden with property/accessor
|
|
84490
|
-
if (
|
|
84491
|
-
|
|
84483
|
+
if ((ts.getCheckFlags(base) & 6 /* Synthetic */
|
|
84484
|
+
? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
|
|
84485
|
+
: (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
|
|
84486
|
+
|| ts.getCheckFlags(base) & 262144 /* Mapped */
|
|
84492
84487
|
|| derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
|
|
84493
|
-
|
|
84494
|
-
// same when the derived property is from an assignment
|
|
84495
|
-
continue;
|
|
84488
|
+
return "continue";
|
|
84496
84489
|
}
|
|
84497
84490
|
var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
84498
84491
|
var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
|
|
@@ -84503,12 +84496,12 @@ var ts;
|
|
|
84503
84496
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
84504
84497
|
}
|
|
84505
84498
|
else if (useDefineForClassFields) {
|
|
84506
|
-
var uninitialized = (
|
|
84499
|
+
var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
|
|
84507
84500
|
if (uninitialized
|
|
84508
84501
|
&& !(derived.flags & 33554432 /* Transient */)
|
|
84509
84502
|
&& !(baseDeclarationFlags & 128 /* Abstract */)
|
|
84510
84503
|
&& !(derivedDeclarationFlags & 128 /* Abstract */)
|
|
84511
|
-
&& !((
|
|
84504
|
+
&& !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
|
|
84512
84505
|
var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
|
|
84513
84506
|
var propName = uninitialized.name;
|
|
84514
84507
|
if (uninitialized.exclamationToken
|
|
@@ -84521,13 +84514,11 @@ var ts;
|
|
|
84521
84514
|
}
|
|
84522
84515
|
}
|
|
84523
84516
|
}
|
|
84524
|
-
|
|
84525
|
-
continue;
|
|
84517
|
+
return "continue";
|
|
84526
84518
|
}
|
|
84527
84519
|
else if (isPrototypeProperty(base)) {
|
|
84528
84520
|
if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
|
|
84529
|
-
|
|
84530
|
-
continue;
|
|
84521
|
+
return "continue";
|
|
84531
84522
|
}
|
|
84532
84523
|
else {
|
|
84533
84524
|
ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
|
|
@@ -84542,9 +84533,20 @@ var ts;
|
|
|
84542
84533
|
}
|
|
84543
84534
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
|
|
84544
84535
|
}
|
|
84536
|
+
};
|
|
84537
|
+
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
84538
|
+
var baseProperty = baseProperties_1[_i];
|
|
84539
|
+
var state_10 = _loop_33(baseProperty);
|
|
84540
|
+
switch (state_10) {
|
|
84541
|
+
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
84542
|
+
}
|
|
84545
84543
|
}
|
|
84546
84544
|
}
|
|
84547
|
-
function
|
|
84545
|
+
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
84546
|
+
return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
|
|
84547
|
+
|| ts.isInterfaceDeclaration(declaration.parent);
|
|
84548
|
+
}
|
|
84549
|
+
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
84548
84550
|
if (!ts.length(baseTypes)) {
|
|
84549
84551
|
return properties;
|
|
84550
84552
|
}
|
|
@@ -84613,7 +84615,7 @@ var ts;
|
|
|
84613
84615
|
var propName = member.name;
|
|
84614
84616
|
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
84615
84617
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
84616
|
-
if (!(type.flags & 3 /* AnyOrUnknown */ ||
|
|
84618
|
+
if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
|
|
84617
84619
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
84618
84620
|
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
|
|
84619
84621
|
}
|
|
@@ -84638,7 +84640,7 @@ var ts;
|
|
|
84638
84640
|
ts.setParent(reference, staticBlock);
|
|
84639
84641
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
84640
84642
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84641
|
-
if (!(
|
|
84643
|
+
if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
|
|
84642
84644
|
return true;
|
|
84643
84645
|
}
|
|
84644
84646
|
}
|
|
@@ -84653,7 +84655,7 @@ var ts;
|
|
|
84653
84655
|
ts.setParent(reference, constructor);
|
|
84654
84656
|
reference.flowNode = constructor.returnFlowNode;
|
|
84655
84657
|
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
84656
|
-
return !(
|
|
84658
|
+
return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
|
|
84657
84659
|
}
|
|
84658
84660
|
function checkInterfaceDeclaration(node) {
|
|
84659
84661
|
// Grammar checking
|
|
@@ -92941,8 +92943,8 @@ var ts;
|
|
|
92941
92943
|
// Note when updating logic here also update getEntityNameForDecoratorMetadata
|
|
92942
92944
|
// so that aliases can be marked as referenced
|
|
92943
92945
|
var serializedUnion;
|
|
92944
|
-
for (var _i = 0,
|
|
92945
|
-
var typeNode =
|
|
92946
|
+
for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
|
|
92947
|
+
var typeNode = types_22[_i];
|
|
92946
92948
|
while (typeNode.kind === 191 /* ParenthesizedType */) {
|
|
92947
92949
|
typeNode = typeNode.type; // Skip parens if need be
|
|
92948
92950
|
}
|
|
@@ -113557,8 +113559,8 @@ var ts;
|
|
|
113557
113559
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
113558
113560
|
writeLine();
|
|
113559
113561
|
}
|
|
113560
|
-
for (var _d = 0,
|
|
113561
|
-
var directive =
|
|
113562
|
+
for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
|
|
113563
|
+
var directive = types_23[_d];
|
|
113562
113564
|
var pos = writer.getTextPos();
|
|
113563
113565
|
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
113564
113566
|
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
@@ -122326,7 +122328,7 @@ var ts;
|
|
|
122326
122328
|
});
|
|
122327
122329
|
// Sort by paths closest to importing file Name directory
|
|
122328
122330
|
var sortedPaths = [];
|
|
122329
|
-
var
|
|
122331
|
+
var _loop_34 = function (directory) {
|
|
122330
122332
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
122331
122333
|
var pathsInDirectory;
|
|
122332
122334
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -122350,9 +122352,9 @@ var ts;
|
|
|
122350
122352
|
};
|
|
122351
122353
|
var out_directory_1;
|
|
122352
122354
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
122353
|
-
var
|
|
122355
|
+
var state_11 = _loop_34(directory);
|
|
122354
122356
|
directory = out_directory_1;
|
|
122355
|
-
if (
|
|
122357
|
+
if (state_11 === "break")
|
|
122356
122358
|
break;
|
|
122357
122359
|
}
|
|
122358
122360
|
if (allFileNames.size) {
|
|
@@ -144096,7 +144098,7 @@ var ts;
|
|
|
144096
144098
|
if (!ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
|
|
144097
144099
|
return;
|
|
144098
144100
|
}
|
|
144099
|
-
if (ts.isTypeNode(node)) {
|
|
144101
|
+
if (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node)) {
|
|
144100
144102
|
return;
|
|
144101
144103
|
}
|
|
144102
144104
|
if (preferences.includeInlayVariableTypeHints && ts.isVariableDeclaration(node)) {
|
|
@@ -147207,7 +147209,6 @@ var ts;
|
|
|
147207
147209
|
case 280 /* JsxOpeningElement */:
|
|
147208
147210
|
case 281 /* JsxClosingElement */:
|
|
147209
147211
|
case 279 /* JsxSelfClosingElement */:
|
|
147210
|
-
case 228 /* ExpressionWithTypeArguments */:
|
|
147211
147212
|
return false;
|
|
147212
147213
|
}
|
|
147213
147214
|
break;
|
|
@@ -147377,7 +147378,7 @@ var ts;
|
|
|
147377
147378
|
var listEndToken = getCloseTokenForOpenToken(listStartToken);
|
|
147378
147379
|
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
|
|
147379
147380
|
var tokenInfo = formattingScanner.readTokenInfo(parent);
|
|
147380
|
-
if (tokenInfo.token.kind === 27 /* CommaToken */
|
|
147381
|
+
if (tokenInfo.token.kind === 27 /* CommaToken */) {
|
|
147381
147382
|
// consume the comma
|
|
147382
147383
|
consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
|
|
147383
147384
|
tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent) : undefined;
|
|
@@ -147781,6 +147782,12 @@ var ts;
|
|
|
147781
147782
|
case 169 /* MethodDeclaration */:
|
|
147782
147783
|
case 168 /* MethodSignature */:
|
|
147783
147784
|
case 214 /* ArrowFunction */:
|
|
147785
|
+
case 174 /* CallSignature */:
|
|
147786
|
+
case 175 /* ConstructSignature */:
|
|
147787
|
+
case 179 /* FunctionType */:
|
|
147788
|
+
case 180 /* ConstructorType */:
|
|
147789
|
+
case 172 /* GetAccessor */:
|
|
147790
|
+
case 173 /* SetAccessor */:
|
|
147784
147791
|
if (node.typeParameters === list) {
|
|
147785
147792
|
return 29 /* LessThanToken */;
|
|
147786
147793
|
}
|
|
@@ -147797,7 +147804,19 @@ var ts;
|
|
|
147797
147804
|
return 20 /* OpenParenToken */;
|
|
147798
147805
|
}
|
|
147799
147806
|
break;
|
|
147807
|
+
case 257 /* ClassDeclaration */:
|
|
147808
|
+
case 226 /* ClassExpression */:
|
|
147809
|
+
case 258 /* InterfaceDeclaration */:
|
|
147810
|
+
case 259 /* TypeAliasDeclaration */:
|
|
147811
|
+
if (node.typeParameters === list) {
|
|
147812
|
+
return 29 /* LessThanToken */;
|
|
147813
|
+
}
|
|
147814
|
+
break;
|
|
147800
147815
|
case 178 /* TypeReference */:
|
|
147816
|
+
case 210 /* TaggedTemplateExpression */:
|
|
147817
|
+
case 181 /* TypeQuery */:
|
|
147818
|
+
case 228 /* ExpressionWithTypeArguments */:
|
|
147819
|
+
case 200 /* ImportType */:
|
|
147801
147820
|
if (node.typeArguments === list) {
|
|
147802
147821
|
return 29 /* LessThanToken */;
|
|
147803
147822
|
}
|