@typescript-deploys/pr-build 4.7.0-pr-48538-10 → 4.7.0-pr-48581-7
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/lib.dom.d.ts +404 -31
- package/lib/lib.dom.iterable.d.ts +16 -3
- package/lib/lib.es2020.intl.d.ts +15 -13
- package/lib/lib.es2021.intl.d.ts +102 -0
- package/lib/lib.es5.d.ts +1 -1
- package/lib/lib.webworker.d.ts +110 -25
- package/lib/lib.webworker.iterable.d.ts +3 -3
- package/lib/protocol.d.ts +5 -2
- package/lib/tsc.js +452 -251
- package/lib/tsserver.js +685 -315
- package/lib/tsserverlibrary.d.ts +22 -14
- package/lib/tsserverlibrary.js +685 -315
- package/lib/typescript.d.ts +17 -12
- package/lib/typescript.js +681 -315
- package/lib/typescriptServices.d.ts +17 -12
- package/lib/typescriptServices.js +681 -315
- package/lib/typingsInstaller.js +568 -273
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220406";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -6073,6 +6073,7 @@ var ts;
|
|
|
6073
6073
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
|
|
6074
6074
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
6075
6075
|
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."),
|
|
6076
|
+
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."),
|
|
6076
6077
|
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}'."),
|
|
6077
6078
|
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}'."),
|
|
6078
6079
|
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}'."),
|
|
@@ -10882,17 +10883,17 @@ var ts;
|
|
|
10882
10883
|
ts.hasChangesInResolutions = hasChangesInResolutions;
|
|
10883
10884
|
function containsParseError(node) {
|
|
10884
10885
|
aggregateChildData(node);
|
|
10885
|
-
return (node.flags &
|
|
10886
|
+
return (node.flags & 524288) !== 0;
|
|
10886
10887
|
}
|
|
10887
10888
|
ts.containsParseError = containsParseError;
|
|
10888
10889
|
function aggregateChildData(node) {
|
|
10889
|
-
if (!(node.flags &
|
|
10890
|
-
var thisNodeOrAnySubNodesHasError = ((node.flags &
|
|
10890
|
+
if (!(node.flags & 1048576)) {
|
|
10891
|
+
var thisNodeOrAnySubNodesHasError = ((node.flags & 131072) !== 0) ||
|
|
10891
10892
|
ts.forEachChild(node, containsParseError);
|
|
10892
10893
|
if (thisNodeOrAnySubNodesHasError) {
|
|
10893
|
-
node.flags |=
|
|
10894
|
+
node.flags |= 524288;
|
|
10894
10895
|
}
|
|
10895
|
-
node.flags |=
|
|
10896
|
+
node.flags |= 1048576;
|
|
10896
10897
|
}
|
|
10897
10898
|
}
|
|
10898
10899
|
function getSourceFileOfNode(node) {
|
|
@@ -12516,11 +12517,11 @@ var ts;
|
|
|
12516
12517
|
}
|
|
12517
12518
|
ts.isSourceFileNotJS = isSourceFileNotJS;
|
|
12518
12519
|
function isInJSFile(node) {
|
|
12519
|
-
return !!node && !!(node.flags &
|
|
12520
|
+
return !!node && !!(node.flags & 262144);
|
|
12520
12521
|
}
|
|
12521
12522
|
ts.isInJSFile = isInJSFile;
|
|
12522
12523
|
function isInJsonFile(node) {
|
|
12523
|
-
return !!node && !!(node.flags &
|
|
12524
|
+
return !!node && !!(node.flags & 67108864);
|
|
12524
12525
|
}
|
|
12525
12526
|
ts.isInJsonFile = isInJsonFile;
|
|
12526
12527
|
function isSourceFileNotJson(file) {
|
|
@@ -12528,7 +12529,7 @@ var ts;
|
|
|
12528
12529
|
}
|
|
12529
12530
|
ts.isSourceFileNotJson = isSourceFileNotJson;
|
|
12530
12531
|
function isInJSDoc(node) {
|
|
12531
|
-
return !!node && !!(node.flags &
|
|
12532
|
+
return !!node && !!(node.flags & 8388608);
|
|
12532
12533
|
}
|
|
12533
12534
|
ts.isInJSDoc = isInJSDoc;
|
|
12534
12535
|
function isJSDocIndexSignature(node) {
|
|
@@ -12856,7 +12857,7 @@ var ts;
|
|
|
12856
12857
|
function setValueDeclaration(symbol, node) {
|
|
12857
12858
|
var valueDeclaration = symbol.valueDeclaration;
|
|
12858
12859
|
if (!valueDeclaration ||
|
|
12859
|
-
!(node.flags &
|
|
12860
|
+
!(node.flags & 16777216 && !(valueDeclaration.flags & 16777216)) &&
|
|
12860
12861
|
(isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) ||
|
|
12861
12862
|
(valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration))) {
|
|
12862
12863
|
symbol.valueDeclaration = node;
|
|
@@ -13114,7 +13115,11 @@ var ts;
|
|
|
13114
13115
|
ts.getEffectiveContainerForJSDocTemplateTag = getEffectiveContainerForJSDocTemplateTag;
|
|
13115
13116
|
function getHostSignatureFromJSDoc(node) {
|
|
13116
13117
|
var host = getEffectiveJSDocHost(node);
|
|
13117
|
-
|
|
13118
|
+
if (host) {
|
|
13119
|
+
return ts.isPropertySignature(host) && host.type && ts.isFunctionLike(host.type) ? host.type :
|
|
13120
|
+
ts.isFunctionLike(host) ? host : undefined;
|
|
13121
|
+
}
|
|
13122
|
+
return undefined;
|
|
13118
13123
|
}
|
|
13119
13124
|
ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc;
|
|
13120
13125
|
function getEffectiveJSDocHost(node) {
|
|
@@ -16558,7 +16563,7 @@ var ts;
|
|
|
16558
16563
|
}
|
|
16559
16564
|
ts.pseudoBigIntToString = pseudoBigIntToString;
|
|
16560
16565
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
16561
|
-
return !!(useSite.flags &
|
|
16566
|
+
return !!(useSite.flags & 16777216)
|
|
16562
16567
|
|| isPartOfTypeQuery(useSite)
|
|
16563
16568
|
|| isIdentifierInNonEmittingHeritageClause(useSite)
|
|
16564
16569
|
|| isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite)
|
|
@@ -16936,11 +16941,20 @@ var ts;
|
|
|
16936
16941
|
parenthesizeExpressionForDisallowedComma: parenthesizeExpressionForDisallowedComma,
|
|
16937
16942
|
parenthesizeExpressionOfExpressionStatement: parenthesizeExpressionOfExpressionStatement,
|
|
16938
16943
|
parenthesizeConciseBodyOfArrowFunction: parenthesizeConciseBodyOfArrowFunction,
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16944
|
+
parenthesizeCheckTypeOfConditionalType: parenthesizeCheckTypeOfConditionalType,
|
|
16945
|
+
parenthesizeExtendsTypeOfConditionalType: parenthesizeExtendsTypeOfConditionalType,
|
|
16946
|
+
parenthesizeConstituentTypesOfUnionType: parenthesizeConstituentTypesOfUnionType,
|
|
16947
|
+
parenthesizeConstituentTypeOfUnionType: parenthesizeConstituentTypeOfUnionType,
|
|
16948
|
+
parenthesizeConstituentTypesOfIntersectionType: parenthesizeConstituentTypesOfIntersectionType,
|
|
16949
|
+
parenthesizeConstituentTypeOfIntersectionType: parenthesizeConstituentTypeOfIntersectionType,
|
|
16950
|
+
parenthesizeOperandOfTypeOperator: parenthesizeOperandOfTypeOperator,
|
|
16951
|
+
parenthesizeOperandOfReadonlyTypeOperator: parenthesizeOperandOfReadonlyTypeOperator,
|
|
16952
|
+
parenthesizeNonArrayTypeOfPostfixType: parenthesizeNonArrayTypeOfPostfixType,
|
|
16953
|
+
parenthesizeElementTypesOfTupleType: parenthesizeElementTypesOfTupleType,
|
|
16954
|
+
parenthesizeElementTypeOfTupleType: parenthesizeElementTypeOfTupleType,
|
|
16955
|
+
parenthesizeTypeOfOptionalType: parenthesizeTypeOfOptionalType,
|
|
16943
16956
|
parenthesizeTypeArguments: parenthesizeTypeArguments,
|
|
16957
|
+
parenthesizeLeadingTypeArgument: parenthesizeLeadingTypeArgument,
|
|
16944
16958
|
};
|
|
16945
16959
|
function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) {
|
|
16946
16960
|
binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = new ts.Map());
|
|
@@ -17128,33 +17142,102 @@ var ts;
|
|
|
17128
17142
|
}
|
|
17129
17143
|
return body;
|
|
17130
17144
|
}
|
|
17131
|
-
function
|
|
17132
|
-
|
|
17145
|
+
function parenthesizeCheckTypeOfConditionalType(checkType) {
|
|
17146
|
+
switch (checkType.kind) {
|
|
17147
|
+
case 179:
|
|
17148
|
+
case 180:
|
|
17149
|
+
case 189:
|
|
17150
|
+
return factory.createParenthesizedType(checkType);
|
|
17151
|
+
}
|
|
17152
|
+
return checkType;
|
|
17153
|
+
}
|
|
17154
|
+
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
|
|
17155
|
+
switch (extendsType.kind) {
|
|
17156
|
+
case 189:
|
|
17157
|
+
return factory.createParenthesizedType(extendsType);
|
|
17158
|
+
}
|
|
17159
|
+
return extendsType;
|
|
17133
17160
|
}
|
|
17134
|
-
function
|
|
17135
|
-
switch (
|
|
17161
|
+
function parenthesizeConstituentTypeOfUnionType(type) {
|
|
17162
|
+
switch (type.kind) {
|
|
17136
17163
|
case 187:
|
|
17137
17164
|
case 188:
|
|
17138
|
-
|
|
17139
|
-
case 180:
|
|
17140
|
-
return factory.createParenthesizedType(member);
|
|
17165
|
+
return factory.createParenthesizedType(type);
|
|
17141
17166
|
}
|
|
17142
|
-
return
|
|
17167
|
+
return parenthesizeCheckTypeOfConditionalType(type);
|
|
17143
17168
|
}
|
|
17144
|
-
function
|
|
17145
|
-
|
|
17146
|
-
|
|
17169
|
+
function parenthesizeConstituentTypesOfUnionType(members) {
|
|
17170
|
+
return factory.createNodeArray(ts.sameMap(members, parenthesizeConstituentTypeOfUnionType));
|
|
17171
|
+
}
|
|
17172
|
+
function parenthesizeConstituentTypeOfIntersectionType(type) {
|
|
17173
|
+
switch (type.kind) {
|
|
17174
|
+
case 187:
|
|
17175
|
+
case 188:
|
|
17176
|
+
return factory.createParenthesizedType(type);
|
|
17177
|
+
}
|
|
17178
|
+
return parenthesizeConstituentTypeOfUnionType(type);
|
|
17179
|
+
}
|
|
17180
|
+
function parenthesizeConstituentTypesOfIntersectionType(members) {
|
|
17181
|
+
return factory.createNodeArray(ts.sameMap(members, parenthesizeConstituentTypeOfIntersectionType));
|
|
17182
|
+
}
|
|
17183
|
+
function parenthesizeOperandOfTypeOperator(type) {
|
|
17184
|
+
switch (type.kind) {
|
|
17185
|
+
case 188:
|
|
17186
|
+
return factory.createParenthesizedType(type);
|
|
17187
|
+
}
|
|
17188
|
+
return parenthesizeConstituentTypeOfIntersectionType(type);
|
|
17189
|
+
}
|
|
17190
|
+
function parenthesizeOperandOfReadonlyTypeOperator(type) {
|
|
17191
|
+
switch (type.kind) {
|
|
17147
17192
|
case 193:
|
|
17193
|
+
return factory.createParenthesizedType(type);
|
|
17194
|
+
}
|
|
17195
|
+
return parenthesizeOperandOfTypeOperator(type);
|
|
17196
|
+
}
|
|
17197
|
+
function parenthesizeNonArrayTypeOfPostfixType(type) {
|
|
17198
|
+
switch (type.kind) {
|
|
17148
17199
|
case 190:
|
|
17149
|
-
|
|
17200
|
+
case 193:
|
|
17201
|
+
case 181:
|
|
17202
|
+
return factory.createParenthesizedType(type);
|
|
17150
17203
|
}
|
|
17151
|
-
return
|
|
17204
|
+
return parenthesizeOperandOfTypeOperator(type);
|
|
17152
17205
|
}
|
|
17153
|
-
function
|
|
17154
|
-
return factory.createNodeArray(ts.sameMap(
|
|
17206
|
+
function parenthesizeElementTypesOfTupleType(types) {
|
|
17207
|
+
return factory.createNodeArray(ts.sameMap(types, parenthesizeElementTypeOfTupleType));
|
|
17208
|
+
}
|
|
17209
|
+
function parenthesizeElementTypeOfTupleType(type) {
|
|
17210
|
+
if (hasJSDocPostfixQuestion(type))
|
|
17211
|
+
return factory.createParenthesizedType(type);
|
|
17212
|
+
return type;
|
|
17213
|
+
}
|
|
17214
|
+
function hasJSDocPostfixQuestion(type) {
|
|
17215
|
+
if (ts.isJSDocNullableType(type))
|
|
17216
|
+
return type.postfix;
|
|
17217
|
+
if (ts.isNamedTupleMember(type))
|
|
17218
|
+
return hasJSDocPostfixQuestion(type.type);
|
|
17219
|
+
if (ts.isFunctionTypeNode(type) || ts.isConstructorTypeNode(type) || ts.isTypeOperatorNode(type))
|
|
17220
|
+
return hasJSDocPostfixQuestion(type.type);
|
|
17221
|
+
if (ts.isConditionalTypeNode(type))
|
|
17222
|
+
return hasJSDocPostfixQuestion(type.falseType);
|
|
17223
|
+
if (ts.isUnionTypeNode(type))
|
|
17224
|
+
return hasJSDocPostfixQuestion(ts.last(type.types));
|
|
17225
|
+
if (ts.isIntersectionTypeNode(type))
|
|
17226
|
+
return hasJSDocPostfixQuestion(ts.last(type.types));
|
|
17227
|
+
if (ts.isInferTypeNode(type))
|
|
17228
|
+
return !!type.typeParameter.constraint && hasJSDocPostfixQuestion(type.typeParameter.constraint);
|
|
17229
|
+
return false;
|
|
17230
|
+
}
|
|
17231
|
+
function parenthesizeTypeOfOptionalType(type) {
|
|
17232
|
+
if (hasJSDocPostfixQuestion(type))
|
|
17233
|
+
return factory.createParenthesizedType(type);
|
|
17234
|
+
return parenthesizeNonArrayTypeOfPostfixType(type);
|
|
17235
|
+
}
|
|
17236
|
+
function parenthesizeLeadingTypeArgument(node) {
|
|
17237
|
+
return ts.isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory.createParenthesizedType(node) : node;
|
|
17155
17238
|
}
|
|
17156
17239
|
function parenthesizeOrdinalTypeArgument(node, i) {
|
|
17157
|
-
return i === 0
|
|
17240
|
+
return i === 0 ? parenthesizeLeadingTypeArgument(node) : node;
|
|
17158
17241
|
}
|
|
17159
17242
|
function parenthesizeTypeArguments(typeArguments) {
|
|
17160
17243
|
if (ts.some(typeArguments)) {
|
|
@@ -17180,11 +17263,20 @@ var ts;
|
|
|
17180
17263
|
parenthesizeExpressionForDisallowedComma: ts.identity,
|
|
17181
17264
|
parenthesizeExpressionOfExpressionStatement: ts.identity,
|
|
17182
17265
|
parenthesizeConciseBodyOfArrowFunction: ts.identity,
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17266
|
+
parenthesizeCheckTypeOfConditionalType: ts.identity,
|
|
17267
|
+
parenthesizeExtendsTypeOfConditionalType: ts.identity,
|
|
17268
|
+
parenthesizeConstituentTypesOfUnionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
17269
|
+
parenthesizeConstituentTypeOfUnionType: ts.identity,
|
|
17270
|
+
parenthesizeConstituentTypesOfIntersectionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
17271
|
+
parenthesizeConstituentTypeOfIntersectionType: ts.identity,
|
|
17272
|
+
parenthesizeOperandOfTypeOperator: ts.identity,
|
|
17273
|
+
parenthesizeOperandOfReadonlyTypeOperator: ts.identity,
|
|
17274
|
+
parenthesizeNonArrayTypeOfPostfixType: ts.identity,
|
|
17275
|
+
parenthesizeElementTypesOfTupleType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
17276
|
+
parenthesizeElementTypeOfTupleType: ts.identity,
|
|
17277
|
+
parenthesizeTypeOfOptionalType: ts.identity,
|
|
17187
17278
|
parenthesizeTypeArguments: function (nodes) { return nodes && ts.cast(nodes, ts.isNodeArray); },
|
|
17279
|
+
parenthesizeLeadingTypeArgument: ts.identity,
|
|
17188
17280
|
};
|
|
17189
17281
|
})(ts || (ts = {}));
|
|
17190
17282
|
var ts;
|
|
@@ -17302,6 +17394,8 @@ var ts;
|
|
|
17302
17394
|
var getJSDocPrimaryTypeCreateFunction = ts.memoizeOne(function (kind) { return function () { return createJSDocPrimaryTypeWorker(kind); }; });
|
|
17303
17395
|
var getJSDocUnaryTypeCreateFunction = ts.memoizeOne(function (kind) { return function (type) { return createJSDocUnaryTypeWorker(kind, type); }; });
|
|
17304
17396
|
var getJSDocUnaryTypeUpdateFunction = ts.memoizeOne(function (kind) { return function (node, type) { return updateJSDocUnaryTypeWorker(kind, node, type); }; });
|
|
17397
|
+
var getJSDocPrePostfixUnaryTypeCreateFunction = ts.memoizeOne(function (kind) { return function (type, postfix) { return createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix); }; });
|
|
17398
|
+
var getJSDocPrePostfixUnaryTypeUpdateFunction = ts.memoizeOne(function (kind) { return function (node, type) { return updateJSDocPrePostfixUnaryTypeWorker(kind, node, type); }; });
|
|
17305
17399
|
var getJSDocSimpleTagCreateFunction = ts.memoizeOne(function (kind) { return function (tagName, comment) { return createJSDocSimpleTagWorker(kind, tagName, comment); }; });
|
|
17306
17400
|
var getJSDocSimpleTagUpdateFunction = ts.memoizeOne(function (kind) { return function (node, tagName, comment) { return updateJSDocSimpleTagWorker(kind, node, tagName, comment); }; });
|
|
17307
17401
|
var getJSDocTypeLikeTagCreateFunction = ts.memoizeOne(function (kind) { return function (tagName, typeExpression, comment) { return createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment); }; });
|
|
@@ -17309,6 +17403,8 @@ var ts;
|
|
|
17309
17403
|
var factory = {
|
|
17310
17404
|
get parenthesizer() { return parenthesizerRules(); },
|
|
17311
17405
|
get converters() { return converters(); },
|
|
17406
|
+
baseFactory: baseFactory,
|
|
17407
|
+
flags: flags,
|
|
17312
17408
|
createNodeArray: createNodeArray,
|
|
17313
17409
|
createNumericLiteral: createNumericLiteral,
|
|
17314
17410
|
createBigIntLiteral: createBigIntLiteral,
|
|
@@ -17583,10 +17679,10 @@ var ts;
|
|
|
17583
17679
|
updateExternalModuleReference: updateExternalModuleReference,
|
|
17584
17680
|
get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(312); },
|
|
17585
17681
|
get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(313); },
|
|
17586
|
-
get createJSDocNonNullableType() { return
|
|
17587
|
-
get updateJSDocNonNullableType() { return
|
|
17588
|
-
get createJSDocNullableType() { return
|
|
17589
|
-
get updateJSDocNullableType() { return
|
|
17682
|
+
get createJSDocNonNullableType() { return getJSDocPrePostfixUnaryTypeCreateFunction(315); },
|
|
17683
|
+
get updateJSDocNonNullableType() { return getJSDocPrePostfixUnaryTypeUpdateFunction(315); },
|
|
17684
|
+
get createJSDocNullableType() { return getJSDocPrePostfixUnaryTypeCreateFunction(314); },
|
|
17685
|
+
get updateJSDocNullableType() { return getJSDocPrePostfixUnaryTypeUpdateFunction(314); },
|
|
17590
17686
|
get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(316); },
|
|
17591
17687
|
get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(316); },
|
|
17592
17688
|
get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(318); },
|
|
@@ -18560,7 +18656,7 @@ var ts;
|
|
|
18560
18656
|
}
|
|
18561
18657
|
function createArrayTypeNode(elementType) {
|
|
18562
18658
|
var node = createBaseNode(183);
|
|
18563
|
-
node.elementType = parenthesizerRules().
|
|
18659
|
+
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
|
|
18564
18660
|
node.transformFlags = 1;
|
|
18565
18661
|
return node;
|
|
18566
18662
|
}
|
|
@@ -18571,7 +18667,7 @@ var ts;
|
|
|
18571
18667
|
}
|
|
18572
18668
|
function createTupleTypeNode(elements) {
|
|
18573
18669
|
var node = createBaseNode(184);
|
|
18574
|
-
node.elements = createNodeArray(elements);
|
|
18670
|
+
node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
|
|
18575
18671
|
node.transformFlags = 1;
|
|
18576
18672
|
return node;
|
|
18577
18673
|
}
|
|
@@ -18599,7 +18695,7 @@ var ts;
|
|
|
18599
18695
|
}
|
|
18600
18696
|
function createOptionalTypeNode(type) {
|
|
18601
18697
|
var node = createBaseNode(185);
|
|
18602
|
-
node.type = parenthesizerRules().
|
|
18698
|
+
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
|
|
18603
18699
|
node.transformFlags = 1;
|
|
18604
18700
|
return node;
|
|
18605
18701
|
}
|
|
@@ -18619,33 +18715,33 @@ var ts;
|
|
|
18619
18715
|
? update(createRestTypeNode(type), node)
|
|
18620
18716
|
: node;
|
|
18621
18717
|
}
|
|
18622
|
-
function createUnionOrIntersectionTypeNode(kind, types) {
|
|
18718
|
+
function createUnionOrIntersectionTypeNode(kind, types, parenthesize) {
|
|
18623
18719
|
var node = createBaseNode(kind);
|
|
18624
|
-
node.types =
|
|
18720
|
+
node.types = factory.createNodeArray(parenthesize(types));
|
|
18625
18721
|
node.transformFlags = 1;
|
|
18626
18722
|
return node;
|
|
18627
18723
|
}
|
|
18628
|
-
function updateUnionOrIntersectionTypeNode(node, types) {
|
|
18724
|
+
function updateUnionOrIntersectionTypeNode(node, types, parenthesize) {
|
|
18629
18725
|
return node.types !== types
|
|
18630
|
-
? update(createUnionOrIntersectionTypeNode(node.kind, types), node)
|
|
18726
|
+
? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node)
|
|
18631
18727
|
: node;
|
|
18632
18728
|
}
|
|
18633
18729
|
function createUnionTypeNode(types) {
|
|
18634
|
-
return createUnionOrIntersectionTypeNode(187, types);
|
|
18730
|
+
return createUnionOrIntersectionTypeNode(187, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
|
|
18635
18731
|
}
|
|
18636
18732
|
function updateUnionTypeNode(node, types) {
|
|
18637
|
-
return updateUnionOrIntersectionTypeNode(node, types);
|
|
18733
|
+
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
|
|
18638
18734
|
}
|
|
18639
18735
|
function createIntersectionTypeNode(types) {
|
|
18640
|
-
return createUnionOrIntersectionTypeNode(188, types);
|
|
18736
|
+
return createUnionOrIntersectionTypeNode(188, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
|
|
18641
18737
|
}
|
|
18642
18738
|
function updateIntersectionTypeNode(node, types) {
|
|
18643
|
-
return updateUnionOrIntersectionTypeNode(node, types);
|
|
18739
|
+
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
|
|
18644
18740
|
}
|
|
18645
18741
|
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
|
|
18646
18742
|
var node = createBaseNode(189);
|
|
18647
|
-
node.checkType = parenthesizerRules().
|
|
18648
|
-
node.extendsType = parenthesizerRules().
|
|
18743
|
+
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
|
|
18744
|
+
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
|
|
18649
18745
|
node.trueType = trueType;
|
|
18650
18746
|
node.falseType = falseType;
|
|
18651
18747
|
node.transformFlags = 1;
|
|
@@ -18731,7 +18827,9 @@ var ts;
|
|
|
18731
18827
|
function createTypeOperatorNode(operator, type) {
|
|
18732
18828
|
var node = createBaseNode(193);
|
|
18733
18829
|
node.operator = operator;
|
|
18734
|
-
node.type =
|
|
18830
|
+
node.type = operator === 145 ?
|
|
18831
|
+
parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) :
|
|
18832
|
+
parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
|
|
18735
18833
|
node.transformFlags = 1;
|
|
18736
18834
|
return node;
|
|
18737
18835
|
}
|
|
@@ -18742,7 +18840,7 @@ var ts;
|
|
|
18742
18840
|
}
|
|
18743
18841
|
function createIndexedAccessTypeNode(objectType, indexType) {
|
|
18744
18842
|
var node = createBaseNode(194);
|
|
18745
|
-
node.objectType = parenthesizerRules().
|
|
18843
|
+
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
|
|
18746
18844
|
node.indexType = indexType;
|
|
18747
18845
|
node.transformFlags = 1;
|
|
18748
18846
|
return node;
|
|
@@ -20253,11 +20351,22 @@ var ts;
|
|
|
20253
20351
|
function createJSDocPrimaryTypeWorker(kind) {
|
|
20254
20352
|
return createBaseNode(kind);
|
|
20255
20353
|
}
|
|
20354
|
+
function createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix) {
|
|
20355
|
+
if (postfix === void 0) { postfix = false; }
|
|
20356
|
+
var node = createJSDocUnaryTypeWorker(kind, postfix ? type && parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(type) : type);
|
|
20357
|
+
node.postfix = postfix;
|
|
20358
|
+
return node;
|
|
20359
|
+
}
|
|
20256
20360
|
function createJSDocUnaryTypeWorker(kind, type) {
|
|
20257
20361
|
var node = createBaseNode(kind);
|
|
20258
20362
|
node.type = type;
|
|
20259
20363
|
return node;
|
|
20260
20364
|
}
|
|
20365
|
+
function updateJSDocPrePostfixUnaryTypeWorker(kind, node, type) {
|
|
20366
|
+
return node.type !== type
|
|
20367
|
+
? update(createJSDocPrePostfixUnaryTypeWorker(kind, type, node.postfix), node)
|
|
20368
|
+
: node;
|
|
20369
|
+
}
|
|
20261
20370
|
function updateJSDocUnaryTypeWorker(kind, node, type) {
|
|
20262
20371
|
return node.type !== type
|
|
20263
20372
|
? update(createJSDocUnaryTypeWorker(kind, type), node)
|
|
@@ -24325,7 +24434,7 @@ var ts;
|
|
|
24325
24434
|
|| ts.isExportDeclaration(node) ? node : undefined;
|
|
24326
24435
|
}
|
|
24327
24436
|
function getImportMetaIfNecessary(sourceFile) {
|
|
24328
|
-
return sourceFile.flags &
|
|
24437
|
+
return sourceFile.flags & 4194304 ?
|
|
24329
24438
|
walkTreeForImportMeta(sourceFile) :
|
|
24330
24439
|
undefined;
|
|
24331
24440
|
}
|
|
@@ -24934,7 +25043,7 @@ var ts;
|
|
|
24934
25043
|
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
|
|
24935
25044
|
if (aggressiveChecks === void 0) { aggressiveChecks = false; }
|
|
24936
25045
|
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
|
|
24937
|
-
newSourceFile.flags |= (sourceFile.flags &
|
|
25046
|
+
newSourceFile.flags |= (sourceFile.flags & 6291456);
|
|
24938
25047
|
return newSourceFile;
|
|
24939
25048
|
}
|
|
24940
25049
|
ts.updateSourceFile = updateSourceFile;
|
|
@@ -25121,10 +25230,10 @@ var ts;
|
|
|
25121
25230
|
switch (scriptKind) {
|
|
25122
25231
|
case 1:
|
|
25123
25232
|
case 2:
|
|
25124
|
-
contextFlags =
|
|
25233
|
+
contextFlags = 262144;
|
|
25125
25234
|
break;
|
|
25126
25235
|
case 6:
|
|
25127
|
-
contextFlags =
|
|
25236
|
+
contextFlags = 262144 | 67108864;
|
|
25128
25237
|
break;
|
|
25129
25238
|
default:
|
|
25130
25239
|
contextFlags = 0;
|
|
@@ -25156,7 +25265,7 @@ var ts;
|
|
|
25156
25265
|
function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) {
|
|
25157
25266
|
var isDeclarationFile = isDeclarationFileName(fileName);
|
|
25158
25267
|
if (isDeclarationFile) {
|
|
25159
|
-
contextFlags |=
|
|
25268
|
+
contextFlags |= 16777216;
|
|
25160
25269
|
}
|
|
25161
25270
|
sourceFlags = contextFlags;
|
|
25162
25271
|
nextToken();
|
|
@@ -25193,7 +25302,7 @@ var ts;
|
|
|
25193
25302
|
node.jsDoc = jsDoc;
|
|
25194
25303
|
if (hasDeprecatedTag) {
|
|
25195
25304
|
hasDeprecatedTag = false;
|
|
25196
|
-
node.flags |=
|
|
25305
|
+
node.flags |= 268435456;
|
|
25197
25306
|
}
|
|
25198
25307
|
return node;
|
|
25199
25308
|
}
|
|
@@ -25355,6 +25464,12 @@ var ts;
|
|
|
25355
25464
|
function disallowInAnd(func) {
|
|
25356
25465
|
return doInsideOfContext(4096, func);
|
|
25357
25466
|
}
|
|
25467
|
+
function allowConditionalTypesAnd(func) {
|
|
25468
|
+
return doOutsideOfContext(65536, func);
|
|
25469
|
+
}
|
|
25470
|
+
function disallowConditionalTypesAnd(func) {
|
|
25471
|
+
return doInsideOfContext(65536, func);
|
|
25472
|
+
}
|
|
25358
25473
|
function doInYieldContext(func) {
|
|
25359
25474
|
return doInsideOfContext(8192, func);
|
|
25360
25475
|
}
|
|
@@ -25382,6 +25497,9 @@ var ts;
|
|
|
25382
25497
|
function inDisallowInContext() {
|
|
25383
25498
|
return inContext(4096);
|
|
25384
25499
|
}
|
|
25500
|
+
function inDisallowConditionalTypesContext() {
|
|
25501
|
+
return inContext(65536);
|
|
25502
|
+
}
|
|
25385
25503
|
function inDecoratorContext() {
|
|
25386
25504
|
return inContext(16384);
|
|
25387
25505
|
}
|
|
@@ -25700,7 +25818,7 @@ var ts;
|
|
|
25700
25818
|
}
|
|
25701
25819
|
if (parseErrorBeforeNextFinishedNode) {
|
|
25702
25820
|
parseErrorBeforeNextFinishedNode = false;
|
|
25703
|
-
node.flags |=
|
|
25821
|
+
node.flags |= 131072;
|
|
25704
25822
|
}
|
|
25705
25823
|
return node;
|
|
25706
25824
|
}
|
|
@@ -26078,7 +26196,7 @@ var ts;
|
|
|
26078
26196
|
if (ts.nodeIsMissing(node) || node.intersectsChange || ts.containsParseError(node)) {
|
|
26079
26197
|
return undefined;
|
|
26080
26198
|
}
|
|
26081
|
-
var nodeContextFlags = node.flags &
|
|
26199
|
+
var nodeContextFlags = node.flags & 50720768;
|
|
26082
26200
|
if (nodeContextFlags !== contextFlags) {
|
|
26083
26201
|
return undefined;
|
|
26084
26202
|
}
|
|
@@ -26284,7 +26402,11 @@ var ts;
|
|
|
26284
26402
|
while (true) {
|
|
26285
26403
|
if (isListElement(kind, false)) {
|
|
26286
26404
|
var startPos = scanner.getStartPos();
|
|
26287
|
-
|
|
26405
|
+
var result = parseListElement(kind, parseElement);
|
|
26406
|
+
if (!result) {
|
|
26407
|
+
return undefined;
|
|
26408
|
+
}
|
|
26409
|
+
list.push(result);
|
|
26288
26410
|
commaStart = scanner.getTokenPos();
|
|
26289
26411
|
if (parseOptional(27)) {
|
|
26290
26412
|
continue;
|
|
@@ -26487,7 +26609,7 @@ var ts;
|
|
|
26487
26609
|
function parseJSDocNonNullableType() {
|
|
26488
26610
|
var pos = getNodePos();
|
|
26489
26611
|
nextToken();
|
|
26490
|
-
return finishNode(factory.createJSDocNonNullableType(parseNonArrayType()), pos);
|
|
26612
|
+
return finishNode(factory.createJSDocNonNullableType(parseNonArrayType(), false), pos);
|
|
26491
26613
|
}
|
|
26492
26614
|
function parseJSDocUnknownOrNullableType() {
|
|
26493
26615
|
var pos = getNodePos();
|
|
@@ -26501,7 +26623,7 @@ var ts;
|
|
|
26501
26623
|
return finishNode(factory.createJSDocUnknownType(), pos);
|
|
26502
26624
|
}
|
|
26503
26625
|
else {
|
|
26504
|
-
return finishNode(factory.createJSDocNullableType(parseType()), pos);
|
|
26626
|
+
return finishNode(factory.createJSDocNullableType(parseType(), false), pos);
|
|
26505
26627
|
}
|
|
26506
26628
|
}
|
|
26507
26629
|
function parseJSDocFunctionType() {
|
|
@@ -26600,13 +26722,17 @@ var ts;
|
|
|
26600
26722
|
}
|
|
26601
26723
|
return name;
|
|
26602
26724
|
}
|
|
26603
|
-
function
|
|
26604
|
-
return
|
|
26725
|
+
function isParameterNameStart() {
|
|
26726
|
+
return isBindingIdentifier() || token() === 22 || token() === 18;
|
|
26727
|
+
}
|
|
26728
|
+
function parseParameter(inOuterAwaitContext) {
|
|
26729
|
+
return parseParameterWorker(inOuterAwaitContext);
|
|
26605
26730
|
}
|
|
26606
|
-
function
|
|
26607
|
-
return parseParameterWorker(false);
|
|
26731
|
+
function parseParameterForSpeculation(inOuterAwaitContext) {
|
|
26732
|
+
return parseParameterWorker(inOuterAwaitContext, false);
|
|
26608
26733
|
}
|
|
26609
|
-
function parseParameterWorker(inOuterAwaitContext) {
|
|
26734
|
+
function parseParameterWorker(inOuterAwaitContext, allowAmbiguity) {
|
|
26735
|
+
if (allowAmbiguity === void 0) { allowAmbiguity = true; }
|
|
26610
26736
|
var pos = getNodePos();
|
|
26611
26737
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
26612
26738
|
var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();
|
|
@@ -26620,13 +26746,17 @@ var ts;
|
|
|
26620
26746
|
var savedTopLevel = topLevel;
|
|
26621
26747
|
topLevel = false;
|
|
26622
26748
|
var modifiers = parseModifiers();
|
|
26623
|
-
var
|
|
26749
|
+
var dotDotDotToken = parseOptionalToken(25);
|
|
26750
|
+
if (!allowAmbiguity && !isParameterNameStart()) {
|
|
26751
|
+
return undefined;
|
|
26752
|
+
}
|
|
26753
|
+
var node = withJSDoc(finishNode(factory.createParameterDeclaration(decorators, modifiers, dotDotDotToken, parseNameOfParameter(modifiers), parseOptionalToken(57), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc);
|
|
26624
26754
|
topLevel = savedTopLevel;
|
|
26625
26755
|
return node;
|
|
26626
26756
|
}
|
|
26627
26757
|
function parseReturnType(returnToken, isType) {
|
|
26628
26758
|
if (shouldParseReturnType(returnToken, isType)) {
|
|
26629
|
-
return parseTypeOrTypePredicate
|
|
26759
|
+
return allowConditionalTypesAnd(parseTypeOrTypePredicate);
|
|
26630
26760
|
}
|
|
26631
26761
|
}
|
|
26632
26762
|
function shouldParseReturnType(returnToken, isType) {
|
|
@@ -26644,14 +26774,14 @@ var ts;
|
|
|
26644
26774
|
}
|
|
26645
26775
|
return false;
|
|
26646
26776
|
}
|
|
26647
|
-
function parseParametersWorker(flags) {
|
|
26777
|
+
function parseParametersWorker(flags, allowAmbiguity) {
|
|
26648
26778
|
var savedYieldContext = inYieldContext();
|
|
26649
26779
|
var savedAwaitContext = inAwaitContext();
|
|
26650
26780
|
setYieldContext(!!(flags & 1));
|
|
26651
26781
|
setAwaitContext(!!(flags & 2));
|
|
26652
26782
|
var parameters = flags & 32 ?
|
|
26653
26783
|
parseDelimitedList(17, parseJSDocParameter) :
|
|
26654
|
-
parseDelimitedList(16,
|
|
26784
|
+
parseDelimitedList(16, function () { return allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext); });
|
|
26655
26785
|
setYieldContext(savedYieldContext);
|
|
26656
26786
|
setAwaitContext(savedAwaitContext);
|
|
26657
26787
|
return parameters;
|
|
@@ -26660,7 +26790,7 @@ var ts;
|
|
|
26660
26790
|
if (!parseExpected(20)) {
|
|
26661
26791
|
return createMissingList();
|
|
26662
26792
|
}
|
|
26663
|
-
var parameters = parseParametersWorker(flags);
|
|
26793
|
+
var parameters = parseParametersWorker(flags, true);
|
|
26664
26794
|
parseExpected(21);
|
|
26665
26795
|
return parameters;
|
|
26666
26796
|
}
|
|
@@ -26715,7 +26845,7 @@ var ts;
|
|
|
26715
26845
|
return token() === 58 || token() === 27 || token() === 23;
|
|
26716
26846
|
}
|
|
26717
26847
|
function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
26718
|
-
var parameters = parseBracketedList(16, parseParameter, 22, 23);
|
|
26848
|
+
var parameters = parseBracketedList(16, function () { return parseParameter(false); }, 22, 23);
|
|
26719
26849
|
var type = parseTypeAnnotation();
|
|
26720
26850
|
parseTypeMemberSemicolon();
|
|
26721
26851
|
var node = factory.createIndexSignature(decorators, modifiers, parameters, type);
|
|
@@ -26976,7 +27106,7 @@ var ts;
|
|
|
26976
27106
|
return finishNode(factory.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
26977
27107
|
}
|
|
26978
27108
|
function parseImportType() {
|
|
26979
|
-
sourceFlags |=
|
|
27109
|
+
sourceFlags |= 2097152;
|
|
26980
27110
|
var pos = getNodePos();
|
|
26981
27111
|
var isTypeOf = parseOptional(112);
|
|
26982
27112
|
parseExpected(100);
|
|
@@ -27119,14 +27249,14 @@ var ts;
|
|
|
27119
27249
|
switch (token()) {
|
|
27120
27250
|
case 53:
|
|
27121
27251
|
nextToken();
|
|
27122
|
-
type = finishNode(factory.createJSDocNonNullableType(type), pos);
|
|
27252
|
+
type = finishNode(factory.createJSDocNonNullableType(type, true), pos);
|
|
27123
27253
|
break;
|
|
27124
27254
|
case 57:
|
|
27125
27255
|
if (lookAhead(nextTokenIsStartOfType)) {
|
|
27126
27256
|
return type;
|
|
27127
27257
|
}
|
|
27128
27258
|
nextToken();
|
|
27129
|
-
type = finishNode(factory.createJSDocNullableType(type), pos);
|
|
27259
|
+
type = finishNode(factory.createJSDocNullableType(type, true), pos);
|
|
27130
27260
|
break;
|
|
27131
27261
|
case 22:
|
|
27132
27262
|
parseExpected(22);
|
|
@@ -27151,9 +27281,20 @@ var ts;
|
|
|
27151
27281
|
parseExpected(operator);
|
|
27152
27282
|
return finishNode(factory.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos);
|
|
27153
27283
|
}
|
|
27284
|
+
function tryParseConstraintOfInferType() {
|
|
27285
|
+
if (parseOptional(94)) {
|
|
27286
|
+
var constraint = disallowConditionalTypesAnd(parseType);
|
|
27287
|
+
if (inDisallowConditionalTypesContext() || token() !== 57) {
|
|
27288
|
+
return constraint;
|
|
27289
|
+
}
|
|
27290
|
+
}
|
|
27291
|
+
}
|
|
27154
27292
|
function parseTypeParameterOfInferType() {
|
|
27155
27293
|
var pos = getNodePos();
|
|
27156
|
-
|
|
27294
|
+
var name = parseIdentifier();
|
|
27295
|
+
var constraint = tryParse(tryParseConstraintOfInferType);
|
|
27296
|
+
var node = factory.createTypeParameterDeclaration(undefined, name, constraint);
|
|
27297
|
+
return finishNode(node, pos);
|
|
27157
27298
|
}
|
|
27158
27299
|
function parseInferType() {
|
|
27159
27300
|
var pos = getNodePos();
|
|
@@ -27170,7 +27311,7 @@ var ts;
|
|
|
27170
27311
|
case 137:
|
|
27171
27312
|
return parseInferType();
|
|
27172
27313
|
}
|
|
27173
|
-
return parsePostfixTypeOrHigher
|
|
27314
|
+
return allowConditionalTypesAnd(parsePostfixTypeOrHigher);
|
|
27174
27315
|
}
|
|
27175
27316
|
function parseFunctionOrConstructorTypeToError(isInUnionType) {
|
|
27176
27317
|
if (isStartOfFunctionTypeOrConstructorType()) {
|
|
@@ -27286,20 +27427,20 @@ var ts;
|
|
|
27286
27427
|
return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos);
|
|
27287
27428
|
}
|
|
27288
27429
|
function parseType() {
|
|
27289
|
-
|
|
27290
|
-
|
|
27291
|
-
|
|
27430
|
+
if (contextFlags & 40960) {
|
|
27431
|
+
return doOutsideOfContext(40960, parseType);
|
|
27432
|
+
}
|
|
27292
27433
|
if (isStartOfFunctionTypeOrConstructorType()) {
|
|
27293
27434
|
return parseFunctionOrConstructorType();
|
|
27294
27435
|
}
|
|
27295
27436
|
var pos = getNodePos();
|
|
27296
27437
|
var type = parseUnionTypeOrHigher();
|
|
27297
|
-
if (!
|
|
27298
|
-
var extendsType =
|
|
27438
|
+
if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional(94)) {
|
|
27439
|
+
var extendsType = disallowConditionalTypesAnd(parseType);
|
|
27299
27440
|
parseExpected(57);
|
|
27300
|
-
var trueType =
|
|
27441
|
+
var trueType = allowConditionalTypesAnd(parseType);
|
|
27301
27442
|
parseExpected(58);
|
|
27302
|
-
var falseType =
|
|
27443
|
+
var falseType = allowConditionalTypesAnd(parseType);
|
|
27303
27444
|
return finishNode(factory.createConditionalTypeNode(type, extendsType, trueType, falseType), pos);
|
|
27304
27445
|
}
|
|
27305
27446
|
return type;
|
|
@@ -27589,7 +27730,16 @@ var ts;
|
|
|
27589
27730
|
parameters = createMissingList();
|
|
27590
27731
|
}
|
|
27591
27732
|
else {
|
|
27592
|
-
|
|
27733
|
+
if (!allowAmbiguity) {
|
|
27734
|
+
var maybeParameters = parseParametersWorker(isAsync, allowAmbiguity);
|
|
27735
|
+
if (!maybeParameters) {
|
|
27736
|
+
return undefined;
|
|
27737
|
+
}
|
|
27738
|
+
parameters = maybeParameters;
|
|
27739
|
+
}
|
|
27740
|
+
else {
|
|
27741
|
+
parameters = parseParametersWorker(isAsync, allowAmbiguity);
|
|
27742
|
+
}
|
|
27593
27743
|
if (!parseExpected(21) && !allowAmbiguity) {
|
|
27594
27744
|
return undefined;
|
|
27595
27745
|
}
|
|
@@ -27809,14 +27959,14 @@ var ts;
|
|
|
27809
27959
|
var expression;
|
|
27810
27960
|
if (token() === 100) {
|
|
27811
27961
|
if (lookAhead(nextTokenIsOpenParenOrLessThan)) {
|
|
27812
|
-
sourceFlags |=
|
|
27962
|
+
sourceFlags |= 2097152;
|
|
27813
27963
|
expression = parseTokenNode();
|
|
27814
27964
|
}
|
|
27815
27965
|
else if (lookAhead(nextTokenIsDot)) {
|
|
27816
27966
|
nextToken();
|
|
27817
27967
|
nextToken();
|
|
27818
27968
|
expression = finishNode(factory.createMetaProperty(100, parseIdentifierName()), pos);
|
|
27819
|
-
sourceFlags |=
|
|
27969
|
+
sourceFlags |= 4194304;
|
|
27820
27970
|
}
|
|
27821
27971
|
else {
|
|
27822
27972
|
expression = parseMemberExpressionOrHigher();
|
|
@@ -27960,7 +28110,7 @@ var ts;
|
|
|
27960
28110
|
return finishNode(factory.createJsxOpeningFragment(), pos);
|
|
27961
28111
|
}
|
|
27962
28112
|
var tagName = parseJsxElementName();
|
|
27963
|
-
var typeArguments = (contextFlags &
|
|
28113
|
+
var typeArguments = (contextFlags & 262144) === 0 ? tryParseTypeArguments() : undefined;
|
|
27964
28114
|
var attributes = parseJsxAttributes();
|
|
27965
28115
|
var node;
|
|
27966
28116
|
if (token() === 31) {
|
|
@@ -28218,7 +28368,7 @@ var ts;
|
|
|
28218
28368
|
return result;
|
|
28219
28369
|
}
|
|
28220
28370
|
function parseTypeArgumentsInExpression() {
|
|
28221
|
-
if ((contextFlags &
|
|
28371
|
+
if ((contextFlags & 262144) !== 0) {
|
|
28222
28372
|
return undefined;
|
|
28223
28373
|
}
|
|
28224
28374
|
if (reScanLessThanToken() !== 29) {
|
|
@@ -28577,7 +28727,7 @@ var ts;
|
|
|
28577
28727
|
var openParenParsed = parseExpected(20);
|
|
28578
28728
|
var expression = allowInAnd(parseExpression);
|
|
28579
28729
|
parseExpectedMatchingBrackets(20, 21, openParenParsed, openParenPosition);
|
|
28580
|
-
var statement = doInsideOfContext(
|
|
28730
|
+
var statement = doInsideOfContext(33554432, parseStatement);
|
|
28581
28731
|
return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc);
|
|
28582
28732
|
}
|
|
28583
28733
|
function parseCaseClause() {
|
|
@@ -28899,16 +29049,16 @@ var ts;
|
|
|
28899
29049
|
if (isAmbient) {
|
|
28900
29050
|
for (var _i = 0, _a = modifiers; _i < _a.length; _i++) {
|
|
28901
29051
|
var m = _a[_i];
|
|
28902
|
-
m.flags |=
|
|
29052
|
+
m.flags |= 16777216;
|
|
28903
29053
|
}
|
|
28904
|
-
return doInsideOfContext(
|
|
29054
|
+
return doInsideOfContext(16777216, function () { return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); });
|
|
28905
29055
|
}
|
|
28906
29056
|
else {
|
|
28907
29057
|
return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers);
|
|
28908
29058
|
}
|
|
28909
29059
|
}
|
|
28910
29060
|
function tryReuseAmbientDeclaration() {
|
|
28911
|
-
return doInsideOfContext(
|
|
29061
|
+
return doInsideOfContext(16777216, function () {
|
|
28912
29062
|
var node = currentNode(parsingContext);
|
|
28913
29063
|
if (node) {
|
|
28914
29064
|
return consumeNode(node);
|
|
@@ -29324,9 +29474,9 @@ var ts;
|
|
|
29324
29474
|
if (isAmbient) {
|
|
29325
29475
|
for (var _i = 0, _a = modifiers; _i < _a.length; _i++) {
|
|
29326
29476
|
var m = _a[_i];
|
|
29327
|
-
m.flags |=
|
|
29477
|
+
m.flags |= 16777216;
|
|
29328
29478
|
}
|
|
29329
|
-
return doInsideOfContext(
|
|
29479
|
+
return doInsideOfContext(16777216, function () { return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); });
|
|
29330
29480
|
}
|
|
29331
29481
|
else {
|
|
29332
29482
|
return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers);
|
|
@@ -29784,7 +29934,7 @@ var ts;
|
|
|
29784
29934
|
function parseJSDocTypeExpression(mayOmitBraces) {
|
|
29785
29935
|
var pos = getNodePos();
|
|
29786
29936
|
var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18);
|
|
29787
|
-
var type = doInsideOfContext(
|
|
29937
|
+
var type = doInsideOfContext(8388608, parseJSDocType);
|
|
29788
29938
|
if (!mayOmitBraces || hasBrace) {
|
|
29789
29939
|
parseExpectedJSDoc(19);
|
|
29790
29940
|
}
|
|
@@ -29813,7 +29963,7 @@ var ts;
|
|
|
29813
29963
|
JSDocParser.parseJSDocNameReference = parseJSDocNameReference;
|
|
29814
29964
|
function parseIsolatedJSDocComment(content, start, length) {
|
|
29815
29965
|
initializeState("", content, 99, undefined, 1);
|
|
29816
|
-
var jsDoc = doInsideOfContext(
|
|
29966
|
+
var jsDoc = doInsideOfContext(8388608, function () { return parseJSDocCommentWorker(start, length); });
|
|
29817
29967
|
var sourceFile = { languageVariant: 0, text: content };
|
|
29818
29968
|
var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
29819
29969
|
clearState();
|
|
@@ -29824,9 +29974,9 @@ var ts;
|
|
|
29824
29974
|
var saveToken = currentToken;
|
|
29825
29975
|
var saveParseDiagnosticsLength = parseDiagnostics.length;
|
|
29826
29976
|
var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode;
|
|
29827
|
-
var comment = doInsideOfContext(
|
|
29977
|
+
var comment = doInsideOfContext(8388608, function () { return parseJSDocCommentWorker(start, length); });
|
|
29828
29978
|
ts.setParent(comment, parent);
|
|
29829
|
-
if (contextFlags &
|
|
29979
|
+
if (contextFlags & 262144) {
|
|
29830
29980
|
if (!jsDocDiagnostics) {
|
|
29831
29981
|
jsDocDiagnostics = [];
|
|
29832
29982
|
}
|
|
@@ -30595,7 +30745,7 @@ var ts;
|
|
|
30595
30745
|
if (isBracketed) {
|
|
30596
30746
|
skipWhitespace();
|
|
30597
30747
|
parseExpected(63);
|
|
30598
|
-
defaultType = doInsideOfContext(
|
|
30748
|
+
defaultType = doInsideOfContext(8388608, parseJSDocType);
|
|
30599
30749
|
parseExpected(23);
|
|
30600
30750
|
}
|
|
30601
30751
|
if (ts.nodeIsMissing(name)) {
|
|
@@ -37442,7 +37592,7 @@ var ts;
|
|
|
37442
37592
|
return !!body && body.statements.some(function (s) { return ts.isExportDeclaration(s) || ts.isExportAssignment(s); });
|
|
37443
37593
|
}
|
|
37444
37594
|
function setExportContextFlag(node) {
|
|
37445
|
-
if (node.flags &
|
|
37595
|
+
if (node.flags & 16777216 && !hasExportDeclarations(node)) {
|
|
37446
37596
|
node.flags |= 64;
|
|
37447
37597
|
}
|
|
37448
37598
|
else {
|
|
@@ -37617,8 +37767,8 @@ var ts;
|
|
|
37617
37767
|
}
|
|
37618
37768
|
function checkContextualIdentifier(node) {
|
|
37619
37769
|
if (!file.parseDiagnostics.length &&
|
|
37770
|
+
!(node.flags & 16777216) &&
|
|
37620
37771
|
!(node.flags & 8388608) &&
|
|
37621
|
-
!(node.flags & 4194304) &&
|
|
37622
37772
|
!ts.isIdentifierName(node)) {
|
|
37623
37773
|
if (inStrictMode &&
|
|
37624
37774
|
node.originalKeywordKind >= 117 &&
|
|
@@ -38493,7 +38643,7 @@ var ts;
|
|
|
38493
38643
|
if (node.kind === 340 && container.kind !== 323) {
|
|
38494
38644
|
return;
|
|
38495
38645
|
}
|
|
38496
|
-
if (inStrictMode && !(node.flags &
|
|
38646
|
+
if (inStrictMode && !(node.flags & 16777216)) {
|
|
38497
38647
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
38498
38648
|
}
|
|
38499
38649
|
if (ts.isBindingPattern(node.name)) {
|
|
@@ -38508,7 +38658,7 @@ var ts;
|
|
|
38508
38658
|
}
|
|
38509
38659
|
}
|
|
38510
38660
|
function bindFunctionDeclaration(node) {
|
|
38511
|
-
if (!file.isDeclarationFile && !(node.flags &
|
|
38661
|
+
if (!file.isDeclarationFile && !(node.flags & 16777216)) {
|
|
38512
38662
|
if (ts.isAsyncFunction(node)) {
|
|
38513
38663
|
emitFlags |= 2048;
|
|
38514
38664
|
}
|
|
@@ -38523,7 +38673,7 @@ var ts;
|
|
|
38523
38673
|
}
|
|
38524
38674
|
}
|
|
38525
38675
|
function bindFunctionExpression(node) {
|
|
38526
|
-
if (!file.isDeclarationFile && !(node.flags &
|
|
38676
|
+
if (!file.isDeclarationFile && !(node.flags & 16777216)) {
|
|
38527
38677
|
if (ts.isAsyncFunction(node)) {
|
|
38528
38678
|
emitFlags |= 2048;
|
|
38529
38679
|
}
|
|
@@ -38536,7 +38686,7 @@ var ts;
|
|
|
38536
38686
|
return bindAnonymousDeclaration(node, 16, bindingName);
|
|
38537
38687
|
}
|
|
38538
38688
|
function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) {
|
|
38539
|
-
if (!file.isDeclarationFile && !(node.flags &
|
|
38689
|
+
if (!file.isDeclarationFile && !(node.flags & 16777216) && ts.isAsyncFunction(node)) {
|
|
38540
38690
|
emitFlags |= 2048;
|
|
38541
38691
|
}
|
|
38542
38692
|
if (currentFlow && ts.isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
|
|
@@ -38595,7 +38745,7 @@ var ts;
|
|
|
38595
38745
|
currentFlow = reportedUnreachableFlow;
|
|
38596
38746
|
if (!options.allowUnreachableCode) {
|
|
38597
38747
|
var isError_1 = ts.unreachableCodeIsError(options) &&
|
|
38598
|
-
!(node.flags &
|
|
38748
|
+
!(node.flags & 16777216) &&
|
|
38599
38749
|
(!ts.isVariableStatement(node) ||
|
|
38600
38750
|
!!(ts.getCombinedNodeFlags(node.declarationList) & 3) ||
|
|
38601
38751
|
node.declarationList.declarations.some(function (d) { return !!d.initializer; }));
|
|
@@ -39243,7 +39393,7 @@ var ts;
|
|
|
39243
39393
|
ts.Debug.assert(!!(getNodeLinks(file).flags & 1));
|
|
39244
39394
|
diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.getDiagnostics(file.fileName));
|
|
39245
39395
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (containingNode, kind, diag) {
|
|
39246
|
-
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags &
|
|
39396
|
+
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
39247
39397
|
(diagnostics || (diagnostics = [])).push(__assign(__assign({}, diag), { category: ts.DiagnosticCategory.Suggestion }));
|
|
39248
39398
|
}
|
|
39249
39399
|
});
|
|
@@ -39674,7 +39824,7 @@ var ts;
|
|
|
39674
39824
|
return diagnostic;
|
|
39675
39825
|
}
|
|
39676
39826
|
function isDeprecatedSymbol(symbol) {
|
|
39677
|
-
return !!(getDeclarationNodeFlagsFromSymbol(symbol) &
|
|
39827
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 268435456);
|
|
39678
39828
|
}
|
|
39679
39829
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
39680
39830
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
@@ -39885,7 +40035,7 @@ var ts;
|
|
|
39885
40035
|
mergeSymbolTable(globals, moduleAugmentation.symbol.exports);
|
|
39886
40036
|
}
|
|
39887
40037
|
else {
|
|
39888
|
-
var moduleNotFoundError = !(moduleName.parent.parent.flags &
|
|
40038
|
+
var moduleNotFoundError = !(moduleName.parent.parent.flags & 16777216)
|
|
39889
40039
|
? ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found
|
|
39890
40040
|
: undefined;
|
|
39891
40041
|
var mainModule_1 = resolveExternalModuleNameWorker(moduleName, moduleName, moduleNotFoundError, true);
|
|
@@ -39981,7 +40131,7 @@ var ts;
|
|
|
39981
40131
|
if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
|
|
39982
40132
|
(!ts.outFile(compilerOptions)) ||
|
|
39983
40133
|
isInTypeQuery(usage) ||
|
|
39984
|
-
declaration.flags &
|
|
40134
|
+
declaration.flags & 16777216) {
|
|
39985
40135
|
return true;
|
|
39986
40136
|
}
|
|
39987
40137
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
@@ -40021,7 +40171,7 @@ var ts;
|
|
|
40021
40171
|
if (usage.kind === 271 && usage.isExportEquals) {
|
|
40022
40172
|
return true;
|
|
40023
40173
|
}
|
|
40024
|
-
if (!!(usage.flags &
|
|
40174
|
+
if (!!(usage.flags & 8388608) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
|
|
40025
40175
|
return true;
|
|
40026
40176
|
}
|
|
40027
40177
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
@@ -40244,7 +40394,7 @@ var ts;
|
|
|
40244
40394
|
isInExternalModule = true;
|
|
40245
40395
|
case 261:
|
|
40246
40396
|
var moduleExports = ((_a = getSymbolOfNode(location)) === null || _a === void 0 ? void 0 : _a.exports) || emptySymbols;
|
|
40247
|
-
if (location.kind === 305 || (ts.isModuleDeclaration(location) && location.flags &
|
|
40397
|
+
if (location.kind === 305 || (ts.isModuleDeclaration(location) && location.flags & 16777216 && !ts.isGlobalScopeAugmentation(location))) {
|
|
40248
40398
|
if (result = moduleExports.get("default")) {
|
|
40249
40399
|
var localSymbol = ts.getLocalSymbolForExportDefault(result);
|
|
40250
40400
|
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
|
|
@@ -40486,7 +40636,7 @@ var ts;
|
|
|
40486
40636
|
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
|
40487
40637
|
}
|
|
40488
40638
|
}
|
|
40489
|
-
if (result && isInExternalModule && (meaning & 111551) === 111551 && !(originalLocation.flags &
|
|
40639
|
+
if (result && isInExternalModule && (meaning & 111551) === 111551 && !(originalLocation.flags & 8388608)) {
|
|
40490
40640
|
var merged = getMergedSymbol(result);
|
|
40491
40641
|
if (ts.length(merged.declarations) && ts.every(merged.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) {
|
|
40492
40642
|
errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name));
|
|
@@ -40726,7 +40876,7 @@ var ts;
|
|
|
40726
40876
|
var declaration = (_a = result.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 260); });
|
|
40727
40877
|
if (declaration === undefined)
|
|
40728
40878
|
return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
|
|
40729
|
-
if (!(declaration.flags &
|
|
40879
|
+
if (!(declaration.flags & 16777216) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
|
|
40730
40880
|
var diagnosticMessage = void 0;
|
|
40731
40881
|
var declarationName = ts.declarationNameToString(ts.getNameOfDeclaration(declaration));
|
|
40732
40882
|
if (result.flags & 2) {
|
|
@@ -41391,7 +41541,7 @@ var ts;
|
|
|
41391
41541
|
}
|
|
41392
41542
|
}
|
|
41393
41543
|
function getAssignmentDeclarationLocation(node) {
|
|
41394
|
-
var typeAlias = ts.findAncestor(node, function (node) { return !(ts.isJSDocNode(node) || node.flags &
|
|
41544
|
+
var typeAlias = ts.findAncestor(node, function (node) { return !(ts.isJSDocNode(node) || node.flags & 8388608) ? "quit" : ts.isJSDocTypeAlias(node); });
|
|
41395
41545
|
if (typeAlias) {
|
|
41396
41546
|
return;
|
|
41397
41547
|
}
|
|
@@ -42706,7 +42856,16 @@ var ts;
|
|
|
42706
42856
|
if (type.flags & 262144 || objectFlags & 3) {
|
|
42707
42857
|
if (type.flags & 262144 && ts.contains(context.inferTypeParameters, type)) {
|
|
42708
42858
|
context.approximateLength += (ts.symbolName(type.symbol).length + 6);
|
|
42709
|
-
|
|
42859
|
+
var constraintNode = void 0;
|
|
42860
|
+
var constraint = getConstraintOfTypeParameter(type);
|
|
42861
|
+
if (constraint) {
|
|
42862
|
+
var inferredConstraint = getInferredTypeParameterConstraint(type, true);
|
|
42863
|
+
if (!(inferredConstraint && isTypeIdenticalTo(constraint, inferredConstraint))) {
|
|
42864
|
+
context.approximateLength += 9;
|
|
42865
|
+
constraintNode = constraint && typeToTypeNodeHelper(constraint, context);
|
|
42866
|
+
}
|
|
42867
|
+
}
|
|
42868
|
+
return ts.factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
42710
42869
|
}
|
|
42711
42870
|
if (context.flags & 4 &&
|
|
42712
42871
|
type.flags & 262144 &&
|
|
@@ -42885,7 +43044,7 @@ var ts;
|
|
|
42885
43044
|
type.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type.symbol) :
|
|
42886
43045
|
undefined;
|
|
42887
43046
|
if (!context.visitedTypes) {
|
|
42888
|
-
context.visitedTypes = new ts.
|
|
43047
|
+
context.visitedTypes = new ts.Map();
|
|
42889
43048
|
}
|
|
42890
43049
|
if (id && !context.symbolDepth) {
|
|
42891
43050
|
context.symbolDepth = new ts.Map();
|
|
@@ -42903,15 +43062,22 @@ var ts;
|
|
|
42903
43062
|
context.approximateLength += cachedResult.addedLength;
|
|
42904
43063
|
return deepCloneOrReuseNode(cachedResult);
|
|
42905
43064
|
}
|
|
42906
|
-
var
|
|
43065
|
+
var totalDepth = 0;
|
|
43066
|
+
var symbolDepth = id ? context.symbolDepth.get(id) : undefined;
|
|
43067
|
+
if (symbolDepth) {
|
|
43068
|
+
totalDepth += symbolDepth;
|
|
43069
|
+
}
|
|
43070
|
+
var visitedTypeDepth = context.visitedTypes.get(typeId);
|
|
43071
|
+
if (visitedTypeDepth) {
|
|
43072
|
+
totalDepth += visitedTypeDepth;
|
|
43073
|
+
}
|
|
43074
|
+
if (totalDepth > 10) {
|
|
43075
|
+
return createElidedInformationPlaceholder(context);
|
|
43076
|
+
}
|
|
42907
43077
|
if (id) {
|
|
42908
|
-
|
|
42909
|
-
if (depth > 10) {
|
|
42910
|
-
return createElidedInformationPlaceholder(context);
|
|
42911
|
-
}
|
|
42912
|
-
context.symbolDepth.set(id, depth + 1);
|
|
43078
|
+
context.symbolDepth.set(id, (symbolDepth || 0) + 1);
|
|
42913
43079
|
}
|
|
42914
|
-
context.visitedTypes.
|
|
43080
|
+
context.visitedTypes.set(typeId, (visitedTypeDepth || 0) + 1);
|
|
42915
43081
|
var startLength = context.approximateLength;
|
|
42916
43082
|
var result = transform(type);
|
|
42917
43083
|
var addedLength = context.approximateLength - startLength;
|
|
@@ -42922,9 +43088,19 @@ var ts;
|
|
|
42922
43088
|
result.addedLength = addedLength;
|
|
42923
43089
|
(_b = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _b === void 0 ? void 0 : _b.set(key, result);
|
|
42924
43090
|
}
|
|
42925
|
-
|
|
43091
|
+
if (visitedTypeDepth !== undefined) {
|
|
43092
|
+
context.visitedTypes.set(typeId, visitedTypeDepth);
|
|
43093
|
+
}
|
|
43094
|
+
else {
|
|
43095
|
+
context.visitedTypes.delete(typeId);
|
|
43096
|
+
}
|
|
42926
43097
|
if (id) {
|
|
42927
|
-
|
|
43098
|
+
if (symbolDepth !== undefined) {
|
|
43099
|
+
context.symbolDepth.set(id, symbolDepth);
|
|
43100
|
+
}
|
|
43101
|
+
else {
|
|
43102
|
+
context.symbolDepth.delete(id);
|
|
43103
|
+
}
|
|
42928
43104
|
}
|
|
42929
43105
|
return result;
|
|
42930
43106
|
function deepCloneOrReuseNode(node) {
|
|
@@ -44437,7 +44613,7 @@ var ts;
|
|
|
44437
44613
|
newModifierFlags |= 1;
|
|
44438
44614
|
}
|
|
44439
44615
|
if (addingDeclare && !(newModifierFlags & 1) &&
|
|
44440
|
-
(!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags &
|
|
44616
|
+
(!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags & 16777216)) &&
|
|
44441
44617
|
(ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isModuleDeclaration(node))) {
|
|
44442
44618
|
newModifierFlags |= 2;
|
|
44443
44619
|
}
|
|
@@ -45203,7 +45379,7 @@ var ts;
|
|
|
45203
45379
|
}
|
|
45204
45380
|
var parent = getDeclarationContainer(node);
|
|
45205
45381
|
if (!(ts.getCombinedModifierFlags(node) & 1) &&
|
|
45206
|
-
!(node.kind !== 265 && parent.kind !== 305 && parent.flags &
|
|
45382
|
+
!(node.kind !== 265 && parent.kind !== 305 && parent.flags & 16777216)) {
|
|
45207
45383
|
return isGlobalSourceFile(parent);
|
|
45208
45384
|
}
|
|
45209
45385
|
return isDeclarationVisible(parent);
|
|
@@ -45492,7 +45668,7 @@ var ts;
|
|
|
45492
45668
|
return parentType;
|
|
45493
45669
|
}
|
|
45494
45670
|
var pattern = declaration.parent;
|
|
45495
|
-
if (strictNullChecks && declaration.flags &
|
|
45671
|
+
if (strictNullChecks && declaration.flags & 16777216 && ts.isParameterDeclaration(declaration)) {
|
|
45496
45672
|
parentType = getNonNullableType(parentType);
|
|
45497
45673
|
}
|
|
45498
45674
|
else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536)) {
|
|
@@ -45590,7 +45766,7 @@ var ts;
|
|
|
45590
45766
|
}
|
|
45591
45767
|
if ((noImplicitAny || ts.isInJSFile(declaration)) &&
|
|
45592
45768
|
ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&
|
|
45593
|
-
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags &
|
|
45769
|
+
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 16777216)) {
|
|
45594
45770
|
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
|
|
45595
45771
|
return autoType;
|
|
45596
45772
|
}
|
|
@@ -46879,7 +47055,7 @@ var ts;
|
|
|
46879
47055
|
function isLiteralEnumMember(member) {
|
|
46880
47056
|
var expr = member.initializer;
|
|
46881
47057
|
if (!expr) {
|
|
46882
|
-
return !(member.flags &
|
|
47058
|
+
return !(member.flags & 16777216);
|
|
46883
47059
|
}
|
|
46884
47060
|
switch (expr.kind) {
|
|
46885
47061
|
case 10:
|
|
@@ -49162,7 +49338,7 @@ var ts;
|
|
|
49162
49338
|
function getConstraintDeclaration(type) {
|
|
49163
49339
|
return ts.mapDefined(ts.filter(type.symbol && type.symbol.declarations, ts.isTypeParameterDeclaration), ts.getEffectiveConstraintOfTypeParameter)[0];
|
|
49164
49340
|
}
|
|
49165
|
-
function getInferredTypeParameterConstraint(typeParameter) {
|
|
49341
|
+
function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) {
|
|
49166
49342
|
var _a;
|
|
49167
49343
|
var inferences;
|
|
49168
49344
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
@@ -49170,7 +49346,7 @@ var ts;
|
|
|
49170
49346
|
var declaration = _b[_i];
|
|
49171
49347
|
if (declaration.parent.kind === 190) {
|
|
49172
49348
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
49173
|
-
if (grandParent.kind === 178) {
|
|
49349
|
+
if (grandParent.kind === 178 && !omitTypeReferences) {
|
|
49174
49350
|
var typeReference = grandParent;
|
|
49175
49351
|
var typeParameters = getTypeParametersForTypeReference(typeReference);
|
|
49176
49352
|
if (typeParameters) {
|
|
@@ -49540,7 +49716,7 @@ var ts;
|
|
|
49540
49716
|
return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type;
|
|
49541
49717
|
}
|
|
49542
49718
|
function isJSDocTypeReference(node) {
|
|
49543
|
-
return !!(node.flags &
|
|
49719
|
+
return !!(node.flags & 8388608) && (node.kind === 178 || node.kind === 200);
|
|
49544
49720
|
}
|
|
49545
49721
|
function checkNoTypeArguments(node, symbol) {
|
|
49546
49722
|
if (node.typeArguments) {
|
|
@@ -50934,7 +51110,7 @@ var ts;
|
|
|
50934
51110
|
if (ts.isCallLikeExpression(parent)) {
|
|
50935
51111
|
return ts.isCallOrNewExpression(parent) && ts.isIdentifier(node) && hasMatchingArgument(parent, node);
|
|
50936
51112
|
}
|
|
50937
|
-
return ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) &
|
|
51113
|
+
return ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 268435456); });
|
|
50938
51114
|
}
|
|
50939
51115
|
return true;
|
|
50940
51116
|
}
|
|
@@ -51327,7 +51503,11 @@ var ts;
|
|
|
51327
51503
|
return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
|
|
51328
51504
|
}
|
|
51329
51505
|
function isSingletonTupleType(node) {
|
|
51330
|
-
return ts.isTupleTypeNode(node) &&
|
|
51506
|
+
return ts.isTupleTypeNode(node) &&
|
|
51507
|
+
ts.length(node.elements) === 1 &&
|
|
51508
|
+
!ts.isOptionalTypeNode(node.elements[0]) &&
|
|
51509
|
+
!ts.isRestTypeNode(node.elements[0]) &&
|
|
51510
|
+
!(ts.isNamedTupleMember(node.elements[0]) && (node.elements[0].questionToken || node.elements[0].dotDotDotToken));
|
|
51331
51511
|
}
|
|
51332
51512
|
function unwrapNondistributiveConditionalTuple(root, type) {
|
|
51333
51513
|
return isTypicalNondistributiveConditional(root) && isTupleType(type) ? getTypeArguments(type)[0] : type;
|
|
@@ -51519,7 +51699,7 @@ var ts;
|
|
|
51519
51699
|
links.resolvedSymbol = unknownSymbol;
|
|
51520
51700
|
return links.resolvedType = errorType;
|
|
51521
51701
|
}
|
|
51522
|
-
var targetMeaning = node.isTypeOf ? 111551 : node.flags &
|
|
51702
|
+
var targetMeaning = node.isTypeOf ? 111551 : node.flags & 8388608 ? 111551 | 788968 : 788968;
|
|
51523
51703
|
var innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal);
|
|
51524
51704
|
if (!innerModuleSymbol) {
|
|
51525
51705
|
links.resolvedSymbol = unknownSymbol;
|
|
@@ -51836,7 +52016,7 @@ var ts;
|
|
|
51836
52016
|
if (parent && ts.isObjectLiteralExpression(parent) && ts.isBinaryExpression(parent.parent) && ts.getAssignmentDeclarationKind(parent.parent) === 6) {
|
|
51837
52017
|
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent.parent.left).parent).thisType;
|
|
51838
52018
|
}
|
|
51839
|
-
var host = node.flags &
|
|
52019
|
+
var host = node.flags & 8388608 ? ts.getHostSignatureFromJSDoc(node) : undefined;
|
|
51840
52020
|
if (host && ts.isFunctionExpression(host) && ts.isBinaryExpression(host.parent) && ts.getAssignmentDeclarationKind(host.parent) === 3) {
|
|
51841
52021
|
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host.parent.left).parent).thisType;
|
|
51842
52022
|
}
|
|
@@ -51909,7 +52089,7 @@ var ts;
|
|
|
51909
52089
|
case 143:
|
|
51910
52090
|
return neverType;
|
|
51911
52091
|
case 148:
|
|
51912
|
-
return node.flags &
|
|
52092
|
+
return node.flags & 262144 && !noImplicitAny ? anyType : nonPrimitiveType;
|
|
51913
52093
|
case 138:
|
|
51914
52094
|
return intrinsicMarkerType;
|
|
51915
52095
|
case 192:
|
|
@@ -57918,7 +58098,7 @@ var ts;
|
|
|
57918
58098
|
}
|
|
57919
58099
|
}
|
|
57920
58100
|
function getTypeOfDottedName(node, diagnostic) {
|
|
57921
|
-
if (!(node.flags &
|
|
58101
|
+
if (!(node.flags & 33554432)) {
|
|
57922
58102
|
switch (node.kind) {
|
|
57923
58103
|
case 79:
|
|
57924
58104
|
var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));
|
|
@@ -59123,6 +59303,7 @@ var ts;
|
|
|
59123
59303
|
function isConstraintPosition(type, node) {
|
|
59124
59304
|
var parent = node.parent;
|
|
59125
59305
|
return parent.kind === 206 ||
|
|
59306
|
+
parent.kind === 161 ||
|
|
59126
59307
|
parent.kind === 208 && parent.expression === node ||
|
|
59127
59308
|
parent.kind === 207 && parent.expression === node &&
|
|
59128
59309
|
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
@@ -59334,7 +59515,7 @@ var ts;
|
|
|
59334
59515
|
isInTypeQuery(node) || node.parent.kind === 275) ||
|
|
59335
59516
|
node.parent.kind === 230 ||
|
|
59336
59517
|
declaration.kind === 254 && declaration.exclamationToken ||
|
|
59337
|
-
declaration.flags &
|
|
59518
|
+
declaration.flags & 16777216;
|
|
59338
59519
|
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
|
|
59339
59520
|
type === autoType || type === autoArrayType ? undefinedType :
|
|
59340
59521
|
getOptionalType(type);
|
|
@@ -60169,7 +60350,7 @@ var ts;
|
|
|
60169
60350
|
}
|
|
60170
60351
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
60171
60352
|
ts.Debug.assert(ts.isObjectLiteralMethod(node));
|
|
60172
|
-
if (node.flags &
|
|
60353
|
+
if (node.flags & 33554432) {
|
|
60173
60354
|
return undefined;
|
|
60174
60355
|
}
|
|
60175
60356
|
return getContextualTypeForObjectLiteralElement(node, contextFlags);
|
|
@@ -60307,7 +60488,7 @@ var ts;
|
|
|
60307
60488
|
return type;
|
|
60308
60489
|
}
|
|
60309
60490
|
function getContextualType(node, contextFlags) {
|
|
60310
|
-
if (node.flags &
|
|
60491
|
+
if (node.flags & 33554432) {
|
|
60311
60492
|
return undefined;
|
|
60312
60493
|
}
|
|
60313
60494
|
if (node.contextualType) {
|
|
@@ -61788,7 +61969,7 @@ var ts;
|
|
|
61788
61969
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
61789
61970
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
61790
61971
|
}
|
|
61791
|
-
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) &
|
|
61972
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 268435456) {
|
|
61792
61973
|
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
61793
61974
|
}
|
|
61794
61975
|
}
|
|
@@ -61842,7 +62023,7 @@ var ts;
|
|
|
61842
62023
|
if (declaration && isPropertyWithoutInitializer(declaration)) {
|
|
61843
62024
|
if (!ts.isStatic(declaration)) {
|
|
61844
62025
|
var flowContainer = getControlFlowContainer(node);
|
|
61845
|
-
if (flowContainer.kind === 171 && flowContainer.parent === declaration.parent && !(declaration.flags &
|
|
62026
|
+
if (flowContainer.kind === 171 && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216)) {
|
|
61846
62027
|
assumeUninitialized = true;
|
|
61847
62028
|
}
|
|
61848
62029
|
}
|
|
@@ -61878,7 +62059,7 @@ var ts;
|
|
|
61878
62059
|
}
|
|
61879
62060
|
else if (valueDeclaration.kind === 257 &&
|
|
61880
62061
|
node.parent.kind !== 178 &&
|
|
61881
|
-
!(valueDeclaration.flags &
|
|
62062
|
+
!(valueDeclaration.flags & 16777216) &&
|
|
61882
62063
|
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
61883
62064
|
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
61884
62065
|
}
|
|
@@ -63819,7 +64000,7 @@ var ts;
|
|
|
63819
64000
|
return returnType;
|
|
63820
64001
|
}
|
|
63821
64002
|
function checkDeprecatedSignature(signature, node) {
|
|
63822
|
-
if (signature.declaration && signature.declaration.flags &
|
|
64003
|
+
if (signature.declaration && signature.declaration.flags & 268435456) {
|
|
63823
64004
|
var suggestionNode = getDeprecatedSuggestionNode(node);
|
|
63824
64005
|
var name = ts.tryGetPropertyAccessOrIdentifierToString(ts.getInvokedExpression(node));
|
|
63825
64006
|
addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name, signatureToString(signature));
|
|
@@ -63956,7 +64137,7 @@ var ts;
|
|
|
63956
64137
|
: 0;
|
|
63957
64138
|
if (targetDeclarationKind !== 0) {
|
|
63958
64139
|
var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
|
|
63959
|
-
return !!decl && !!(decl.flags &
|
|
64140
|
+
return !!decl && !!(decl.flags & 16777216);
|
|
63960
64141
|
}
|
|
63961
64142
|
return false;
|
|
63962
64143
|
}
|
|
@@ -64151,7 +64332,7 @@ var ts;
|
|
|
64151
64332
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
|
|
64152
64333
|
}
|
|
64153
64334
|
var file = ts.getSourceFileOfNode(node);
|
|
64154
|
-
ts.Debug.assert(!!(file.flags &
|
|
64335
|
+
ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
|
|
64155
64336
|
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
|
|
64156
64337
|
}
|
|
64157
64338
|
function getTypeOfParameter(symbol) {
|
|
@@ -66199,7 +66380,7 @@ var ts;
|
|
|
66199
66380
|
if (quickType) {
|
|
66200
66381
|
return quickType;
|
|
66201
66382
|
}
|
|
66202
|
-
if (node.flags &
|
|
66383
|
+
if (node.flags & 134217728 && flowTypeCache) {
|
|
66203
66384
|
var cachedType = flowTypeCache[getNodeId(node)];
|
|
66204
66385
|
if (cachedType) {
|
|
66205
66386
|
return cachedType;
|
|
@@ -66210,7 +66391,7 @@ var ts;
|
|
|
66210
66391
|
if (flowInvocationCount !== startInvocationCount) {
|
|
66211
66392
|
var cache = flowTypeCache || (flowTypeCache = []);
|
|
66212
66393
|
cache[getNodeId(node)] = type;
|
|
66213
|
-
ts.setNodeFlags(node, node.flags |
|
|
66394
|
+
ts.setNodeFlags(node, node.flags | 134217728);
|
|
66214
66395
|
}
|
|
66215
66396
|
return type;
|
|
66216
66397
|
}
|
|
@@ -66280,7 +66461,7 @@ var ts;
|
|
|
66280
66461
|
if (compilerOptions.isolatedModules) {
|
|
66281
66462
|
ts.Debug.assert(!!(type.symbol.flags & 128));
|
|
66282
66463
|
var constEnumDeclaration = type.symbol.valueDeclaration;
|
|
66283
|
-
if (constEnumDeclaration.flags &
|
|
66464
|
+
if (constEnumDeclaration.flags & 16777216) {
|
|
66284
66465
|
error(node, ts.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided);
|
|
66285
66466
|
}
|
|
66286
66467
|
}
|
|
@@ -66901,7 +67082,7 @@ var ts;
|
|
|
66901
67082
|
checkDecorators(node);
|
|
66902
67083
|
checkSignatureDeclaration(node);
|
|
66903
67084
|
if (node.kind === 172) {
|
|
66904
|
-
if (!(node.flags &
|
|
67085
|
+
if (!(node.flags & 16777216) && ts.nodeIsPresent(node.body) && (node.flags & 256)) {
|
|
66905
67086
|
if (!(node.flags & 512)) {
|
|
66906
67087
|
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
|
|
66907
67088
|
}
|
|
@@ -66991,7 +67172,7 @@ var ts;
|
|
|
66991
67172
|
}
|
|
66992
67173
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
66993
67174
|
if (symbol) {
|
|
66994
|
-
if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags &
|
|
67175
|
+
if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
|
|
66995
67176
|
addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
|
|
66996
67177
|
}
|
|
66997
67178
|
if (type.flags & 32 && symbol.flags & 8) {
|
|
@@ -67148,6 +67329,22 @@ var ts;
|
|
|
67148
67329
|
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
|
|
67149
67330
|
}
|
|
67150
67331
|
checkSourceElement(node.typeParameter);
|
|
67332
|
+
var symbol = getSymbolOfNode(node.typeParameter);
|
|
67333
|
+
if (symbol.declarations && symbol.declarations.length > 1) {
|
|
67334
|
+
var links = getSymbolLinks(symbol);
|
|
67335
|
+
if (!links.typeParametersChecked) {
|
|
67336
|
+
links.typeParametersChecked = true;
|
|
67337
|
+
var typeParameter = getDeclaredTypeOfTypeParameter(symbol);
|
|
67338
|
+
var declarations = ts.getDeclarationsOfKind(symbol, 163);
|
|
67339
|
+
if (!areTypeParametersIdentical(declarations, [typeParameter], function (decl) { return [decl]; })) {
|
|
67340
|
+
var name = symbolToString(symbol);
|
|
67341
|
+
for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
|
|
67342
|
+
var declaration = declarations_4[_i];
|
|
67343
|
+
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_constraints, name);
|
|
67344
|
+
}
|
|
67345
|
+
}
|
|
67346
|
+
}
|
|
67347
|
+
}
|
|
67151
67348
|
registerForUnusedIdentifiersCheck(node);
|
|
67152
67349
|
}
|
|
67153
67350
|
function checkTemplateLiteralType(node) {
|
|
@@ -67185,14 +67382,14 @@ var ts;
|
|
|
67185
67382
|
getTypeFromTypeNode(node);
|
|
67186
67383
|
}
|
|
67187
67384
|
function isPrivateWithinAmbient(node) {
|
|
67188
|
-
return (ts.hasEffectiveModifier(node, 8) || ts.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags &
|
|
67385
|
+
return (ts.hasEffectiveModifier(node, 8) || ts.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 16777216);
|
|
67189
67386
|
}
|
|
67190
67387
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
67191
67388
|
var flags = ts.getCombinedModifierFlags(n);
|
|
67192
67389
|
if (n.parent.kind !== 258 &&
|
|
67193
67390
|
n.parent.kind !== 257 &&
|
|
67194
67391
|
n.parent.kind !== 226 &&
|
|
67195
|
-
n.flags &
|
|
67392
|
+
n.flags & 16777216) {
|
|
67196
67393
|
if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
|
|
67197
67394
|
flags |= 1;
|
|
67198
67395
|
}
|
|
@@ -67304,10 +67501,10 @@ var ts;
|
|
|
67304
67501
|
var hasNonAmbientClass = false;
|
|
67305
67502
|
var functionDeclarations = [];
|
|
67306
67503
|
if (declarations) {
|
|
67307
|
-
for (var _i = 0,
|
|
67308
|
-
var current =
|
|
67504
|
+
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
|
|
67505
|
+
var current = declarations_5[_i];
|
|
67309
67506
|
var node = current;
|
|
67310
|
-
var inAmbientContext = node.flags &
|
|
67507
|
+
var inAmbientContext = node.flags & 16777216;
|
|
67311
67508
|
var inAmbientContextOrInterface = node.parent && (node.parent.kind === 258 || node.parent.kind === 182) || inAmbientContext;
|
|
67312
67509
|
if (inAmbientContextOrInterface) {
|
|
67313
67510
|
previousDeclaration = undefined;
|
|
@@ -67941,7 +68138,7 @@ var ts;
|
|
|
67941
68138
|
if (hasBindableName(node)) {
|
|
67942
68139
|
var symbol = getSymbolOfNode(node);
|
|
67943
68140
|
var localSymbol = node.localSymbol || symbol;
|
|
67944
|
-
var firstDeclaration = (_a = localSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (declaration) { return declaration.kind === node.kind && !(declaration.flags &
|
|
68141
|
+
var firstDeclaration = (_a = localSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 262144); });
|
|
67945
68142
|
if (node === firstDeclaration) {
|
|
67946
68143
|
checkFunctionOrConstructorSymbol(localSymbol);
|
|
67947
68144
|
}
|
|
@@ -68051,7 +68248,7 @@ var ts;
|
|
|
68051
68248
|
var symbol = getSymbolOfNode(member);
|
|
68052
68249
|
if (!symbol.isReferenced
|
|
68053
68250
|
&& (ts.hasEffectiveModifier(member, 8) || ts.isNamedDeclaration(member) && ts.isPrivateIdentifier(member.name))
|
|
68054
|
-
&& !(member.flags &
|
|
68251
|
+
&& !(member.flags & 16777216)) {
|
|
68055
68252
|
addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
68056
68253
|
}
|
|
68057
68254
|
break;
|
|
@@ -68226,8 +68423,8 @@ var ts;
|
|
|
68226
68423
|
: ts.createDiagnosticForNode(declarationList.parent.kind === 237 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
|
|
68227
68424
|
}
|
|
68228
68425
|
else {
|
|
68229
|
-
for (var _i = 0,
|
|
68230
|
-
var decl =
|
|
68426
|
+
for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
|
|
68427
|
+
var decl = declarations_6[_i];
|
|
68231
68428
|
addDiagnostic(decl, 0, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
|
|
68232
68429
|
}
|
|
68233
68430
|
}
|
|
@@ -68267,7 +68464,7 @@ var ts;
|
|
|
68267
68464
|
}
|
|
68268
68465
|
}
|
|
68269
68466
|
function checkCollisionWithArgumentsInGeneratedCode(node) {
|
|
68270
|
-
if (languageVersion >= 2 || !ts.hasRestParameter(node) || node.flags &
|
|
68467
|
+
if (languageVersion >= 2 || !ts.hasRestParameter(node) || node.flags & 16777216 || ts.nodeIsMissing(node.body)) {
|
|
68271
68468
|
return;
|
|
68272
68469
|
}
|
|
68273
68470
|
ts.forEach(node.parameters, function (p) {
|
|
@@ -68289,7 +68486,7 @@ var ts;
|
|
|
68289
68486
|
node.kind === 296) {
|
|
68290
68487
|
return false;
|
|
68291
68488
|
}
|
|
68292
|
-
if (node.flags &
|
|
68489
|
+
if (node.flags & 16777216) {
|
|
68293
68490
|
return false;
|
|
68294
68491
|
}
|
|
68295
68492
|
if (ts.isImportClause(node) || ts.isImportEqualsDeclaration(node) || ts.isImportSpecifier(node)) {
|
|
@@ -68415,7 +68612,7 @@ var ts;
|
|
|
68415
68612
|
recordPotentialCollisionWithReflectInGeneratedCode(node, name);
|
|
68416
68613
|
if (ts.isClassLike(node)) {
|
|
68417
68614
|
checkTypeNameIsReserved(name, ts.Diagnostics.Class_name_cannot_be_0);
|
|
68418
|
-
if (!(node.flags &
|
|
68615
|
+
if (!(node.flags & 16777216)) {
|
|
68419
68616
|
checkClassNameCollisionWithObject(name);
|
|
68420
68617
|
}
|
|
68421
68618
|
}
|
|
@@ -69676,21 +69873,21 @@ var ts;
|
|
|
69676
69873
|
return;
|
|
69677
69874
|
}
|
|
69678
69875
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
69679
|
-
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
|
|
69876
|
+
if (!areTypeParametersIdentical(declarations, type.localTypeParameters, ts.getEffectiveTypeParameterDeclarations)) {
|
|
69680
69877
|
var name = symbolToString(symbol);
|
|
69681
|
-
for (var _i = 0,
|
|
69682
|
-
var declaration =
|
|
69878
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
69879
|
+
var declaration = declarations_7[_i];
|
|
69683
69880
|
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
|
|
69684
69881
|
}
|
|
69685
69882
|
}
|
|
69686
69883
|
}
|
|
69687
69884
|
}
|
|
69688
|
-
function areTypeParametersIdentical(declarations, targetParameters) {
|
|
69885
|
+
function areTypeParametersIdentical(declarations, targetParameters, getTypeParameterDeclarations) {
|
|
69689
69886
|
var maxTypeArgumentCount = ts.length(targetParameters);
|
|
69690
69887
|
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
|
|
69691
|
-
for (var _i = 0,
|
|
69692
|
-
var declaration =
|
|
69693
|
-
var sourceParameters =
|
|
69888
|
+
for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
|
|
69889
|
+
var declaration = declarations_8[_i];
|
|
69890
|
+
var sourceParameters = getTypeParameterDeclarations(declaration);
|
|
69694
69891
|
var numTypeParameters = sourceParameters.length;
|
|
69695
69892
|
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
|
|
69696
69893
|
return false;
|
|
@@ -69749,7 +69946,7 @@ var ts;
|
|
|
69749
69946
|
checkTypeParameterListsIdentical(symbol);
|
|
69750
69947
|
checkFunctionOrConstructorSymbol(symbol);
|
|
69751
69948
|
checkClassForDuplicateDeclarations(node);
|
|
69752
|
-
var nodeInAmbientContext = !!(node.flags &
|
|
69949
|
+
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
69753
69950
|
if (!nodeInAmbientContext) {
|
|
69754
69951
|
checkClassForStaticPropertyNameConflicts(node);
|
|
69755
69952
|
}
|
|
@@ -69881,7 +70078,7 @@ var ts;
|
|
|
69881
70078
|
}
|
|
69882
70079
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
69883
70080
|
var isJs = ts.isInJSFile(node);
|
|
69884
|
-
var nodeInAmbientContext = !!(node.flags &
|
|
70081
|
+
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
69885
70082
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
69886
70083
|
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
69887
70084
|
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
@@ -70068,7 +70265,7 @@ var ts;
|
|
|
70068
70265
|
&& !(derived.flags & 33554432)
|
|
70069
70266
|
&& !(baseDeclarationFlags & 128)
|
|
70070
70267
|
&& !(derivedDeclarationFlags & 128)
|
|
70071
|
-
&& !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags &
|
|
70268
|
+
&& !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216); }))) {
|
|
70072
70269
|
var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
|
|
70073
70270
|
var propName = uninitialized.name;
|
|
70074
70271
|
if (uninitialized.exclamationToken
|
|
@@ -70158,7 +70355,7 @@ var ts;
|
|
|
70158
70355
|
return ok;
|
|
70159
70356
|
}
|
|
70160
70357
|
function checkPropertyInitialization(node) {
|
|
70161
|
-
if (!strictNullChecks || !strictPropertyInitialization || node.flags &
|
|
70358
|
+
if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216) {
|
|
70162
70359
|
return;
|
|
70163
70360
|
}
|
|
70164
70361
|
var constructor = findConstructorDeclaration(node);
|
|
@@ -70288,7 +70485,7 @@ var ts;
|
|
|
70288
70485
|
if (member.initializer) {
|
|
70289
70486
|
return computeConstantValue(member);
|
|
70290
70487
|
}
|
|
70291
|
-
if (member.parent.flags &
|
|
70488
|
+
if (member.parent.flags & 16777216 && !ts.isEnumConst(member.parent) && getEnumKind(getSymbolOfNode(member.parent)) === 0) {
|
|
70292
70489
|
return undefined;
|
|
70293
70490
|
}
|
|
70294
70491
|
if (autoValue !== undefined) {
|
|
@@ -70316,7 +70513,7 @@ var ts;
|
|
|
70316
70513
|
else if (isConstEnum) {
|
|
70317
70514
|
error(initializer, ts.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);
|
|
70318
70515
|
}
|
|
70319
|
-
else if (member.parent.flags &
|
|
70516
|
+
else if (member.parent.flags & 16777216) {
|
|
70320
70517
|
error(initializer, ts.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);
|
|
70321
70518
|
}
|
|
70322
70519
|
else {
|
|
@@ -70474,11 +70671,11 @@ var ts;
|
|
|
70474
70671
|
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
|
|
70475
70672
|
var declarations = symbol.declarations;
|
|
70476
70673
|
if (declarations) {
|
|
70477
|
-
for (var _i = 0,
|
|
70478
|
-
var declaration =
|
|
70674
|
+
for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
|
|
70675
|
+
var declaration = declarations_9[_i];
|
|
70479
70676
|
if ((declaration.kind === 257 ||
|
|
70480
70677
|
(declaration.kind === 256 && ts.nodeIsPresent(declaration.body))) &&
|
|
70481
|
-
!(declaration.flags &
|
|
70678
|
+
!(declaration.flags & 16777216)) {
|
|
70482
70679
|
return declaration;
|
|
70483
70680
|
}
|
|
70484
70681
|
}
|
|
@@ -70508,7 +70705,7 @@ var ts;
|
|
|
70508
70705
|
addLazyDiagnostic(checkModuleDeclarationDiagnostics);
|
|
70509
70706
|
function checkModuleDeclarationDiagnostics() {
|
|
70510
70707
|
var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node);
|
|
70511
|
-
var inAmbientContext = node.flags &
|
|
70708
|
+
var inAmbientContext = node.flags & 16777216;
|
|
70512
70709
|
if (isGlobalAugmentation && !inAmbientContext) {
|
|
70513
70710
|
error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);
|
|
70514
70711
|
}
|
|
@@ -70694,7 +70891,7 @@ var ts;
|
|
|
70694
70891
|
}
|
|
70695
70892
|
if (compilerOptions.isolatedModules
|
|
70696
70893
|
&& !ts.isTypeOnlyImportOrExportDeclaration(node)
|
|
70697
|
-
&& !(node.flags &
|
|
70894
|
+
&& !(node.flags & 16777216)) {
|
|
70698
70895
|
var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
70699
70896
|
var isType = !(target.flags & 111551);
|
|
70700
70897
|
if (isType || typeOnlyAlias) {
|
|
@@ -70737,7 +70934,7 @@ var ts;
|
|
|
70737
70934
|
}
|
|
70738
70935
|
}
|
|
70739
70936
|
function isDeprecatedAliasedSymbol(symbol) {
|
|
70740
|
-
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) &
|
|
70937
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 268435456); });
|
|
70741
70938
|
}
|
|
70742
70939
|
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
70743
70940
|
if (!(symbol.flags & 2097152))
|
|
@@ -70862,7 +71059,7 @@ var ts;
|
|
|
70862
71059
|
}
|
|
70863
71060
|
}
|
|
70864
71061
|
else {
|
|
70865
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags &
|
|
71062
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 16777216)) {
|
|
70866
71063
|
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
70867
71064
|
}
|
|
70868
71065
|
}
|
|
@@ -70884,7 +71081,7 @@ var ts;
|
|
|
70884
71081
|
ts.forEach(node.exportClause.elements, checkExportSpecifier);
|
|
70885
71082
|
var inAmbientExternalModule = node.parent.kind === 262 && ts.isAmbientModule(node.parent.parent);
|
|
70886
71083
|
var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 262 &&
|
|
70887
|
-
!node.moduleSpecifier && node.flags &
|
|
71084
|
+
!node.moduleSpecifier && node.flags & 16777216;
|
|
70888
71085
|
if (node.parent.kind !== 305 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
|
|
70889
71086
|
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
|
|
70890
71087
|
}
|
|
@@ -71037,10 +71234,10 @@ var ts;
|
|
|
71037
71234
|
checkExpressionCached(node.expression);
|
|
71038
71235
|
}
|
|
71039
71236
|
checkExternalModuleExports(container);
|
|
71040
|
-
if ((node.flags &
|
|
71237
|
+
if ((node.flags & 16777216) && !ts.isEntityNameExpression(node.expression)) {
|
|
71041
71238
|
grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
71042
71239
|
}
|
|
71043
|
-
if (node.isExportEquals && !(node.flags &
|
|
71240
|
+
if (node.isExportEquals && !(node.flags & 16777216)) {
|
|
71044
71241
|
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
71045
71242
|
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
71046
71243
|
}
|
|
@@ -71438,7 +71635,7 @@ var ts;
|
|
|
71438
71635
|
addLazyDiagnostic(function () {
|
|
71439
71636
|
if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) {
|
|
71440
71637
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function (containingNode, kind, diag) {
|
|
71441
|
-
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags &
|
|
71638
|
+
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
71442
71639
|
diagnostics.add(diag);
|
|
71443
71640
|
}
|
|
71444
71641
|
});
|
|
@@ -71519,7 +71716,7 @@ var ts;
|
|
|
71519
71716
|
return diagnostics.getGlobalDiagnostics();
|
|
71520
71717
|
}
|
|
71521
71718
|
function getSymbolsInScope(location, meaning) {
|
|
71522
|
-
if (location.flags &
|
|
71719
|
+
if (location.flags & 33554432) {
|
|
71523
71720
|
return [];
|
|
71524
71721
|
}
|
|
71525
71722
|
var symbols = ts.createSymbolTable();
|
|
@@ -71832,7 +72029,7 @@ var ts;
|
|
|
71832
72029
|
}
|
|
71833
72030
|
var parent = node.parent;
|
|
71834
72031
|
var grandParent = parent.parent;
|
|
71835
|
-
if (node.flags &
|
|
72032
|
+
if (node.flags & 33554432) {
|
|
71836
72033
|
return undefined;
|
|
71837
72034
|
}
|
|
71838
72035
|
if (isDeclarationNameOrImportPropertyName(node)) {
|
|
@@ -71962,7 +72159,7 @@ var ts;
|
|
|
71962
72159
|
if (ts.isSourceFile(node) && !ts.isExternalModule(node)) {
|
|
71963
72160
|
return errorType;
|
|
71964
72161
|
}
|
|
71965
|
-
if (node.flags &
|
|
72162
|
+
if (node.flags & 33554432) {
|
|
71966
72163
|
return errorType;
|
|
71967
72164
|
}
|
|
71968
72165
|
var classDecl = ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node);
|
|
@@ -72876,7 +73073,7 @@ var ts;
|
|
|
72876
73073
|
function checkExternalEmitHelpers(location, helpers) {
|
|
72877
73074
|
if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {
|
|
72878
73075
|
var sourceFile = ts.getSourceFileOfNode(location);
|
|
72879
|
-
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags &
|
|
73076
|
+
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 16777216)) {
|
|
72880
73077
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
72881
73078
|
if (helpersModule !== unknownSymbol) {
|
|
72882
73079
|
var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;
|
|
@@ -73126,7 +73323,7 @@ var ts;
|
|
|
73126
73323
|
else if (node.kind === 164) {
|
|
73127
73324
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
|
|
73128
73325
|
}
|
|
73129
|
-
else if ((node.parent.flags &
|
|
73326
|
+
else if ((node.parent.flags & 16777216) && node.parent.kind === 262) {
|
|
73130
73327
|
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
73131
73328
|
}
|
|
73132
73329
|
else if (ts.isPrivateIdentifierClassElementDeclaration(node)) {
|
|
@@ -73172,7 +73369,7 @@ var ts;
|
|
|
73172
73369
|
if (flags & 256) {
|
|
73173
73370
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
|
|
73174
73371
|
}
|
|
73175
|
-
else if (flags & 2 || node.parent.flags &
|
|
73372
|
+
else if (flags & 2 || node.parent.flags & 16777216) {
|
|
73176
73373
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
73177
73374
|
}
|
|
73178
73375
|
else if (node.kind === 164) {
|
|
@@ -73314,7 +73511,7 @@ var ts;
|
|
|
73314
73511
|
if (i !== (parameterCount - 1)) {
|
|
73315
73512
|
return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);
|
|
73316
73513
|
}
|
|
73317
|
-
if (!(parameter.flags &
|
|
73514
|
+
if (!(parameter.flags & 16777216)) {
|
|
73318
73515
|
checkGrammarForDisallowedTrailingComma(parameters, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
|
|
73319
73516
|
}
|
|
73320
73517
|
if (parameter.questionToken) {
|
|
@@ -73520,7 +73717,7 @@ var ts;
|
|
|
73520
73717
|
ts.Debug.assert(node.kind === 256 ||
|
|
73521
73718
|
node.kind === 213 ||
|
|
73522
73719
|
node.kind === 169);
|
|
73523
|
-
if (node.flags &
|
|
73720
|
+
if (node.flags & 16777216) {
|
|
73524
73721
|
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
|
|
73525
73722
|
}
|
|
73526
73723
|
if (!node.body) {
|
|
@@ -73735,7 +73932,7 @@ var ts;
|
|
|
73735
73932
|
return false;
|
|
73736
73933
|
}
|
|
73737
73934
|
function checkGrammarAccessor(accessor) {
|
|
73738
|
-
if (!(accessor.flags &
|
|
73935
|
+
if (!(accessor.flags & 16777216) && (accessor.parent.kind !== 182) && (accessor.parent.kind !== 258)) {
|
|
73739
73936
|
if (languageVersion < 1) {
|
|
73740
73937
|
return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
|
|
73741
73938
|
}
|
|
@@ -73865,7 +74062,7 @@ var ts;
|
|
|
73865
74062
|
if (languageVersion < 2 && ts.isPrivateIdentifier(node.name)) {
|
|
73866
74063
|
return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
73867
74064
|
}
|
|
73868
|
-
if (node.flags &
|
|
74065
|
+
if (node.flags & 16777216) {
|
|
73869
74066
|
return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
|
|
73870
74067
|
}
|
|
73871
74068
|
else if (node.kind === 169 && !node.body) {
|
|
@@ -73976,7 +74173,7 @@ var ts;
|
|
|
73976
74173
|
}
|
|
73977
74174
|
function checkGrammarVariableDeclaration(node) {
|
|
73978
74175
|
if (node.parent.parent.kind !== 243 && node.parent.parent.kind !== 244) {
|
|
73979
|
-
if (node.flags &
|
|
74176
|
+
if (node.flags & 16777216) {
|
|
73980
74177
|
checkAmbientInitializer(node);
|
|
73981
74178
|
}
|
|
73982
74179
|
else if (!node.initializer) {
|
|
@@ -73988,7 +74185,7 @@ var ts;
|
|
|
73988
74185
|
}
|
|
73989
74186
|
}
|
|
73990
74187
|
}
|
|
73991
|
-
if (node.exclamationToken && (node.parent.parent.kind !== 237 || !node.type || node.initializer || node.flags &
|
|
74188
|
+
if (node.exclamationToken && (node.parent.parent.kind !== 237 || !node.type || node.initializer || node.flags & 16777216)) {
|
|
73992
74189
|
var message = node.initializer
|
|
73993
74190
|
? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
|
|
73994
74191
|
: !node.type
|
|
@@ -73997,7 +74194,7 @@ var ts;
|
|
|
73997
74194
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
73998
74195
|
}
|
|
73999
74196
|
if ((moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
74000
|
-
!(node.parent.parent.flags &
|
|
74197
|
+
!(node.parent.parent.flags & 16777216) && ts.hasSyntacticModifier(node.parent.parent, 1)) {
|
|
74001
74198
|
checkESModuleMarker(node.name);
|
|
74002
74199
|
}
|
|
74003
74200
|
var checkLetConstNames = (ts.isLet(node) || ts.isVarConst(node));
|
|
@@ -74168,11 +74365,11 @@ var ts;
|
|
|
74168
74365
|
return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer);
|
|
74169
74366
|
}
|
|
74170
74367
|
}
|
|
74171
|
-
if (node.flags &
|
|
74368
|
+
if (node.flags & 16777216) {
|
|
74172
74369
|
checkAmbientInitializer(node);
|
|
74173
74370
|
}
|
|
74174
74371
|
if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer ||
|
|
74175
|
-
node.flags &
|
|
74372
|
+
node.flags & 16777216 || ts.isStatic(node) || ts.hasAbstractModifier(node))) {
|
|
74176
74373
|
var message = node.initializer
|
|
74177
74374
|
? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
|
|
74178
74375
|
: !node.type
|
|
@@ -74206,10 +74403,10 @@ var ts;
|
|
|
74206
74403
|
return false;
|
|
74207
74404
|
}
|
|
74208
74405
|
function checkGrammarSourceFile(node) {
|
|
74209
|
-
return !!(node.flags &
|
|
74406
|
+
return !!(node.flags & 16777216) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node);
|
|
74210
74407
|
}
|
|
74211
74408
|
function checkGrammarStatementInAmbientContext(node) {
|
|
74212
|
-
if (node.flags &
|
|
74409
|
+
if (node.flags & 16777216) {
|
|
74213
74410
|
var links = getNodeLinks(node);
|
|
74214
74411
|
if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) {
|
|
74215
74412
|
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
|
|
@@ -77361,7 +77558,7 @@ var ts;
|
|
|
77361
77558
|
return !ts.nodeIsMissing(node.body);
|
|
77362
77559
|
}
|
|
77363
77560
|
function visitPropertyDeclaration(node) {
|
|
77364
|
-
if (node.flags &
|
|
77561
|
+
if (node.flags & 16777216 || ts.hasSyntacticModifier(node, 128)) {
|
|
77365
77562
|
return undefined;
|
|
77366
77563
|
}
|
|
77367
77564
|
var updated = factory.updatePropertyDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node), undefined, undefined, ts.visitNode(node.initializer, visitor));
|
|
@@ -82600,8 +82797,8 @@ var ts;
|
|
|
82600
82797
|
}
|
|
82601
82798
|
function getRangeUnion(declarations) {
|
|
82602
82799
|
var pos = -1, end = -1;
|
|
82603
|
-
for (var _i = 0,
|
|
82604
|
-
var node =
|
|
82800
|
+
for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {
|
|
82801
|
+
var node = declarations_10[_i];
|
|
82605
82802
|
pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos);
|
|
82606
82803
|
end = Math.max(end, node.end);
|
|
82607
82804
|
}
|
|
@@ -88776,7 +88973,7 @@ var ts;
|
|
|
88776
88973
|
needsScopeFixMarker = false;
|
|
88777
88974
|
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
|
|
88778
88975
|
var lateStatements = transformAndReplaceLatePaintedStatements(statements);
|
|
88779
|
-
if (input.flags &
|
|
88976
|
+
if (input.flags & 16777216) {
|
|
88780
88977
|
needsScopeFixMarker = false;
|
|
88781
88978
|
}
|
|
88782
88979
|
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
|
|
@@ -90216,6 +90413,9 @@ var ts;
|
|
|
90216
90413
|
var currentParenthesizerRule;
|
|
90217
90414
|
var _c = ts.performance.createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"), enterComment = _c.enter, exitComment = _c.exit;
|
|
90218
90415
|
var parenthesizer = ts.factory.parenthesizer;
|
|
90416
|
+
var typeArgumentParenthesizerRuleSelector = {
|
|
90417
|
+
select: function (index) { return index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : undefined; }
|
|
90418
|
+
};
|
|
90219
90419
|
var emitBinaryExpression = createEmitBinaryExpression();
|
|
90220
90420
|
reset();
|
|
90221
90421
|
return {
|
|
@@ -91339,7 +91539,7 @@ var ts;
|
|
|
91339
91539
|
writePunctuation("}");
|
|
91340
91540
|
}
|
|
91341
91541
|
function emitArrayType(node) {
|
|
91342
|
-
emit(node.elementType, parenthesizer.
|
|
91542
|
+
emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
91343
91543
|
writePunctuation("[");
|
|
91344
91544
|
writePunctuation("]");
|
|
91345
91545
|
}
|
|
@@ -91350,7 +91550,7 @@ var ts;
|
|
|
91350
91550
|
function emitTupleType(node) {
|
|
91351
91551
|
emitTokenWithComment(22, node.pos, writePunctuation, node);
|
|
91352
91552
|
var flags = ts.getEmitFlags(node) & 1 ? 528 : 657;
|
|
91353
|
-
emitList(node, node.elements, flags | 524288);
|
|
91553
|
+
emitList(node, node.elements, flags | 524288, parenthesizer.parenthesizeElementTypeOfTupleType);
|
|
91354
91554
|
emitTokenWithComment(23, node.elements.end, writePunctuation, node);
|
|
91355
91555
|
}
|
|
91356
91556
|
function emitNamedTupleMember(node) {
|
|
@@ -91362,21 +91562,21 @@ var ts;
|
|
|
91362
91562
|
emit(node.type);
|
|
91363
91563
|
}
|
|
91364
91564
|
function emitOptionalType(node) {
|
|
91365
|
-
emit(node.type, parenthesizer.
|
|
91565
|
+
emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType);
|
|
91366
91566
|
writePunctuation("?");
|
|
91367
91567
|
}
|
|
91368
91568
|
function emitUnionType(node) {
|
|
91369
|
-
emitList(node, node.types, 516, parenthesizer.
|
|
91569
|
+
emitList(node, node.types, 516, parenthesizer.parenthesizeConstituentTypeOfUnionType);
|
|
91370
91570
|
}
|
|
91371
91571
|
function emitIntersectionType(node) {
|
|
91372
|
-
emitList(node, node.types, 520, parenthesizer.
|
|
91572
|
+
emitList(node, node.types, 520, parenthesizer.parenthesizeConstituentTypeOfIntersectionType);
|
|
91373
91573
|
}
|
|
91374
91574
|
function emitConditionalType(node) {
|
|
91375
|
-
emit(node.checkType, parenthesizer.
|
|
91575
|
+
emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType);
|
|
91376
91576
|
writeSpace();
|
|
91377
91577
|
writeKeyword("extends");
|
|
91378
91578
|
writeSpace();
|
|
91379
|
-
emit(node.extendsType, parenthesizer.
|
|
91579
|
+
emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType);
|
|
91380
91580
|
writeSpace();
|
|
91381
91581
|
writePunctuation("?");
|
|
91382
91582
|
writeSpace();
|
|
@@ -91402,10 +91602,13 @@ var ts;
|
|
|
91402
91602
|
function emitTypeOperator(node) {
|
|
91403
91603
|
writeTokenText(node.operator, writeKeyword);
|
|
91404
91604
|
writeSpace();
|
|
91405
|
-
|
|
91605
|
+
var parenthesizerRule = node.operator === 145 ?
|
|
91606
|
+
parenthesizer.parenthesizeOperandOfReadonlyTypeOperator :
|
|
91607
|
+
parenthesizer.parenthesizeOperandOfTypeOperator;
|
|
91608
|
+
emit(node.type, parenthesizerRule);
|
|
91406
91609
|
}
|
|
91407
91610
|
function emitIndexedAccessType(node) {
|
|
91408
|
-
emit(node.objectType, parenthesizer.
|
|
91611
|
+
emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
91409
91612
|
writePunctuation("[");
|
|
91410
91613
|
emit(node.indexType);
|
|
91411
91614
|
writePunctuation("]");
|
|
@@ -93046,7 +93249,7 @@ var ts;
|
|
|
93046
93249
|
emitList(parentNode, decorators, 2146305);
|
|
93047
93250
|
}
|
|
93048
93251
|
function emitTypeArguments(parentNode, typeArguments) {
|
|
93049
|
-
emitList(parentNode, typeArguments, 53776,
|
|
93252
|
+
emitList(parentNode, typeArguments, 53776, typeArgumentParenthesizerRuleSelector);
|
|
93050
93253
|
}
|
|
93051
93254
|
function emitTypeParameters(parentNode, typeParameters) {
|
|
93052
93255
|
if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) {
|
|
@@ -93162,6 +93365,7 @@ var ts;
|
|
|
93162
93365
|
if (format & 128) {
|
|
93163
93366
|
increaseIndent();
|
|
93164
93367
|
}
|
|
93368
|
+
var emitListItem = getEmitListItem(emit, parenthesizerRule);
|
|
93165
93369
|
var previousSibling = void 0;
|
|
93166
93370
|
var previousSourceFileTextKind = void 0;
|
|
93167
93371
|
var shouldDecreaseIndentAfterEmit = false;
|
|
@@ -93199,12 +93403,7 @@ var ts;
|
|
|
93199
93403
|
shouldEmitInterveningComments = mayEmitInterveningComments;
|
|
93200
93404
|
}
|
|
93201
93405
|
nextListElementPos = child.pos;
|
|
93202
|
-
|
|
93203
|
-
emit(child);
|
|
93204
|
-
}
|
|
93205
|
-
else {
|
|
93206
|
-
emit(child, parenthesizerRule);
|
|
93207
|
-
}
|
|
93406
|
+
emitListItem(child, emit, parenthesizerRule, i);
|
|
93208
93407
|
if (shouldDecreaseIndentAfterEmit) {
|
|
93209
93408
|
decreaseIndent();
|
|
93210
93409
|
shouldDecreaseIndentAfterEmit = false;
|
|
@@ -94258,6 +94457,20 @@ var ts;
|
|
|
94258
94457
|
function getClosingBracket(format) {
|
|
94259
94458
|
return brackets[format & 15360][1];
|
|
94260
94459
|
}
|
|
94460
|
+
function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) {
|
|
94461
|
+
emit(node);
|
|
94462
|
+
}
|
|
94463
|
+
function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) {
|
|
94464
|
+
emit(node, parenthesizerRuleSelector.select(index));
|
|
94465
|
+
}
|
|
94466
|
+
function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) {
|
|
94467
|
+
emit(node, parenthesizerRule);
|
|
94468
|
+
}
|
|
94469
|
+
function getEmitListItem(emit, parenthesizerRule) {
|
|
94470
|
+
return emit.length === 1 ? emitListItemNoParenthesizer :
|
|
94471
|
+
typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector :
|
|
94472
|
+
emitListItemWithParenthesizerRule;
|
|
94473
|
+
}
|
|
94261
94474
|
})(ts || (ts = {}));
|
|
94262
94475
|
var ts;
|
|
94263
94476
|
(function (ts) {
|
|
@@ -96054,7 +96267,7 @@ var ts;
|
|
|
96054
96267
|
if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
|
|
96055
96268
|
structureIsReused = 1;
|
|
96056
96269
|
}
|
|
96057
|
-
if ((oldSourceFile.flags &
|
|
96270
|
+
if ((oldSourceFile.flags & 6291456) !== (newSourceFile.flags & 6291456)) {
|
|
96058
96271
|
structureIsReused = 1;
|
|
96059
96272
|
}
|
|
96060
96273
|
if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
|
|
@@ -96201,6 +96414,9 @@ var ts;
|
|
|
96201
96414
|
return !!sourceFilesFoundSearchingNodeModules.get(file.path);
|
|
96202
96415
|
}
|
|
96203
96416
|
function isSourceFileDefaultLibrary(file) {
|
|
96417
|
+
if (!file.isDeclarationFile) {
|
|
96418
|
+
return false;
|
|
96419
|
+
}
|
|
96204
96420
|
if (file.hasNoDefaultLib) {
|
|
96205
96421
|
return true;
|
|
96206
96422
|
}
|
|
@@ -96656,7 +96872,7 @@ var ts;
|
|
|
96656
96872
|
var node = _a[_i];
|
|
96657
96873
|
collectModuleReferences(node, false);
|
|
96658
96874
|
}
|
|
96659
|
-
if ((file.flags &
|
|
96875
|
+
if ((file.flags & 2097152) || isJavaScriptFile) {
|
|
96660
96876
|
collectDynamicImportOrRequireCalls(file);
|
|
96661
96877
|
}
|
|
96662
96878
|
file.imports = imports || ts.emptyArray;
|
|
@@ -97178,7 +97394,7 @@ var ts;
|
|
|
97178
97394
|
&& index < file.imports.length
|
|
97179
97395
|
&& !elideImport
|
|
97180
97396
|
&& !(isJsFile && !ts.getAllowJSCompilerOption(optionsForFile))
|
|
97181
|
-
&& (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags &
|
|
97397
|
+
&& (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags & 8388608));
|
|
97182
97398
|
if (elideImport) {
|
|
97183
97399
|
modulesWithElidedImports.set(file.path, true);
|
|
97184
97400
|
}
|
|
@@ -97254,21 +97470,6 @@ var ts;
|
|
|
97254
97470
|
return resolvedRef;
|
|
97255
97471
|
}
|
|
97256
97472
|
function verifyCompilerOptions() {
|
|
97257
|
-
var isNightly = ts.stringContains(ts.version, "-dev") || ts.stringContains(ts.version, "-insiders");
|
|
97258
|
-
if (!isNightly) {
|
|
97259
|
-
if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
|
|
97260
|
-
createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "node12");
|
|
97261
|
-
}
|
|
97262
|
-
else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
|
|
97263
|
-
createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "nodenext");
|
|
97264
|
-
}
|
|
97265
|
-
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
|
|
97266
|
-
createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "node12");
|
|
97267
|
-
}
|
|
97268
|
-
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
97269
|
-
createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "nodenext");
|
|
97270
|
-
}
|
|
97271
|
-
}
|
|
97272
97473
|
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
97273
97474
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
97274
97475
|
}
|