typescript 4.7.0-dev.20220403 → 4.7.0-dev.20220406
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/de/diagnosticMessages.generated.json +1 -0
- 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/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +482 -257
- package/lib/tsserver.js +748 -337
- package/lib/tsserverlibrary.d.ts +22 -14
- package/lib/tsserverlibrary.js +748 -337
- package/lib/typescript.d.ts +17 -12
- package/lib/typescript.js +744 -337
- package/lib/typescriptServices.d.ts +17 -12
- package/lib/typescriptServices.js +744 -337
- package/lib/typingsInstaller.js +630 -294
- 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-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.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;
|
|
17133
17153
|
}
|
|
17134
|
-
function
|
|
17135
|
-
switch (
|
|
17154
|
+
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
|
|
17155
|
+
switch (extendsType.kind) {
|
|
17156
|
+
case 189:
|
|
17157
|
+
return factory.createParenthesizedType(extendsType);
|
|
17158
|
+
}
|
|
17159
|
+
return extendsType;
|
|
17160
|
+
}
|
|
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;
|
|
26605
26727
|
}
|
|
26606
|
-
function parseParameter() {
|
|
26607
|
-
return parseParameterWorker(
|
|
26728
|
+
function parseParameter(inOuterAwaitContext) {
|
|
26729
|
+
return parseParameterWorker(inOuterAwaitContext);
|
|
26608
26730
|
}
|
|
26609
|
-
function
|
|
26731
|
+
function parseParameterForSpeculation(inOuterAwaitContext) {
|
|
26732
|
+
return parseParameterWorker(inOuterAwaitContext, false);
|
|
26733
|
+
}
|
|
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 &&
|
|
@@ -44437,7 +44596,7 @@ var ts;
|
|
|
44437
44596
|
newModifierFlags |= 1;
|
|
44438
44597
|
}
|
|
44439
44598
|
if (addingDeclare && !(newModifierFlags & 1) &&
|
|
44440
|
-
(!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags &
|
|
44599
|
+
(!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags & 16777216)) &&
|
|
44441
44600
|
(ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isModuleDeclaration(node))) {
|
|
44442
44601
|
newModifierFlags |= 2;
|
|
44443
44602
|
}
|
|
@@ -45203,7 +45362,7 @@ var ts;
|
|
|
45203
45362
|
}
|
|
45204
45363
|
var parent = getDeclarationContainer(node);
|
|
45205
45364
|
if (!(ts.getCombinedModifierFlags(node) & 1) &&
|
|
45206
|
-
!(node.kind !== 265 && parent.kind !== 305 && parent.flags &
|
|
45365
|
+
!(node.kind !== 265 && parent.kind !== 305 && parent.flags & 16777216)) {
|
|
45207
45366
|
return isGlobalSourceFile(parent);
|
|
45208
45367
|
}
|
|
45209
45368
|
return isDeclarationVisible(parent);
|
|
@@ -45492,7 +45651,7 @@ var ts;
|
|
|
45492
45651
|
return parentType;
|
|
45493
45652
|
}
|
|
45494
45653
|
var pattern = declaration.parent;
|
|
45495
|
-
if (strictNullChecks && declaration.flags &
|
|
45654
|
+
if (strictNullChecks && declaration.flags & 16777216 && ts.isParameterDeclaration(declaration)) {
|
|
45496
45655
|
parentType = getNonNullableType(parentType);
|
|
45497
45656
|
}
|
|
45498
45657
|
else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536)) {
|
|
@@ -45590,7 +45749,7 @@ var ts;
|
|
|
45590
45749
|
}
|
|
45591
45750
|
if ((noImplicitAny || ts.isInJSFile(declaration)) &&
|
|
45592
45751
|
ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&
|
|
45593
|
-
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags &
|
|
45752
|
+
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 16777216)) {
|
|
45594
45753
|
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
|
|
45595
45754
|
return autoType;
|
|
45596
45755
|
}
|
|
@@ -46879,7 +47038,7 @@ var ts;
|
|
|
46879
47038
|
function isLiteralEnumMember(member) {
|
|
46880
47039
|
var expr = member.initializer;
|
|
46881
47040
|
if (!expr) {
|
|
46882
|
-
return !(member.flags &
|
|
47041
|
+
return !(member.flags & 16777216);
|
|
46883
47042
|
}
|
|
46884
47043
|
switch (expr.kind) {
|
|
46885
47044
|
case 10:
|
|
@@ -49162,7 +49321,7 @@ var ts;
|
|
|
49162
49321
|
function getConstraintDeclaration(type) {
|
|
49163
49322
|
return ts.mapDefined(ts.filter(type.symbol && type.symbol.declarations, ts.isTypeParameterDeclaration), ts.getEffectiveConstraintOfTypeParameter)[0];
|
|
49164
49323
|
}
|
|
49165
|
-
function getInferredTypeParameterConstraint(typeParameter) {
|
|
49324
|
+
function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) {
|
|
49166
49325
|
var _a;
|
|
49167
49326
|
var inferences;
|
|
49168
49327
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
@@ -49170,7 +49329,7 @@ var ts;
|
|
|
49170
49329
|
var declaration = _b[_i];
|
|
49171
49330
|
if (declaration.parent.kind === 190) {
|
|
49172
49331
|
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) {
|
|
49332
|
+
if (grandParent.kind === 178 && !omitTypeReferences) {
|
|
49174
49333
|
var typeReference = grandParent;
|
|
49175
49334
|
var typeParameters = getTypeParametersForTypeReference(typeReference);
|
|
49176
49335
|
if (typeParameters) {
|
|
@@ -49540,7 +49699,7 @@ var ts;
|
|
|
49540
49699
|
return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type;
|
|
49541
49700
|
}
|
|
49542
49701
|
function isJSDocTypeReference(node) {
|
|
49543
|
-
return !!(node.flags &
|
|
49702
|
+
return !!(node.flags & 8388608) && (node.kind === 178 || node.kind === 200);
|
|
49544
49703
|
}
|
|
49545
49704
|
function checkNoTypeArguments(node, symbol) {
|
|
49546
49705
|
if (node.typeArguments) {
|
|
@@ -50934,7 +51093,7 @@ var ts;
|
|
|
50934
51093
|
if (ts.isCallLikeExpression(parent)) {
|
|
50935
51094
|
return ts.isCallOrNewExpression(parent) && ts.isIdentifier(node) && hasMatchingArgument(parent, node);
|
|
50936
51095
|
}
|
|
50937
|
-
return ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) &
|
|
51096
|
+
return ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 268435456); });
|
|
50938
51097
|
}
|
|
50939
51098
|
return true;
|
|
50940
51099
|
}
|
|
@@ -51327,7 +51486,11 @@ var ts;
|
|
|
51327
51486
|
return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
|
|
51328
51487
|
}
|
|
51329
51488
|
function isSingletonTupleType(node) {
|
|
51330
|
-
return ts.isTupleTypeNode(node) &&
|
|
51489
|
+
return ts.isTupleTypeNode(node) &&
|
|
51490
|
+
ts.length(node.elements) === 1 &&
|
|
51491
|
+
!ts.isOptionalTypeNode(node.elements[0]) &&
|
|
51492
|
+
!ts.isRestTypeNode(node.elements[0]) &&
|
|
51493
|
+
!(ts.isNamedTupleMember(node.elements[0]) && (node.elements[0].questionToken || node.elements[0].dotDotDotToken));
|
|
51331
51494
|
}
|
|
51332
51495
|
function unwrapNondistributiveConditionalTuple(root, type) {
|
|
51333
51496
|
return isTypicalNondistributiveConditional(root) && isTupleType(type) ? getTypeArguments(type)[0] : type;
|
|
@@ -51519,7 +51682,7 @@ var ts;
|
|
|
51519
51682
|
links.resolvedSymbol = unknownSymbol;
|
|
51520
51683
|
return links.resolvedType = errorType;
|
|
51521
51684
|
}
|
|
51522
|
-
var targetMeaning = node.isTypeOf ? 111551 : node.flags &
|
|
51685
|
+
var targetMeaning = node.isTypeOf ? 111551 : node.flags & 8388608 ? 111551 | 788968 : 788968;
|
|
51523
51686
|
var innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal);
|
|
51524
51687
|
if (!innerModuleSymbol) {
|
|
51525
51688
|
links.resolvedSymbol = unknownSymbol;
|
|
@@ -51836,7 +51999,7 @@ var ts;
|
|
|
51836
51999
|
if (parent && ts.isObjectLiteralExpression(parent) && ts.isBinaryExpression(parent.parent) && ts.getAssignmentDeclarationKind(parent.parent) === 6) {
|
|
51837
52000
|
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent.parent.left).parent).thisType;
|
|
51838
52001
|
}
|
|
51839
|
-
var host = node.flags &
|
|
52002
|
+
var host = node.flags & 8388608 ? ts.getHostSignatureFromJSDoc(node) : undefined;
|
|
51840
52003
|
if (host && ts.isFunctionExpression(host) && ts.isBinaryExpression(host.parent) && ts.getAssignmentDeclarationKind(host.parent) === 3) {
|
|
51841
52004
|
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host.parent.left).parent).thisType;
|
|
51842
52005
|
}
|
|
@@ -51909,7 +52072,7 @@ var ts;
|
|
|
51909
52072
|
case 143:
|
|
51910
52073
|
return neverType;
|
|
51911
52074
|
case 148:
|
|
51912
|
-
return node.flags &
|
|
52075
|
+
return node.flags & 262144 && !noImplicitAny ? anyType : nonPrimitiveType;
|
|
51913
52076
|
case 138:
|
|
51914
52077
|
return intrinsicMarkerType;
|
|
51915
52078
|
case 192:
|
|
@@ -55251,6 +55414,9 @@ var ts;
|
|
|
55251
55414
|
function createMarkerType(symbol, source, target) {
|
|
55252
55415
|
var mapper = makeUnaryTypeMapper(source, target);
|
|
55253
55416
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
55417
|
+
if (isErrorType(type)) {
|
|
55418
|
+
return type;
|
|
55419
|
+
}
|
|
55254
55420
|
var result = symbol.flags & 524288 ?
|
|
55255
55421
|
getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper)) :
|
|
55256
55422
|
createTypeReference(type, instantiateTypes(type.typeParameters, mapper));
|
|
@@ -56130,6 +56296,7 @@ var ts;
|
|
|
56130
56296
|
var inference = inferences[i];
|
|
56131
56297
|
if (t === inference.typeParameter) {
|
|
56132
56298
|
if (fix && !inference.isFixed) {
|
|
56299
|
+
inferFromIntraExpressionSites(context);
|
|
56133
56300
|
clearCachedInferences(inferences);
|
|
56134
56301
|
inference.isFixed = true;
|
|
56135
56302
|
}
|
|
@@ -56146,6 +56313,24 @@ var ts;
|
|
|
56146
56313
|
}
|
|
56147
56314
|
}
|
|
56148
56315
|
}
|
|
56316
|
+
function addIntraExpressionInferenceSite(context, node, type) {
|
|
56317
|
+
var _a;
|
|
56318
|
+
((_a = context.intraExpressionInferenceSites) !== null && _a !== void 0 ? _a : (context.intraExpressionInferenceSites = [])).push({ node: node, type: type });
|
|
56319
|
+
}
|
|
56320
|
+
function inferFromIntraExpressionSites(context) {
|
|
56321
|
+
if (context.intraExpressionInferenceSites) {
|
|
56322
|
+
for (var _i = 0, _a = context.intraExpressionInferenceSites; _i < _a.length; _i++) {
|
|
56323
|
+
var _b = _a[_i], node = _b.node, type = _b.type;
|
|
56324
|
+
var contextualType = node.kind === 169 ?
|
|
56325
|
+
getContextualTypeForObjectLiteralMethod(node, 2) :
|
|
56326
|
+
getContextualType(node, 2);
|
|
56327
|
+
if (contextualType) {
|
|
56328
|
+
inferTypes(context.inferences, type, contextualType);
|
|
56329
|
+
}
|
|
56330
|
+
}
|
|
56331
|
+
context.intraExpressionInferenceSites = undefined;
|
|
56332
|
+
}
|
|
56333
|
+
}
|
|
56149
56334
|
function createInferenceInfo(typeParameter) {
|
|
56150
56335
|
return {
|
|
56151
56336
|
typeParameter: typeParameter,
|
|
@@ -57896,7 +58081,7 @@ var ts;
|
|
|
57896
58081
|
}
|
|
57897
58082
|
}
|
|
57898
58083
|
function getTypeOfDottedName(node, diagnostic) {
|
|
57899
|
-
if (!(node.flags &
|
|
58084
|
+
if (!(node.flags & 33554432)) {
|
|
57900
58085
|
switch (node.kind) {
|
|
57901
58086
|
case 79:
|
|
57902
58087
|
var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));
|
|
@@ -59101,6 +59286,7 @@ var ts;
|
|
|
59101
59286
|
function isConstraintPosition(type, node) {
|
|
59102
59287
|
var parent = node.parent;
|
|
59103
59288
|
return parent.kind === 206 ||
|
|
59289
|
+
parent.kind === 161 ||
|
|
59104
59290
|
parent.kind === 208 && parent.expression === node ||
|
|
59105
59291
|
parent.kind === 207 && parent.expression === node &&
|
|
59106
59292
|
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
@@ -59312,7 +59498,7 @@ var ts;
|
|
|
59312
59498
|
isInTypeQuery(node) || node.parent.kind === 275) ||
|
|
59313
59499
|
node.parent.kind === 230 ||
|
|
59314
59500
|
declaration.kind === 254 && declaration.exclamationToken ||
|
|
59315
|
-
declaration.flags &
|
|
59501
|
+
declaration.flags & 16777216;
|
|
59316
59502
|
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
|
|
59317
59503
|
type === autoType || type === autoArrayType ? undefinedType :
|
|
59318
59504
|
getOptionalType(type);
|
|
@@ -60147,7 +60333,7 @@ var ts;
|
|
|
60147
60333
|
}
|
|
60148
60334
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
60149
60335
|
ts.Debug.assert(ts.isObjectLiteralMethod(node));
|
|
60150
|
-
if (node.flags &
|
|
60336
|
+
if (node.flags & 33554432) {
|
|
60151
60337
|
return undefined;
|
|
60152
60338
|
}
|
|
60153
60339
|
return getContextualTypeForObjectLiteralElement(node, contextFlags);
|
|
@@ -60285,7 +60471,7 @@ var ts;
|
|
|
60285
60471
|
return type;
|
|
60286
60472
|
}
|
|
60287
60473
|
function getContextualType(node, contextFlags) {
|
|
60288
|
-
if (node.flags &
|
|
60474
|
+
if (node.flags & 33554432) {
|
|
60289
60475
|
return undefined;
|
|
60290
60476
|
}
|
|
60291
60477
|
if (node.contextualType) {
|
|
@@ -60656,6 +60842,11 @@ var ts;
|
|
|
60656
60842
|
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);
|
|
60657
60843
|
elementTypes.push(addOptionality(type, true, hasOmittedExpression));
|
|
60658
60844
|
elementFlags.push(hasOmittedExpression ? 2 : 1);
|
|
60845
|
+
if (contextualType && someType(contextualType, isTupleLikeType) && checkMode && checkMode & 2 && !(checkMode & 4) && isContextSensitive(e)) {
|
|
60846
|
+
var inferenceContext = getInferenceContext(node);
|
|
60847
|
+
ts.Debug.assert(inferenceContext);
|
|
60848
|
+
addIntraExpressionInferenceSite(inferenceContext, e, type);
|
|
60849
|
+
}
|
|
60659
60850
|
}
|
|
60660
60851
|
}
|
|
60661
60852
|
if (inDestructuringPattern) {
|
|
@@ -60837,6 +61028,13 @@ var ts;
|
|
|
60837
61028
|
prop.target = member;
|
|
60838
61029
|
member = prop;
|
|
60839
61030
|
allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
61031
|
+
if (contextualType && checkMode && checkMode & 2 && !(checkMode & 4) &&
|
|
61032
|
+
(memberDecl.kind === 296 || memberDecl.kind === 169) && isContextSensitive(memberDecl)) {
|
|
61033
|
+
var inferenceContext = getInferenceContext(node);
|
|
61034
|
+
ts.Debug.assert(inferenceContext);
|
|
61035
|
+
var inferenceNode = memberDecl.kind === 296 ? memberDecl.initializer : memberDecl;
|
|
61036
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
|
|
61037
|
+
}
|
|
60840
61038
|
}
|
|
60841
61039
|
else if (memberDecl.kind === 298) {
|
|
60842
61040
|
if (languageVersion < 2) {
|
|
@@ -61754,7 +61952,7 @@ var ts;
|
|
|
61754
61952
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
61755
61953
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
61756
61954
|
}
|
|
61757
|
-
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) &
|
|
61955
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 268435456) {
|
|
61758
61956
|
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
61759
61957
|
}
|
|
61760
61958
|
}
|
|
@@ -61808,7 +62006,7 @@ var ts;
|
|
|
61808
62006
|
if (declaration && isPropertyWithoutInitializer(declaration)) {
|
|
61809
62007
|
if (!ts.isStatic(declaration)) {
|
|
61810
62008
|
var flowContainer = getControlFlowContainer(node);
|
|
61811
|
-
if (flowContainer.kind === 171 && flowContainer.parent === declaration.parent && !(declaration.flags &
|
|
62009
|
+
if (flowContainer.kind === 171 && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216)) {
|
|
61812
62010
|
assumeUninitialized = true;
|
|
61813
62011
|
}
|
|
61814
62012
|
}
|
|
@@ -61844,7 +62042,7 @@ var ts;
|
|
|
61844
62042
|
}
|
|
61845
62043
|
else if (valueDeclaration.kind === 257 &&
|
|
61846
62044
|
node.parent.kind !== 178 &&
|
|
61847
|
-
!(valueDeclaration.flags &
|
|
62045
|
+
!(valueDeclaration.flags & 16777216) &&
|
|
61848
62046
|
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
61849
62047
|
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
61850
62048
|
}
|
|
@@ -62409,19 +62607,21 @@ var ts;
|
|
|
62409
62607
|
if (node.kind !== 165) {
|
|
62410
62608
|
var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 : 0);
|
|
62411
62609
|
if (contextualType) {
|
|
62412
|
-
var outerContext = getInferenceContext(node);
|
|
62413
|
-
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1));
|
|
62414
|
-
var instantiatedType = instantiateType(contextualType, outerMapper);
|
|
62415
|
-
var contextualSignature = getSingleCallSignature(instantiatedType);
|
|
62416
|
-
var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
|
|
62417
|
-
getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
|
|
62418
|
-
instantiatedType;
|
|
62419
62610
|
var inferenceTargetType = getReturnTypeOfSignature(signature);
|
|
62420
|
-
|
|
62421
|
-
|
|
62422
|
-
|
|
62423
|
-
|
|
62424
|
-
|
|
62611
|
+
if (couldContainTypeVariables(inferenceTargetType)) {
|
|
62612
|
+
var outerContext = getInferenceContext(node);
|
|
62613
|
+
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1));
|
|
62614
|
+
var instantiatedType = instantiateType(contextualType, outerMapper);
|
|
62615
|
+
var contextualSignature = getSingleCallSignature(instantiatedType);
|
|
62616
|
+
var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
|
|
62617
|
+
getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
|
|
62618
|
+
instantiatedType;
|
|
62619
|
+
inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128);
|
|
62620
|
+
var returnContext = createInferenceContext(signature.typeParameters, signature, context.flags);
|
|
62621
|
+
var returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper);
|
|
62622
|
+
inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType);
|
|
62623
|
+
context.returnMapper = ts.some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : undefined;
|
|
62624
|
+
}
|
|
62425
62625
|
}
|
|
62426
62626
|
}
|
|
62427
62627
|
var restType = getNonArrayRestType(signature);
|
|
@@ -62433,7 +62633,7 @@ var ts;
|
|
|
62433
62633
|
}
|
|
62434
62634
|
}
|
|
62435
62635
|
var thisType = getThisTypeOfSignature(signature);
|
|
62436
|
-
if (thisType) {
|
|
62636
|
+
if (thisType && couldContainTypeVariables(thisType)) {
|
|
62437
62637
|
var thisArgumentNode = getThisArgumentOfCall(node);
|
|
62438
62638
|
inferTypes(context.inferences, getThisArgumentType(thisArgumentNode), thisType);
|
|
62439
62639
|
}
|
|
@@ -62441,11 +62641,13 @@ var ts;
|
|
|
62441
62641
|
var arg = args[i];
|
|
62442
62642
|
if (arg.kind !== 227 && !(checkMode & 32 && hasSkipDirectInferenceFlag(arg))) {
|
|
62443
62643
|
var paramType = getTypeAtPosition(signature, i);
|
|
62444
|
-
|
|
62445
|
-
|
|
62644
|
+
if (couldContainTypeVariables(paramType)) {
|
|
62645
|
+
var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
62646
|
+
inferTypes(context.inferences, argType, paramType);
|
|
62647
|
+
}
|
|
62446
62648
|
}
|
|
62447
62649
|
}
|
|
62448
|
-
if (restType) {
|
|
62650
|
+
if (restType && couldContainTypeVariables(restType)) {
|
|
62449
62651
|
var spreadType = getSpreadArgumentType(args, argCount, args.length, restType, context, checkMode);
|
|
62450
62652
|
inferTypes(context.inferences, spreadType, restType);
|
|
62451
62653
|
}
|
|
@@ -63781,7 +63983,7 @@ var ts;
|
|
|
63781
63983
|
return returnType;
|
|
63782
63984
|
}
|
|
63783
63985
|
function checkDeprecatedSignature(signature, node) {
|
|
63784
|
-
if (signature.declaration && signature.declaration.flags &
|
|
63986
|
+
if (signature.declaration && signature.declaration.flags & 268435456) {
|
|
63785
63987
|
var suggestionNode = getDeprecatedSuggestionNode(node);
|
|
63786
63988
|
var name = ts.tryGetPropertyAccessOrIdentifierToString(ts.getInvokedExpression(node));
|
|
63787
63989
|
addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name, signatureToString(signature));
|
|
@@ -63918,7 +64120,7 @@ var ts;
|
|
|
63918
64120
|
: 0;
|
|
63919
64121
|
if (targetDeclarationKind !== 0) {
|
|
63920
64122
|
var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
|
|
63921
|
-
return !!decl && !!(decl.flags &
|
|
64123
|
+
return !!decl && !!(decl.flags & 16777216);
|
|
63922
64124
|
}
|
|
63923
64125
|
return false;
|
|
63924
64126
|
}
|
|
@@ -64113,7 +64315,7 @@ var ts;
|
|
|
64113
64315
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
|
|
64114
64316
|
}
|
|
64115
64317
|
var file = ts.getSourceFileOfNode(node);
|
|
64116
|
-
ts.Debug.assert(!!(file.flags &
|
|
64318
|
+
ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
|
|
64117
64319
|
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
|
|
64118
64320
|
}
|
|
64119
64321
|
function getTypeOfParameter(symbol) {
|
|
@@ -65911,6 +66113,9 @@ var ts;
|
|
|
65911
66113
|
context.contextualType = contextualType;
|
|
65912
66114
|
context.inferenceContext = inferenceContext;
|
|
65913
66115
|
var type = checkExpression(node, checkMode | 1 | (inferenceContext ? 2 : 0));
|
|
66116
|
+
if (inferenceContext && inferenceContext.intraExpressionInferenceSites) {
|
|
66117
|
+
inferenceContext.intraExpressionInferenceSites = undefined;
|
|
66118
|
+
}
|
|
65914
66119
|
var result = maybeTypeOfKind(type, 2944) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node)) ?
|
|
65915
66120
|
getRegularTypeOfLiteralType(type) : type;
|
|
65916
66121
|
return result;
|
|
@@ -66158,7 +66363,7 @@ var ts;
|
|
|
66158
66363
|
if (quickType) {
|
|
66159
66364
|
return quickType;
|
|
66160
66365
|
}
|
|
66161
|
-
if (node.flags &
|
|
66366
|
+
if (node.flags & 134217728 && flowTypeCache) {
|
|
66162
66367
|
var cachedType = flowTypeCache[getNodeId(node)];
|
|
66163
66368
|
if (cachedType) {
|
|
66164
66369
|
return cachedType;
|
|
@@ -66169,7 +66374,7 @@ var ts;
|
|
|
66169
66374
|
if (flowInvocationCount !== startInvocationCount) {
|
|
66170
66375
|
var cache = flowTypeCache || (flowTypeCache = []);
|
|
66171
66376
|
cache[getNodeId(node)] = type;
|
|
66172
|
-
ts.setNodeFlags(node, node.flags |
|
|
66377
|
+
ts.setNodeFlags(node, node.flags | 134217728);
|
|
66173
66378
|
}
|
|
66174
66379
|
return type;
|
|
66175
66380
|
}
|
|
@@ -66239,7 +66444,7 @@ var ts;
|
|
|
66239
66444
|
if (compilerOptions.isolatedModules) {
|
|
66240
66445
|
ts.Debug.assert(!!(type.symbol.flags & 128));
|
|
66241
66446
|
var constEnumDeclaration = type.symbol.valueDeclaration;
|
|
66242
|
-
if (constEnumDeclaration.flags &
|
|
66447
|
+
if (constEnumDeclaration.flags & 16777216) {
|
|
66243
66448
|
error(node, ts.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided);
|
|
66244
66449
|
}
|
|
66245
66450
|
}
|
|
@@ -66860,7 +67065,7 @@ var ts;
|
|
|
66860
67065
|
checkDecorators(node);
|
|
66861
67066
|
checkSignatureDeclaration(node);
|
|
66862
67067
|
if (node.kind === 172) {
|
|
66863
|
-
if (!(node.flags &
|
|
67068
|
+
if (!(node.flags & 16777216) && ts.nodeIsPresent(node.body) && (node.flags & 256)) {
|
|
66864
67069
|
if (!(node.flags & 512)) {
|
|
66865
67070
|
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
|
|
66866
67071
|
}
|
|
@@ -66950,7 +67155,7 @@ var ts;
|
|
|
66950
67155
|
}
|
|
66951
67156
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
66952
67157
|
if (symbol) {
|
|
66953
|
-
if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags &
|
|
67158
|
+
if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
|
|
66954
67159
|
addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
|
|
66955
67160
|
}
|
|
66956
67161
|
if (type.flags & 32 && symbol.flags & 8) {
|
|
@@ -67107,6 +67312,22 @@ var ts;
|
|
|
67107
67312
|
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
|
|
67108
67313
|
}
|
|
67109
67314
|
checkSourceElement(node.typeParameter);
|
|
67315
|
+
var symbol = getSymbolOfNode(node.typeParameter);
|
|
67316
|
+
if (symbol.declarations && symbol.declarations.length > 1) {
|
|
67317
|
+
var links = getSymbolLinks(symbol);
|
|
67318
|
+
if (!links.typeParametersChecked) {
|
|
67319
|
+
links.typeParametersChecked = true;
|
|
67320
|
+
var typeParameter = getDeclaredTypeOfTypeParameter(symbol);
|
|
67321
|
+
var declarations = ts.getDeclarationsOfKind(symbol, 163);
|
|
67322
|
+
if (!areTypeParametersIdentical(declarations, [typeParameter], function (decl) { return [decl]; })) {
|
|
67323
|
+
var name = symbolToString(symbol);
|
|
67324
|
+
for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
|
|
67325
|
+
var declaration = declarations_4[_i];
|
|
67326
|
+
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_constraints, name);
|
|
67327
|
+
}
|
|
67328
|
+
}
|
|
67329
|
+
}
|
|
67330
|
+
}
|
|
67110
67331
|
registerForUnusedIdentifiersCheck(node);
|
|
67111
67332
|
}
|
|
67112
67333
|
function checkTemplateLiteralType(node) {
|
|
@@ -67144,14 +67365,14 @@ var ts;
|
|
|
67144
67365
|
getTypeFromTypeNode(node);
|
|
67145
67366
|
}
|
|
67146
67367
|
function isPrivateWithinAmbient(node) {
|
|
67147
|
-
return (ts.hasEffectiveModifier(node, 8) || ts.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags &
|
|
67368
|
+
return (ts.hasEffectiveModifier(node, 8) || ts.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 16777216);
|
|
67148
67369
|
}
|
|
67149
67370
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
67150
67371
|
var flags = ts.getCombinedModifierFlags(n);
|
|
67151
67372
|
if (n.parent.kind !== 258 &&
|
|
67152
67373
|
n.parent.kind !== 257 &&
|
|
67153
67374
|
n.parent.kind !== 226 &&
|
|
67154
|
-
n.flags &
|
|
67375
|
+
n.flags & 16777216) {
|
|
67155
67376
|
if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
|
|
67156
67377
|
flags |= 1;
|
|
67157
67378
|
}
|
|
@@ -67263,10 +67484,10 @@ var ts;
|
|
|
67263
67484
|
var hasNonAmbientClass = false;
|
|
67264
67485
|
var functionDeclarations = [];
|
|
67265
67486
|
if (declarations) {
|
|
67266
|
-
for (var _i = 0,
|
|
67267
|
-
var current =
|
|
67487
|
+
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
|
|
67488
|
+
var current = declarations_5[_i];
|
|
67268
67489
|
var node = current;
|
|
67269
|
-
var inAmbientContext = node.flags &
|
|
67490
|
+
var inAmbientContext = node.flags & 16777216;
|
|
67270
67491
|
var inAmbientContextOrInterface = node.parent && (node.parent.kind === 258 || node.parent.kind === 182) || inAmbientContext;
|
|
67271
67492
|
if (inAmbientContextOrInterface) {
|
|
67272
67493
|
previousDeclaration = undefined;
|
|
@@ -67900,7 +68121,7 @@ var ts;
|
|
|
67900
68121
|
if (hasBindableName(node)) {
|
|
67901
68122
|
var symbol = getSymbolOfNode(node);
|
|
67902
68123
|
var localSymbol = node.localSymbol || symbol;
|
|
67903
|
-
var firstDeclaration = (_a = localSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (declaration) { return declaration.kind === node.kind && !(declaration.flags &
|
|
68124
|
+
var firstDeclaration = (_a = localSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 262144); });
|
|
67904
68125
|
if (node === firstDeclaration) {
|
|
67905
68126
|
checkFunctionOrConstructorSymbol(localSymbol);
|
|
67906
68127
|
}
|
|
@@ -68010,7 +68231,7 @@ var ts;
|
|
|
68010
68231
|
var symbol = getSymbolOfNode(member);
|
|
68011
68232
|
if (!symbol.isReferenced
|
|
68012
68233
|
&& (ts.hasEffectiveModifier(member, 8) || ts.isNamedDeclaration(member) && ts.isPrivateIdentifier(member.name))
|
|
68013
|
-
&& !(member.flags &
|
|
68234
|
+
&& !(member.flags & 16777216)) {
|
|
68014
68235
|
addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
68015
68236
|
}
|
|
68016
68237
|
break;
|
|
@@ -68185,8 +68406,8 @@ var ts;
|
|
|
68185
68406
|
: ts.createDiagnosticForNode(declarationList.parent.kind === 237 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
|
|
68186
68407
|
}
|
|
68187
68408
|
else {
|
|
68188
|
-
for (var _i = 0,
|
|
68189
|
-
var decl =
|
|
68409
|
+
for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
|
|
68410
|
+
var decl = declarations_6[_i];
|
|
68190
68411
|
addDiagnostic(decl, 0, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
|
|
68191
68412
|
}
|
|
68192
68413
|
}
|
|
@@ -68226,7 +68447,7 @@ var ts;
|
|
|
68226
68447
|
}
|
|
68227
68448
|
}
|
|
68228
68449
|
function checkCollisionWithArgumentsInGeneratedCode(node) {
|
|
68229
|
-
if (languageVersion >= 2 || !ts.hasRestParameter(node) || node.flags &
|
|
68450
|
+
if (languageVersion >= 2 || !ts.hasRestParameter(node) || node.flags & 16777216 || ts.nodeIsMissing(node.body)) {
|
|
68230
68451
|
return;
|
|
68231
68452
|
}
|
|
68232
68453
|
ts.forEach(node.parameters, function (p) {
|
|
@@ -68248,7 +68469,7 @@ var ts;
|
|
|
68248
68469
|
node.kind === 296) {
|
|
68249
68470
|
return false;
|
|
68250
68471
|
}
|
|
68251
|
-
if (node.flags &
|
|
68472
|
+
if (node.flags & 16777216) {
|
|
68252
68473
|
return false;
|
|
68253
68474
|
}
|
|
68254
68475
|
if (ts.isImportClause(node) || ts.isImportEqualsDeclaration(node) || ts.isImportSpecifier(node)) {
|
|
@@ -68374,7 +68595,7 @@ var ts;
|
|
|
68374
68595
|
recordPotentialCollisionWithReflectInGeneratedCode(node, name);
|
|
68375
68596
|
if (ts.isClassLike(node)) {
|
|
68376
68597
|
checkTypeNameIsReserved(name, ts.Diagnostics.Class_name_cannot_be_0);
|
|
68377
|
-
if (!(node.flags &
|
|
68598
|
+
if (!(node.flags & 16777216)) {
|
|
68378
68599
|
checkClassNameCollisionWithObject(name);
|
|
68379
68600
|
}
|
|
68380
68601
|
}
|
|
@@ -69635,21 +69856,21 @@ var ts;
|
|
|
69635
69856
|
return;
|
|
69636
69857
|
}
|
|
69637
69858
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
69638
|
-
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
|
|
69859
|
+
if (!areTypeParametersIdentical(declarations, type.localTypeParameters, ts.getEffectiveTypeParameterDeclarations)) {
|
|
69639
69860
|
var name = symbolToString(symbol);
|
|
69640
|
-
for (var _i = 0,
|
|
69641
|
-
var declaration =
|
|
69861
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
69862
|
+
var declaration = declarations_7[_i];
|
|
69642
69863
|
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
|
|
69643
69864
|
}
|
|
69644
69865
|
}
|
|
69645
69866
|
}
|
|
69646
69867
|
}
|
|
69647
|
-
function areTypeParametersIdentical(declarations, targetParameters) {
|
|
69868
|
+
function areTypeParametersIdentical(declarations, targetParameters, getTypeParameterDeclarations) {
|
|
69648
69869
|
var maxTypeArgumentCount = ts.length(targetParameters);
|
|
69649
69870
|
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
|
|
69650
|
-
for (var _i = 0,
|
|
69651
|
-
var declaration =
|
|
69652
|
-
var sourceParameters =
|
|
69871
|
+
for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
|
|
69872
|
+
var declaration = declarations_8[_i];
|
|
69873
|
+
var sourceParameters = getTypeParameterDeclarations(declaration);
|
|
69653
69874
|
var numTypeParameters = sourceParameters.length;
|
|
69654
69875
|
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
|
|
69655
69876
|
return false;
|
|
@@ -69708,7 +69929,7 @@ var ts;
|
|
|
69708
69929
|
checkTypeParameterListsIdentical(symbol);
|
|
69709
69930
|
checkFunctionOrConstructorSymbol(symbol);
|
|
69710
69931
|
checkClassForDuplicateDeclarations(node);
|
|
69711
|
-
var nodeInAmbientContext = !!(node.flags &
|
|
69932
|
+
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
69712
69933
|
if (!nodeInAmbientContext) {
|
|
69713
69934
|
checkClassForStaticPropertyNameConflicts(node);
|
|
69714
69935
|
}
|
|
@@ -69840,7 +70061,7 @@ var ts;
|
|
|
69840
70061
|
}
|
|
69841
70062
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
69842
70063
|
var isJs = ts.isInJSFile(node);
|
|
69843
|
-
var nodeInAmbientContext = !!(node.flags &
|
|
70064
|
+
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
69844
70065
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
69845
70066
|
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
69846
70067
|
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
@@ -70027,7 +70248,7 @@ var ts;
|
|
|
70027
70248
|
&& !(derived.flags & 33554432)
|
|
70028
70249
|
&& !(baseDeclarationFlags & 128)
|
|
70029
70250
|
&& !(derivedDeclarationFlags & 128)
|
|
70030
|
-
&& !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags &
|
|
70251
|
+
&& !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216); }))) {
|
|
70031
70252
|
var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
|
|
70032
70253
|
var propName = uninitialized.name;
|
|
70033
70254
|
if (uninitialized.exclamationToken
|
|
@@ -70117,7 +70338,7 @@ var ts;
|
|
|
70117
70338
|
return ok;
|
|
70118
70339
|
}
|
|
70119
70340
|
function checkPropertyInitialization(node) {
|
|
70120
|
-
if (!strictNullChecks || !strictPropertyInitialization || node.flags &
|
|
70341
|
+
if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216) {
|
|
70121
70342
|
return;
|
|
70122
70343
|
}
|
|
70123
70344
|
var constructor = findConstructorDeclaration(node);
|
|
@@ -70247,7 +70468,7 @@ var ts;
|
|
|
70247
70468
|
if (member.initializer) {
|
|
70248
70469
|
return computeConstantValue(member);
|
|
70249
70470
|
}
|
|
70250
|
-
if (member.parent.flags &
|
|
70471
|
+
if (member.parent.flags & 16777216 && !ts.isEnumConst(member.parent) && getEnumKind(getSymbolOfNode(member.parent)) === 0) {
|
|
70251
70472
|
return undefined;
|
|
70252
70473
|
}
|
|
70253
70474
|
if (autoValue !== undefined) {
|
|
@@ -70275,7 +70496,7 @@ var ts;
|
|
|
70275
70496
|
else if (isConstEnum) {
|
|
70276
70497
|
error(initializer, ts.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);
|
|
70277
70498
|
}
|
|
70278
|
-
else if (member.parent.flags &
|
|
70499
|
+
else if (member.parent.flags & 16777216) {
|
|
70279
70500
|
error(initializer, ts.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);
|
|
70280
70501
|
}
|
|
70281
70502
|
else {
|
|
@@ -70433,11 +70654,11 @@ var ts;
|
|
|
70433
70654
|
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
|
|
70434
70655
|
var declarations = symbol.declarations;
|
|
70435
70656
|
if (declarations) {
|
|
70436
|
-
for (var _i = 0,
|
|
70437
|
-
var declaration =
|
|
70657
|
+
for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
|
|
70658
|
+
var declaration = declarations_9[_i];
|
|
70438
70659
|
if ((declaration.kind === 257 ||
|
|
70439
70660
|
(declaration.kind === 256 && ts.nodeIsPresent(declaration.body))) &&
|
|
70440
|
-
!(declaration.flags &
|
|
70661
|
+
!(declaration.flags & 16777216)) {
|
|
70441
70662
|
return declaration;
|
|
70442
70663
|
}
|
|
70443
70664
|
}
|
|
@@ -70467,7 +70688,7 @@ var ts;
|
|
|
70467
70688
|
addLazyDiagnostic(checkModuleDeclarationDiagnostics);
|
|
70468
70689
|
function checkModuleDeclarationDiagnostics() {
|
|
70469
70690
|
var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node);
|
|
70470
|
-
var inAmbientContext = node.flags &
|
|
70691
|
+
var inAmbientContext = node.flags & 16777216;
|
|
70471
70692
|
if (isGlobalAugmentation && !inAmbientContext) {
|
|
70472
70693
|
error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);
|
|
70473
70694
|
}
|
|
@@ -70653,7 +70874,7 @@ var ts;
|
|
|
70653
70874
|
}
|
|
70654
70875
|
if (compilerOptions.isolatedModules
|
|
70655
70876
|
&& !ts.isTypeOnlyImportOrExportDeclaration(node)
|
|
70656
|
-
&& !(node.flags &
|
|
70877
|
+
&& !(node.flags & 16777216)) {
|
|
70657
70878
|
var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
70658
70879
|
var isType = !(target.flags & 111551);
|
|
70659
70880
|
if (isType || typeOnlyAlias) {
|
|
@@ -70696,7 +70917,7 @@ var ts;
|
|
|
70696
70917
|
}
|
|
70697
70918
|
}
|
|
70698
70919
|
function isDeprecatedAliasedSymbol(symbol) {
|
|
70699
|
-
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) &
|
|
70920
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 268435456); });
|
|
70700
70921
|
}
|
|
70701
70922
|
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
70702
70923
|
if (!(symbol.flags & 2097152))
|
|
@@ -70821,7 +71042,7 @@ var ts;
|
|
|
70821
71042
|
}
|
|
70822
71043
|
}
|
|
70823
71044
|
else {
|
|
70824
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags &
|
|
71045
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 16777216)) {
|
|
70825
71046
|
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);
|
|
70826
71047
|
}
|
|
70827
71048
|
}
|
|
@@ -70843,7 +71064,7 @@ var ts;
|
|
|
70843
71064
|
ts.forEach(node.exportClause.elements, checkExportSpecifier);
|
|
70844
71065
|
var inAmbientExternalModule = node.parent.kind === 262 && ts.isAmbientModule(node.parent.parent);
|
|
70845
71066
|
var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 262 &&
|
|
70846
|
-
!node.moduleSpecifier && node.flags &
|
|
71067
|
+
!node.moduleSpecifier && node.flags & 16777216;
|
|
70847
71068
|
if (node.parent.kind !== 305 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
|
|
70848
71069
|
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
|
|
70849
71070
|
}
|
|
@@ -70996,10 +71217,10 @@ var ts;
|
|
|
70996
71217
|
checkExpressionCached(node.expression);
|
|
70997
71218
|
}
|
|
70998
71219
|
checkExternalModuleExports(container);
|
|
70999
|
-
if ((node.flags &
|
|
71220
|
+
if ((node.flags & 16777216) && !ts.isEntityNameExpression(node.expression)) {
|
|
71000
71221
|
grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
71001
71222
|
}
|
|
71002
|
-
if (node.isExportEquals && !(node.flags &
|
|
71223
|
+
if (node.isExportEquals && !(node.flags & 16777216)) {
|
|
71003
71224
|
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
71004
71225
|
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
71005
71226
|
}
|
|
@@ -71397,7 +71618,7 @@ var ts;
|
|
|
71397
71618
|
addLazyDiagnostic(function () {
|
|
71398
71619
|
if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) {
|
|
71399
71620
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function (containingNode, kind, diag) {
|
|
71400
|
-
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags &
|
|
71621
|
+
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
71401
71622
|
diagnostics.add(diag);
|
|
71402
71623
|
}
|
|
71403
71624
|
});
|
|
@@ -71478,7 +71699,7 @@ var ts;
|
|
|
71478
71699
|
return diagnostics.getGlobalDiagnostics();
|
|
71479
71700
|
}
|
|
71480
71701
|
function getSymbolsInScope(location, meaning) {
|
|
71481
|
-
if (location.flags &
|
|
71702
|
+
if (location.flags & 33554432) {
|
|
71482
71703
|
return [];
|
|
71483
71704
|
}
|
|
71484
71705
|
var symbols = ts.createSymbolTable();
|
|
@@ -71791,7 +72012,7 @@ var ts;
|
|
|
71791
72012
|
}
|
|
71792
72013
|
var parent = node.parent;
|
|
71793
72014
|
var grandParent = parent.parent;
|
|
71794
|
-
if (node.flags &
|
|
72015
|
+
if (node.flags & 33554432) {
|
|
71795
72016
|
return undefined;
|
|
71796
72017
|
}
|
|
71797
72018
|
if (isDeclarationNameOrImportPropertyName(node)) {
|
|
@@ -71921,7 +72142,7 @@ var ts;
|
|
|
71921
72142
|
if (ts.isSourceFile(node) && !ts.isExternalModule(node)) {
|
|
71922
72143
|
return errorType;
|
|
71923
72144
|
}
|
|
71924
|
-
if (node.flags &
|
|
72145
|
+
if (node.flags & 33554432) {
|
|
71925
72146
|
return errorType;
|
|
71926
72147
|
}
|
|
71927
72148
|
var classDecl = ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node);
|
|
@@ -72835,7 +73056,7 @@ var ts;
|
|
|
72835
73056
|
function checkExternalEmitHelpers(location, helpers) {
|
|
72836
73057
|
if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {
|
|
72837
73058
|
var sourceFile = ts.getSourceFileOfNode(location);
|
|
72838
|
-
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags &
|
|
73059
|
+
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 16777216)) {
|
|
72839
73060
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
72840
73061
|
if (helpersModule !== unknownSymbol) {
|
|
72841
73062
|
var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;
|
|
@@ -73085,7 +73306,7 @@ var ts;
|
|
|
73085
73306
|
else if (node.kind === 164) {
|
|
73086
73307
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
|
|
73087
73308
|
}
|
|
73088
|
-
else if ((node.parent.flags &
|
|
73309
|
+
else if ((node.parent.flags & 16777216) && node.parent.kind === 262) {
|
|
73089
73310
|
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
73090
73311
|
}
|
|
73091
73312
|
else if (ts.isPrivateIdentifierClassElementDeclaration(node)) {
|
|
@@ -73131,7 +73352,7 @@ var ts;
|
|
|
73131
73352
|
if (flags & 256) {
|
|
73132
73353
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
|
|
73133
73354
|
}
|
|
73134
|
-
else if (flags & 2 || node.parent.flags &
|
|
73355
|
+
else if (flags & 2 || node.parent.flags & 16777216) {
|
|
73135
73356
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
73136
73357
|
}
|
|
73137
73358
|
else if (node.kind === 164) {
|
|
@@ -73273,7 +73494,7 @@ var ts;
|
|
|
73273
73494
|
if (i !== (parameterCount - 1)) {
|
|
73274
73495
|
return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);
|
|
73275
73496
|
}
|
|
73276
|
-
if (!(parameter.flags &
|
|
73497
|
+
if (!(parameter.flags & 16777216)) {
|
|
73277
73498
|
checkGrammarForDisallowedTrailingComma(parameters, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
|
|
73278
73499
|
}
|
|
73279
73500
|
if (parameter.questionToken) {
|
|
@@ -73479,7 +73700,7 @@ var ts;
|
|
|
73479
73700
|
ts.Debug.assert(node.kind === 256 ||
|
|
73480
73701
|
node.kind === 213 ||
|
|
73481
73702
|
node.kind === 169);
|
|
73482
|
-
if (node.flags &
|
|
73703
|
+
if (node.flags & 16777216) {
|
|
73483
73704
|
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
|
|
73484
73705
|
}
|
|
73485
73706
|
if (!node.body) {
|
|
@@ -73694,7 +73915,7 @@ var ts;
|
|
|
73694
73915
|
return false;
|
|
73695
73916
|
}
|
|
73696
73917
|
function checkGrammarAccessor(accessor) {
|
|
73697
|
-
if (!(accessor.flags &
|
|
73918
|
+
if (!(accessor.flags & 16777216) && (accessor.parent.kind !== 182) && (accessor.parent.kind !== 258)) {
|
|
73698
73919
|
if (languageVersion < 1) {
|
|
73699
73920
|
return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
|
|
73700
73921
|
}
|
|
@@ -73824,7 +74045,7 @@ var ts;
|
|
|
73824
74045
|
if (languageVersion < 2 && ts.isPrivateIdentifier(node.name)) {
|
|
73825
74046
|
return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
73826
74047
|
}
|
|
73827
|
-
if (node.flags &
|
|
74048
|
+
if (node.flags & 16777216) {
|
|
73828
74049
|
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);
|
|
73829
74050
|
}
|
|
73830
74051
|
else if (node.kind === 169 && !node.body) {
|
|
@@ -73935,7 +74156,7 @@ var ts;
|
|
|
73935
74156
|
}
|
|
73936
74157
|
function checkGrammarVariableDeclaration(node) {
|
|
73937
74158
|
if (node.parent.parent.kind !== 243 && node.parent.parent.kind !== 244) {
|
|
73938
|
-
if (node.flags &
|
|
74159
|
+
if (node.flags & 16777216) {
|
|
73939
74160
|
checkAmbientInitializer(node);
|
|
73940
74161
|
}
|
|
73941
74162
|
else if (!node.initializer) {
|
|
@@ -73947,7 +74168,7 @@ var ts;
|
|
|
73947
74168
|
}
|
|
73948
74169
|
}
|
|
73949
74170
|
}
|
|
73950
|
-
if (node.exclamationToken && (node.parent.parent.kind !== 237 || !node.type || node.initializer || node.flags &
|
|
74171
|
+
if (node.exclamationToken && (node.parent.parent.kind !== 237 || !node.type || node.initializer || node.flags & 16777216)) {
|
|
73951
74172
|
var message = node.initializer
|
|
73952
74173
|
? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
|
|
73953
74174
|
: !node.type
|
|
@@ -73956,7 +74177,7 @@ var ts;
|
|
|
73956
74177
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
73957
74178
|
}
|
|
73958
74179
|
if ((moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
73959
|
-
!(node.parent.parent.flags &
|
|
74180
|
+
!(node.parent.parent.flags & 16777216) && ts.hasSyntacticModifier(node.parent.parent, 1)) {
|
|
73960
74181
|
checkESModuleMarker(node.name);
|
|
73961
74182
|
}
|
|
73962
74183
|
var checkLetConstNames = (ts.isLet(node) || ts.isVarConst(node));
|
|
@@ -74127,11 +74348,11 @@ var ts;
|
|
|
74127
74348
|
return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer);
|
|
74128
74349
|
}
|
|
74129
74350
|
}
|
|
74130
|
-
if (node.flags &
|
|
74351
|
+
if (node.flags & 16777216) {
|
|
74131
74352
|
checkAmbientInitializer(node);
|
|
74132
74353
|
}
|
|
74133
74354
|
if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer ||
|
|
74134
|
-
node.flags &
|
|
74355
|
+
node.flags & 16777216 || ts.isStatic(node) || ts.hasAbstractModifier(node))) {
|
|
74135
74356
|
var message = node.initializer
|
|
74136
74357
|
? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions
|
|
74137
74358
|
: !node.type
|
|
@@ -74165,10 +74386,10 @@ var ts;
|
|
|
74165
74386
|
return false;
|
|
74166
74387
|
}
|
|
74167
74388
|
function checkGrammarSourceFile(node) {
|
|
74168
|
-
return !!(node.flags &
|
|
74389
|
+
return !!(node.flags & 16777216) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node);
|
|
74169
74390
|
}
|
|
74170
74391
|
function checkGrammarStatementInAmbientContext(node) {
|
|
74171
|
-
if (node.flags &
|
|
74392
|
+
if (node.flags & 16777216) {
|
|
74172
74393
|
var links = getNodeLinks(node);
|
|
74173
74394
|
if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) {
|
|
74174
74395
|
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
|
|
@@ -77320,7 +77541,7 @@ var ts;
|
|
|
77320
77541
|
return !ts.nodeIsMissing(node.body);
|
|
77321
77542
|
}
|
|
77322
77543
|
function visitPropertyDeclaration(node) {
|
|
77323
|
-
if (node.flags &
|
|
77544
|
+
if (node.flags & 16777216 || ts.hasSyntacticModifier(node, 128)) {
|
|
77324
77545
|
return undefined;
|
|
77325
77546
|
}
|
|
77326
77547
|
var updated = factory.updatePropertyDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node), undefined, undefined, ts.visitNode(node.initializer, visitor));
|
|
@@ -82559,8 +82780,8 @@ var ts;
|
|
|
82559
82780
|
}
|
|
82560
82781
|
function getRangeUnion(declarations) {
|
|
82561
82782
|
var pos = -1, end = -1;
|
|
82562
|
-
for (var _i = 0,
|
|
82563
|
-
var node =
|
|
82783
|
+
for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {
|
|
82784
|
+
var node = declarations_10[_i];
|
|
82564
82785
|
pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos);
|
|
82565
82786
|
end = Math.max(end, node.end);
|
|
82566
82787
|
}
|
|
@@ -88735,7 +88956,7 @@ var ts;
|
|
|
88735
88956
|
needsScopeFixMarker = false;
|
|
88736
88957
|
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
|
|
88737
88958
|
var lateStatements = transformAndReplaceLatePaintedStatements(statements);
|
|
88738
|
-
if (input.flags &
|
|
88959
|
+
if (input.flags & 16777216) {
|
|
88739
88960
|
needsScopeFixMarker = false;
|
|
88740
88961
|
}
|
|
88741
88962
|
if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {
|
|
@@ -90175,6 +90396,9 @@ var ts;
|
|
|
90175
90396
|
var currentParenthesizerRule;
|
|
90176
90397
|
var _c = ts.performance.createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"), enterComment = _c.enter, exitComment = _c.exit;
|
|
90177
90398
|
var parenthesizer = ts.factory.parenthesizer;
|
|
90399
|
+
var typeArgumentParenthesizerRuleSelector = {
|
|
90400
|
+
select: function (index) { return index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : undefined; }
|
|
90401
|
+
};
|
|
90178
90402
|
var emitBinaryExpression = createEmitBinaryExpression();
|
|
90179
90403
|
reset();
|
|
90180
90404
|
return {
|
|
@@ -91298,7 +91522,7 @@ var ts;
|
|
|
91298
91522
|
writePunctuation("}");
|
|
91299
91523
|
}
|
|
91300
91524
|
function emitArrayType(node) {
|
|
91301
|
-
emit(node.elementType, parenthesizer.
|
|
91525
|
+
emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
91302
91526
|
writePunctuation("[");
|
|
91303
91527
|
writePunctuation("]");
|
|
91304
91528
|
}
|
|
@@ -91309,7 +91533,7 @@ var ts;
|
|
|
91309
91533
|
function emitTupleType(node) {
|
|
91310
91534
|
emitTokenWithComment(22, node.pos, writePunctuation, node);
|
|
91311
91535
|
var flags = ts.getEmitFlags(node) & 1 ? 528 : 657;
|
|
91312
|
-
emitList(node, node.elements, flags | 524288);
|
|
91536
|
+
emitList(node, node.elements, flags | 524288, parenthesizer.parenthesizeElementTypeOfTupleType);
|
|
91313
91537
|
emitTokenWithComment(23, node.elements.end, writePunctuation, node);
|
|
91314
91538
|
}
|
|
91315
91539
|
function emitNamedTupleMember(node) {
|
|
@@ -91321,21 +91545,21 @@ var ts;
|
|
|
91321
91545
|
emit(node.type);
|
|
91322
91546
|
}
|
|
91323
91547
|
function emitOptionalType(node) {
|
|
91324
|
-
emit(node.type, parenthesizer.
|
|
91548
|
+
emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType);
|
|
91325
91549
|
writePunctuation("?");
|
|
91326
91550
|
}
|
|
91327
91551
|
function emitUnionType(node) {
|
|
91328
|
-
emitList(node, node.types, 516, parenthesizer.
|
|
91552
|
+
emitList(node, node.types, 516, parenthesizer.parenthesizeConstituentTypeOfUnionType);
|
|
91329
91553
|
}
|
|
91330
91554
|
function emitIntersectionType(node) {
|
|
91331
|
-
emitList(node, node.types, 520, parenthesizer.
|
|
91555
|
+
emitList(node, node.types, 520, parenthesizer.parenthesizeConstituentTypeOfIntersectionType);
|
|
91332
91556
|
}
|
|
91333
91557
|
function emitConditionalType(node) {
|
|
91334
|
-
emit(node.checkType, parenthesizer.
|
|
91558
|
+
emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType);
|
|
91335
91559
|
writeSpace();
|
|
91336
91560
|
writeKeyword("extends");
|
|
91337
91561
|
writeSpace();
|
|
91338
|
-
emit(node.extendsType, parenthesizer.
|
|
91562
|
+
emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType);
|
|
91339
91563
|
writeSpace();
|
|
91340
91564
|
writePunctuation("?");
|
|
91341
91565
|
writeSpace();
|
|
@@ -91361,10 +91585,13 @@ var ts;
|
|
|
91361
91585
|
function emitTypeOperator(node) {
|
|
91362
91586
|
writeTokenText(node.operator, writeKeyword);
|
|
91363
91587
|
writeSpace();
|
|
91364
|
-
|
|
91588
|
+
var parenthesizerRule = node.operator === 145 ?
|
|
91589
|
+
parenthesizer.parenthesizeOperandOfReadonlyTypeOperator :
|
|
91590
|
+
parenthesizer.parenthesizeOperandOfTypeOperator;
|
|
91591
|
+
emit(node.type, parenthesizerRule);
|
|
91365
91592
|
}
|
|
91366
91593
|
function emitIndexedAccessType(node) {
|
|
91367
|
-
emit(node.objectType, parenthesizer.
|
|
91594
|
+
emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
91368
91595
|
writePunctuation("[");
|
|
91369
91596
|
emit(node.indexType);
|
|
91370
91597
|
writePunctuation("]");
|
|
@@ -93005,7 +93232,7 @@ var ts;
|
|
|
93005
93232
|
emitList(parentNode, decorators, 2146305);
|
|
93006
93233
|
}
|
|
93007
93234
|
function emitTypeArguments(parentNode, typeArguments) {
|
|
93008
|
-
emitList(parentNode, typeArguments, 53776,
|
|
93235
|
+
emitList(parentNode, typeArguments, 53776, typeArgumentParenthesizerRuleSelector);
|
|
93009
93236
|
}
|
|
93010
93237
|
function emitTypeParameters(parentNode, typeParameters) {
|
|
93011
93238
|
if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) {
|
|
@@ -93121,6 +93348,7 @@ var ts;
|
|
|
93121
93348
|
if (format & 128) {
|
|
93122
93349
|
increaseIndent();
|
|
93123
93350
|
}
|
|
93351
|
+
var emitListItem = getEmitListItem(emit, parenthesizerRule);
|
|
93124
93352
|
var previousSibling = void 0;
|
|
93125
93353
|
var previousSourceFileTextKind = void 0;
|
|
93126
93354
|
var shouldDecreaseIndentAfterEmit = false;
|
|
@@ -93158,12 +93386,7 @@ var ts;
|
|
|
93158
93386
|
shouldEmitInterveningComments = mayEmitInterveningComments;
|
|
93159
93387
|
}
|
|
93160
93388
|
nextListElementPos = child.pos;
|
|
93161
|
-
|
|
93162
|
-
emit(child);
|
|
93163
|
-
}
|
|
93164
|
-
else {
|
|
93165
|
-
emit(child, parenthesizerRule);
|
|
93166
|
-
}
|
|
93389
|
+
emitListItem(child, emit, parenthesizerRule, i);
|
|
93167
93390
|
if (shouldDecreaseIndentAfterEmit) {
|
|
93168
93391
|
decreaseIndent();
|
|
93169
93392
|
shouldDecreaseIndentAfterEmit = false;
|
|
@@ -94217,6 +94440,20 @@ var ts;
|
|
|
94217
94440
|
function getClosingBracket(format) {
|
|
94218
94441
|
return brackets[format & 15360][1];
|
|
94219
94442
|
}
|
|
94443
|
+
function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) {
|
|
94444
|
+
emit(node);
|
|
94445
|
+
}
|
|
94446
|
+
function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) {
|
|
94447
|
+
emit(node, parenthesizerRuleSelector.select(index));
|
|
94448
|
+
}
|
|
94449
|
+
function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) {
|
|
94450
|
+
emit(node, parenthesizerRule);
|
|
94451
|
+
}
|
|
94452
|
+
function getEmitListItem(emit, parenthesizerRule) {
|
|
94453
|
+
return emit.length === 1 ? emitListItemNoParenthesizer :
|
|
94454
|
+
typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector :
|
|
94455
|
+
emitListItemWithParenthesizerRule;
|
|
94456
|
+
}
|
|
94220
94457
|
})(ts || (ts = {}));
|
|
94221
94458
|
var ts;
|
|
94222
94459
|
(function (ts) {
|
|
@@ -96013,7 +96250,7 @@ var ts;
|
|
|
96013
96250
|
if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
|
|
96014
96251
|
structureIsReused = 1;
|
|
96015
96252
|
}
|
|
96016
|
-
if ((oldSourceFile.flags &
|
|
96253
|
+
if ((oldSourceFile.flags & 6291456) !== (newSourceFile.flags & 6291456)) {
|
|
96017
96254
|
structureIsReused = 1;
|
|
96018
96255
|
}
|
|
96019
96256
|
if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
|
|
@@ -96160,6 +96397,9 @@ var ts;
|
|
|
96160
96397
|
return !!sourceFilesFoundSearchingNodeModules.get(file.path);
|
|
96161
96398
|
}
|
|
96162
96399
|
function isSourceFileDefaultLibrary(file) {
|
|
96400
|
+
if (!file.isDeclarationFile) {
|
|
96401
|
+
return false;
|
|
96402
|
+
}
|
|
96163
96403
|
if (file.hasNoDefaultLib) {
|
|
96164
96404
|
return true;
|
|
96165
96405
|
}
|
|
@@ -96615,7 +96855,7 @@ var ts;
|
|
|
96615
96855
|
var node = _a[_i];
|
|
96616
96856
|
collectModuleReferences(node, false);
|
|
96617
96857
|
}
|
|
96618
|
-
if ((file.flags &
|
|
96858
|
+
if ((file.flags & 2097152) || isJavaScriptFile) {
|
|
96619
96859
|
collectDynamicImportOrRequireCalls(file);
|
|
96620
96860
|
}
|
|
96621
96861
|
file.imports = imports || ts.emptyArray;
|
|
@@ -97137,7 +97377,7 @@ var ts;
|
|
|
97137
97377
|
&& index < file.imports.length
|
|
97138
97378
|
&& !elideImport
|
|
97139
97379
|
&& !(isJsFile && !ts.getAllowJSCompilerOption(optionsForFile))
|
|
97140
|
-
&& (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags &
|
|
97380
|
+
&& (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags & 8388608));
|
|
97141
97381
|
if (elideImport) {
|
|
97142
97382
|
modulesWithElidedImports.set(file.path, true);
|
|
97143
97383
|
}
|
|
@@ -97213,21 +97453,6 @@ var ts;
|
|
|
97213
97453
|
return resolvedRef;
|
|
97214
97454
|
}
|
|
97215
97455
|
function verifyCompilerOptions() {
|
|
97216
|
-
var isNightly = ts.stringContains(ts.version, "-dev") || ts.stringContains(ts.version, "-insiders");
|
|
97217
|
-
if (!isNightly) {
|
|
97218
|
-
if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
|
|
97219
|
-
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");
|
|
97220
|
-
}
|
|
97221
|
-
else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
|
|
97222
|
-
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");
|
|
97223
|
-
}
|
|
97224
|
-
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
|
|
97225
|
-
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");
|
|
97226
|
-
}
|
|
97227
|
-
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
97228
|
-
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");
|
|
97229
|
-
}
|
|
97230
|
-
}
|
|
97231
97456
|
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
97232
97457
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
97233
97458
|
}
|