@typescript-deploys/pr-build 4.6.0-pr-47607-13 → 4.6.0-pr-47550-11
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/cs/diagnosticMessages.generated.json +19 -4
- package/lib/de/diagnosticMessages.generated.json +19 -4
- package/lib/es/diagnosticMessages.generated.json +19 -4
- package/lib/fr/diagnosticMessages.generated.json +2 -0
- package/lib/ja/diagnosticMessages.generated.json +2 -0
- package/lib/ko/diagnosticMessages.generated.json +2 -0
- package/lib/lib.dom.d.ts +1 -1
- package/lib/pt-br/diagnosticMessages.generated.json +19 -4
- package/lib/ru/diagnosticMessages.generated.json +2 -0
- package/lib/tsc.js +222 -298
- package/lib/tsserver.js +376 -359
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +376 -359
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +376 -359
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +376 -359
- package/lib/typingsInstaller.js +263 -327
- package/lib/zh-cn/diagnosticMessages.generated.json +19 -4
- package/lib/zh-tw/diagnosticMessages.generated.json +2 -0
- 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.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220128";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -5744,7 +5744,6 @@ var ts;
|
|
|
5744
5744
|
Cannot_assign_to_0_because_it_is_an_import: diag(2632, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."),
|
|
5745
5745
|
JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, ts.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
|
|
5746
5746
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
5747
|
-
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
5748
5747
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
5749
5748
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
5750
5749
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -6658,9 +6657,8 @@ var ts;
|
|
|
6658
6657
|
Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"),
|
|
6659
6658
|
Remove_template_tag: diag(90011, ts.DiagnosticCategory.Message, "Remove_template_tag_90011", "Remove template tag"),
|
|
6660
6659
|
Remove_type_parameters: diag(90012, ts.DiagnosticCategory.Message, "Remove_type_parameters_90012", "Remove type parameters"),
|
|
6661
|
-
|
|
6660
|
+
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import '{0}' from \"{1}\""),
|
|
6662
6661
|
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
|
|
6663
|
-
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\""),
|
|
6664
6662
|
Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'"),
|
|
6665
6663
|
Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"),
|
|
6666
6664
|
Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file"),
|
|
@@ -6677,8 +6675,6 @@ var ts;
|
|
|
6677
6675
|
Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"),
|
|
6678
6676
|
Replace_infer_0_with_unknown: diag(90030, ts.DiagnosticCategory.Message, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"),
|
|
6679
6677
|
Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"),
|
|
6680
|
-
Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""),
|
|
6681
|
-
Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""),
|
|
6682
6678
|
Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"),
|
|
6683
6679
|
Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"),
|
|
6684
6680
|
Replace_0_with_Promise_1: diag(90036, ts.DiagnosticCategory.Message, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"),
|
|
@@ -6690,6 +6686,8 @@ var ts;
|
|
|
6690
6686
|
Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
|
|
6691
6687
|
Remove_type_from_import_declaration_from_0: diag(90055, ts.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", "Remove 'type' from import declaration from \"{0}\""),
|
|
6692
6688
|
Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
|
|
6689
|
+
Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
|
|
6690
|
+
Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
|
|
6693
6691
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
6694
6692
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
6695
6693
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -10094,7 +10092,6 @@ var ts;
|
|
|
10094
10092
|
case 110:
|
|
10095
10093
|
case 106:
|
|
10096
10094
|
case 229:
|
|
10097
|
-
case 227:
|
|
10098
10095
|
case 230:
|
|
10099
10096
|
case 100:
|
|
10100
10097
|
return true;
|
|
@@ -11612,7 +11609,7 @@ var ts;
|
|
|
11612
11609
|
case 114:
|
|
11613
11610
|
return node.parent.kind !== 216;
|
|
11614
11611
|
case 227:
|
|
11615
|
-
return
|
|
11612
|
+
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11616
11613
|
case 162:
|
|
11617
11614
|
return node.parent.kind === 194 || node.parent.kind === 189;
|
|
11618
11615
|
case 79:
|
|
@@ -11638,7 +11635,7 @@ var ts;
|
|
|
11638
11635
|
}
|
|
11639
11636
|
switch (parent.kind) {
|
|
11640
11637
|
case 227:
|
|
11641
|
-
return
|
|
11638
|
+
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11642
11639
|
case 162:
|
|
11643
11640
|
return node === parent.constraint;
|
|
11644
11641
|
case 342:
|
|
@@ -12277,7 +12274,7 @@ var ts;
|
|
|
12277
12274
|
case 296:
|
|
12278
12275
|
return true;
|
|
12279
12276
|
case 227:
|
|
12280
|
-
return parent.expression === node &&
|
|
12277
|
+
return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
12281
12278
|
case 295:
|
|
12282
12279
|
return parent.objectAssignmentInitializer === node;
|
|
12283
12280
|
default:
|
|
@@ -16601,6 +16598,49 @@ var ts;
|
|
|
16601
16598
|
return !!(type.flags & 262144 && type.isThisType);
|
|
16602
16599
|
}
|
|
16603
16600
|
ts.isThisTypeParameter = isThisTypeParameter;
|
|
16601
|
+
function getNodeModulePathParts(fullPath) {
|
|
16602
|
+
var topLevelNodeModulesIndex = 0;
|
|
16603
|
+
var topLevelPackageNameIndex = 0;
|
|
16604
|
+
var packageRootIndex = 0;
|
|
16605
|
+
var fileNameIndex = 0;
|
|
16606
|
+
var partStart = 0;
|
|
16607
|
+
var partEnd = 0;
|
|
16608
|
+
var state = 0;
|
|
16609
|
+
while (partEnd >= 0) {
|
|
16610
|
+
partStart = partEnd;
|
|
16611
|
+
partEnd = fullPath.indexOf("/", partStart + 1);
|
|
16612
|
+
switch (state) {
|
|
16613
|
+
case 0:
|
|
16614
|
+
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
16615
|
+
topLevelNodeModulesIndex = partStart;
|
|
16616
|
+
topLevelPackageNameIndex = partEnd;
|
|
16617
|
+
state = 1;
|
|
16618
|
+
}
|
|
16619
|
+
break;
|
|
16620
|
+
case 1:
|
|
16621
|
+
case 2:
|
|
16622
|
+
if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
|
|
16623
|
+
state = 2;
|
|
16624
|
+
}
|
|
16625
|
+
else {
|
|
16626
|
+
packageRootIndex = partEnd;
|
|
16627
|
+
state = 3;
|
|
16628
|
+
}
|
|
16629
|
+
break;
|
|
16630
|
+
case 3:
|
|
16631
|
+
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
16632
|
+
state = 1;
|
|
16633
|
+
}
|
|
16634
|
+
else {
|
|
16635
|
+
state = 3;
|
|
16636
|
+
}
|
|
16637
|
+
break;
|
|
16638
|
+
}
|
|
16639
|
+
}
|
|
16640
|
+
fileNameIndex = partStart;
|
|
16641
|
+
return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
|
|
16642
|
+
}
|
|
16643
|
+
ts.getNodeModulePathParts = getNodeModulePathParts;
|
|
16604
16644
|
})(ts || (ts = {}));
|
|
16605
16645
|
var ts;
|
|
16606
16646
|
(function (ts) {
|
|
@@ -18220,17 +18260,15 @@ var ts;
|
|
|
18220
18260
|
function updateConstructorTypeNode2(node, typeParameters, parameters, type) {
|
|
18221
18261
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
18222
18262
|
}
|
|
18223
|
-
function createTypeQueryNode(exprName
|
|
18263
|
+
function createTypeQueryNode(exprName) {
|
|
18224
18264
|
var node = createBaseNode(180);
|
|
18225
18265
|
node.exprName = exprName;
|
|
18226
|
-
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
18227
18266
|
node.transformFlags = 1;
|
|
18228
18267
|
return node;
|
|
18229
18268
|
}
|
|
18230
|
-
function updateTypeQueryNode(node, exprName
|
|
18269
|
+
function updateTypeQueryNode(node, exprName) {
|
|
18231
18270
|
return node.exprName !== exprName
|
|
18232
|
-
|
|
18233
|
-
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
18271
|
+
? update(createTypeQueryNode(exprName), node)
|
|
18234
18272
|
: node;
|
|
18235
18273
|
}
|
|
18236
18274
|
function createTypeLiteralNode(members) {
|
|
@@ -24064,8 +24102,7 @@ var ts;
|
|
|
24064
24102
|
visitNode(cbNode, node.parameterName) ||
|
|
24065
24103
|
visitNode(cbNode, node.type);
|
|
24066
24104
|
case 180:
|
|
24067
|
-
return visitNode(cbNode, node.exprName)
|
|
24068
|
-
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
24105
|
+
return visitNode(cbNode, node.exprName);
|
|
24069
24106
|
case 181:
|
|
24070
24107
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
24071
24108
|
case 182:
|
|
@@ -26146,9 +26183,7 @@ var ts;
|
|
|
26146
26183
|
function parseTypeQuery() {
|
|
26147
26184
|
var pos = getNodePos();
|
|
26148
26185
|
parseExpected(112);
|
|
26149
|
-
|
|
26150
|
-
var typeArguments = tryParseTypeArguments();
|
|
26151
|
-
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26186
|
+
return finishNode(factory.createTypeQueryNode(parseEntityName(true)), pos);
|
|
26152
26187
|
}
|
|
26153
26188
|
function parseTypeParameter() {
|
|
26154
26189
|
var pos = getNodePos();
|
|
@@ -26954,21 +26989,21 @@ var ts;
|
|
|
26954
26989
|
function parseInitializer() {
|
|
26955
26990
|
return parseOptional(63) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
26956
26991
|
}
|
|
26957
|
-
function parseAssignmentExpressionOrHigher() {
|
|
26992
|
+
function parseAssignmentExpressionOrHigher(parsingConditionalExpression) {
|
|
26958
26993
|
if (isYieldExpression()) {
|
|
26959
26994
|
return parseYieldExpression();
|
|
26960
26995
|
}
|
|
26961
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
26996
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(parsingConditionalExpression) || tryParseAsyncSimpleArrowFunctionExpression(parsingConditionalExpression);
|
|
26962
26997
|
if (arrowExpression) {
|
|
26963
26998
|
return arrowExpression;
|
|
26964
26999
|
}
|
|
26965
27000
|
var pos = getNodePos();
|
|
26966
27001
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
26967
27002
|
if (expr.kind === 79 && token() === 38) {
|
|
26968
|
-
return parseSimpleArrowFunctionExpression(pos, expr, undefined);
|
|
27003
|
+
return parseSimpleArrowFunctionExpression(pos, expr, undefined, parsingConditionalExpression);
|
|
26969
27004
|
}
|
|
26970
27005
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
26971
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
27006
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(parsingConditionalExpression), pos);
|
|
26972
27007
|
}
|
|
26973
27008
|
return parseConditionalExpressionRest(expr, pos);
|
|
26974
27009
|
}
|
|
@@ -26996,24 +27031,24 @@ var ts;
|
|
|
26996
27031
|
return finishNode(factory.createYieldExpression(undefined, undefined), pos);
|
|
26997
27032
|
}
|
|
26998
27033
|
}
|
|
26999
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
27034
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier, parsingConditionalExpression) {
|
|
27000
27035
|
ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
27001
27036
|
var parameter = factory.createParameterDeclaration(undefined, undefined, undefined, identifier, undefined, undefined, undefined);
|
|
27002
27037
|
finishNode(parameter, identifier.pos);
|
|
27003
27038
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
27004
27039
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27005
|
-
var body = parseArrowFunctionExpressionBody(!!asyncModifier);
|
|
27040
|
+
var body = parseArrowFunctionExpressionBody(!!asyncModifier, parsingConditionalExpression);
|
|
27006
27041
|
var node = factory.createArrowFunction(asyncModifier, undefined, parameters, undefined, equalsGreaterThanToken, body);
|
|
27007
27042
|
return addJSDocComment(finishNode(node, pos));
|
|
27008
27043
|
}
|
|
27009
|
-
function tryParseParenthesizedArrowFunctionExpression() {
|
|
27044
|
+
function tryParseParenthesizedArrowFunctionExpression(parsingConditionalExpression) {
|
|
27010
27045
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
27011
27046
|
if (triState === 0) {
|
|
27012
27047
|
return undefined;
|
|
27013
27048
|
}
|
|
27014
27049
|
return triState === 1 ?
|
|
27015
|
-
parseParenthesizedArrowFunctionExpression(true) :
|
|
27016
|
-
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
27050
|
+
parseParenthesizedArrowFunctionExpression(true, parsingConditionalExpression) :
|
|
27051
|
+
tryParse(function () { return parsePossibleParenthesizedArrowFunctionExpression(parsingConditionalExpression); });
|
|
27017
27052
|
}
|
|
27018
27053
|
function isParenthesizedArrowFunctionExpression() {
|
|
27019
27054
|
if (token() === 20 || token() === 29 || token() === 131) {
|
|
@@ -27107,24 +27142,24 @@ var ts;
|
|
|
27107
27142
|
return 2;
|
|
27108
27143
|
}
|
|
27109
27144
|
}
|
|
27110
|
-
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
27145
|
+
function parsePossibleParenthesizedArrowFunctionExpression(parsingConditionalExpression) {
|
|
27111
27146
|
var tokenPos = scanner.getTokenPos();
|
|
27112
27147
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
27113
27148
|
return undefined;
|
|
27114
27149
|
}
|
|
27115
|
-
var result = parseParenthesizedArrowFunctionExpression(false);
|
|
27150
|
+
var result = parseParenthesizedArrowFunctionExpression(false, parsingConditionalExpression);
|
|
27116
27151
|
if (!result) {
|
|
27117
27152
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
27118
27153
|
}
|
|
27119
27154
|
return result;
|
|
27120
27155
|
}
|
|
27121
|
-
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
27156
|
+
function tryParseAsyncSimpleArrowFunctionExpression(parsingConditionalExpression) {
|
|
27122
27157
|
if (token() === 131) {
|
|
27123
27158
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
|
|
27124
27159
|
var pos = getNodePos();
|
|
27125
27160
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
27126
27161
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27127
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
27162
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier, parsingConditionalExpression);
|
|
27128
27163
|
}
|
|
27129
27164
|
}
|
|
27130
27165
|
return undefined;
|
|
@@ -27142,7 +27177,7 @@ var ts;
|
|
|
27142
27177
|
}
|
|
27143
27178
|
return 0;
|
|
27144
27179
|
}
|
|
27145
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
27180
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity, parsingConditionalExpression) {
|
|
27146
27181
|
var pos = getNodePos();
|
|
27147
27182
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27148
27183
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -27161,6 +27196,10 @@ var ts;
|
|
|
27161
27196
|
return undefined;
|
|
27162
27197
|
}
|
|
27163
27198
|
}
|
|
27199
|
+
if (parsingConditionalExpression && token() === 58) {
|
|
27200
|
+
ts.Debug.assert(!allowAmbiguity);
|
|
27201
|
+
return undefined;
|
|
27202
|
+
}
|
|
27164
27203
|
var type = parseReturnType(58, false);
|
|
27165
27204
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27166
27205
|
return undefined;
|
|
@@ -27176,12 +27215,12 @@ var ts;
|
|
|
27176
27215
|
var lastToken = token();
|
|
27177
27216
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27178
27217
|
var body = (lastToken === 38 || lastToken === 18)
|
|
27179
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
27218
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier), parsingConditionalExpression)
|
|
27180
27219
|
: parseIdentifier();
|
|
27181
27220
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
27182
27221
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
27183
27222
|
}
|
|
27184
|
-
function parseArrowFunctionExpressionBody(isAsync) {
|
|
27223
|
+
function parseArrowFunctionExpressionBody(isAsync, parsingConditionalExpression) {
|
|
27185
27224
|
if (token() === 18) {
|
|
27186
27225
|
return parseFunctionBlock(isAsync ? 2 : 0);
|
|
27187
27226
|
}
|
|
@@ -27195,8 +27234,8 @@ var ts;
|
|
|
27195
27234
|
var savedTopLevel = topLevel;
|
|
27196
27235
|
topLevel = false;
|
|
27197
27236
|
var node = isAsync
|
|
27198
|
-
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
27199
|
-
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
27237
|
+
? doInAwaitContext(function () { return parseAssignmentExpressionOrHigher(parsingConditionalExpression); })
|
|
27238
|
+
: doOutsideOfAwaitContext(function () { return parseAssignmentExpressionOrHigher(parsingConditionalExpression); });
|
|
27200
27239
|
topLevel = savedTopLevel;
|
|
27201
27240
|
return node;
|
|
27202
27241
|
}
|
|
@@ -27206,8 +27245,8 @@ var ts;
|
|
|
27206
27245
|
return leftOperand;
|
|
27207
27246
|
}
|
|
27208
27247
|
var colonToken;
|
|
27209
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
27210
|
-
? parseAssignmentExpressionOrHigher()
|
|
27248
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function () { return parseAssignmentExpressionOrHigher(true); }), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
27249
|
+
? parseAssignmentExpressionOrHigher(true)
|
|
27211
27250
|
: createMissingNode(79, false, ts.Diagnostics._0_expected, ts.tokenToString(58))), pos);
|
|
27212
27251
|
}
|
|
27213
27252
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -27745,16 +27784,12 @@ var ts;
|
|
|
27745
27784
|
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27746
27785
|
continue;
|
|
27747
27786
|
}
|
|
27748
|
-
|
|
27749
|
-
|
|
27750
|
-
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
continue;
|
|
27755
|
-
}
|
|
27756
|
-
expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
27757
|
-
break;
|
|
27787
|
+
var argumentList = parseArgumentList();
|
|
27788
|
+
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27789
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27790
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27791
|
+
expression = finishNode(callExpr, pos);
|
|
27792
|
+
continue;
|
|
27758
27793
|
}
|
|
27759
27794
|
}
|
|
27760
27795
|
else if (token() === 20) {
|
|
@@ -27791,14 +27826,15 @@ var ts;
|
|
|
27791
27826
|
if (!parseExpected(31)) {
|
|
27792
27827
|
return undefined;
|
|
27793
27828
|
}
|
|
27794
|
-
return typeArguments && canFollowTypeArgumentsInExpression()
|
|
27829
|
+
return typeArguments && canFollowTypeArgumentsInExpression()
|
|
27830
|
+
? typeArguments
|
|
27831
|
+
: undefined;
|
|
27795
27832
|
}
|
|
27796
27833
|
function canFollowTypeArgumentsInExpression() {
|
|
27797
27834
|
switch (token()) {
|
|
27798
27835
|
case 20:
|
|
27799
27836
|
case 14:
|
|
27800
27837
|
case 15:
|
|
27801
|
-
case 27:
|
|
27802
27838
|
case 24:
|
|
27803
27839
|
case 21:
|
|
27804
27840
|
case 23:
|
|
@@ -27818,8 +27854,11 @@ var ts;
|
|
|
27818
27854
|
case 19:
|
|
27819
27855
|
case 1:
|
|
27820
27856
|
return true;
|
|
27857
|
+
case 27:
|
|
27858
|
+
case 18:
|
|
27859
|
+
default:
|
|
27860
|
+
return false;
|
|
27821
27861
|
}
|
|
27822
|
-
return false;
|
|
27823
27862
|
}
|
|
27824
27863
|
function parsePrimaryExpression() {
|
|
27825
27864
|
switch (token()) {
|
|
@@ -27983,12 +28022,17 @@ var ts;
|
|
|
27983
28022
|
return finishNode(factory.createMetaProperty(103, name), pos);
|
|
27984
28023
|
}
|
|
27985
28024
|
var expressionPos = getNodePos();
|
|
27986
|
-
var expression =
|
|
27987
|
-
var typeArguments
|
|
27988
|
-
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
28025
|
+
var expression = parsePrimaryExpression();
|
|
28026
|
+
var typeArguments;
|
|
28027
|
+
while (true) {
|
|
28028
|
+
expression = parseMemberExpressionRest(expressionPos, expression, false);
|
|
28029
|
+
typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
28030
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
28031
|
+
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
28032
|
+
expression = parseTaggedTemplateRest(expressionPos, expression, undefined, typeArguments);
|
|
28033
|
+
typeArguments = undefined;
|
|
28034
|
+
}
|
|
28035
|
+
break;
|
|
27992
28036
|
}
|
|
27993
28037
|
var argumentsArray;
|
|
27994
28038
|
if (token() === 20) {
|
|
@@ -28962,9 +29006,6 @@ var ts;
|
|
|
28962
29006
|
function parseExpressionWithTypeArguments() {
|
|
28963
29007
|
var pos = getNodePos();
|
|
28964
29008
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
28965
|
-
if (expression.kind === 227) {
|
|
28966
|
-
return expression;
|
|
28967
|
-
}
|
|
28968
29009
|
var typeArguments = tryParseTypeArguments();
|
|
28969
29010
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
28970
29011
|
}
|
|
@@ -39975,24 +40016,19 @@ var ts;
|
|
|
39975
40016
|
error(errorLocation, ts.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), ts.declarationNameToString(errorLocation));
|
|
39976
40017
|
}
|
|
39977
40018
|
}
|
|
39978
|
-
if (result && errorLocation && meaning & 111551 && result.flags & 2097152) {
|
|
39979
|
-
|
|
40019
|
+
if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
|
|
40020
|
+
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
|
|
40021
|
+
if (typeOnlyDeclaration) {
|
|
40022
|
+
var message = typeOnlyDeclaration.kind === 274
|
|
40023
|
+
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
40024
|
+
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
40025
|
+
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
40026
|
+
addTypeOnlyDeclarationRelatedInfo(error(errorLocation, message, unescapedName), typeOnlyDeclaration, unescapedName);
|
|
40027
|
+
}
|
|
39980
40028
|
}
|
|
39981
40029
|
}
|
|
39982
40030
|
return result;
|
|
39983
40031
|
}
|
|
39984
|
-
function checkSymbolUsageInExpressionContext(symbol, name, useSite) {
|
|
39985
|
-
if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
|
|
39986
|
-
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
|
|
39987
|
-
if (typeOnlyDeclaration) {
|
|
39988
|
-
var message = typeOnlyDeclaration.kind === 274
|
|
39989
|
-
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
39990
|
-
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
39991
|
-
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
39992
|
-
addTypeOnlyDeclarationRelatedInfo(error(useSite, message, unescapedName), typeOnlyDeclaration, unescapedName);
|
|
39993
|
-
}
|
|
39994
|
-
}
|
|
39995
|
-
}
|
|
39996
40032
|
function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
|
|
39997
40033
|
if (!typeOnlyDeclaration)
|
|
39998
40034
|
return diagnostic;
|
|
@@ -41820,7 +41856,7 @@ var ts;
|
|
|
41820
41856
|
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
41821
41857
|
var meaning;
|
|
41822
41858
|
if (entityName.parent.kind === 180 ||
|
|
41823
|
-
|
|
41859
|
+
ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||
|
|
41824
41860
|
entityName.parent.kind === 161) {
|
|
41825
41861
|
meaning = 111551 | 1048576;
|
|
41826
41862
|
}
|
|
@@ -41923,7 +41959,7 @@ var ts;
|
|
|
41923
41959
|
return flags & 814775659;
|
|
41924
41960
|
}
|
|
41925
41961
|
function isClassInstanceSide(type) {
|
|
41926
|
-
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) &
|
|
41962
|
+
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) & 16777216)));
|
|
41927
41963
|
}
|
|
41928
41964
|
function createNodeBuilder() {
|
|
41929
41965
|
return {
|
|
@@ -45319,7 +45355,7 @@ var ts;
|
|
|
45319
45355
|
var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
45320
45356
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192);
|
|
45321
45357
|
if (result.symbol && result.symbol.flags & 32 && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
45322
|
-
result.objectFlags |=
|
|
45358
|
+
result.objectFlags |= 16777216;
|
|
45323
45359
|
}
|
|
45324
45360
|
return result;
|
|
45325
45361
|
}
|
|
@@ -47063,81 +47099,81 @@ var ts;
|
|
|
47063
47099
|
return ts.append(indexInfos, newInfo);
|
|
47064
47100
|
}
|
|
47065
47101
|
function resolveAnonymousTypeMembers(type) {
|
|
47102
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
47066
47103
|
if (type.target) {
|
|
47067
47104
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47068
|
-
var
|
|
47105
|
+
var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false);
|
|
47069
47106
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0), type.mapper);
|
|
47070
47107
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1), type.mapper);
|
|
47071
|
-
var
|
|
47072
|
-
setStructuredTypeMembers(type,
|
|
47073
|
-
return;
|
|
47108
|
+
var indexInfos = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
47109
|
+
setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
|
|
47074
47110
|
}
|
|
47075
|
-
|
|
47076
|
-
if (symbol.flags & 2048) {
|
|
47111
|
+
else if (symbol.flags & 2048) {
|
|
47077
47112
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47078
|
-
var
|
|
47079
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
47080
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
47081
|
-
var
|
|
47082
|
-
setStructuredTypeMembers(type,
|
|
47083
|
-
return;
|
|
47084
|
-
}
|
|
47085
|
-
var members = emptySymbols;
|
|
47086
|
-
var indexInfos;
|
|
47087
|
-
if (symbol.exports) {
|
|
47088
|
-
members = getExportsOfSymbol(symbol);
|
|
47089
|
-
if (symbol === globalThisSymbol) {
|
|
47090
|
-
var varsOnly_1 = new ts.Map();
|
|
47091
|
-
members.forEach(function (p) {
|
|
47092
|
-
if (!(p.flags & 418)) {
|
|
47093
|
-
varsOnly_1.set(p.escapedName, p);
|
|
47094
|
-
}
|
|
47095
|
-
});
|
|
47096
|
-
members = varsOnly_1;
|
|
47097
|
-
}
|
|
47113
|
+
var members = getMembersOfSymbol(symbol);
|
|
47114
|
+
var callSignatures = getSignaturesOfSymbol(members.get("__call"));
|
|
47115
|
+
var constructSignatures = getSignaturesOfSymbol(members.get("__new"));
|
|
47116
|
+
var indexInfos = getIndexInfosOfSymbol(symbol);
|
|
47117
|
+
setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos);
|
|
47098
47118
|
}
|
|
47099
|
-
|
|
47100
|
-
|
|
47101
|
-
|
|
47102
|
-
|
|
47103
|
-
|
|
47104
|
-
|
|
47105
|
-
|
|
47106
|
-
|
|
47119
|
+
else {
|
|
47120
|
+
var members = emptySymbols;
|
|
47121
|
+
var indexInfos = void 0;
|
|
47122
|
+
if (symbol.exports) {
|
|
47123
|
+
members = getExportsOfSymbol(symbol);
|
|
47124
|
+
if (symbol === globalThisSymbol) {
|
|
47125
|
+
var varsOnly_1 = new ts.Map();
|
|
47126
|
+
members.forEach(function (p) {
|
|
47127
|
+
if (!(p.flags & 418)) {
|
|
47128
|
+
varsOnly_1.set(p.escapedName, p);
|
|
47129
|
+
}
|
|
47130
|
+
});
|
|
47131
|
+
members = varsOnly_1;
|
|
47132
|
+
}
|
|
47107
47133
|
}
|
|
47108
|
-
|
|
47109
|
-
|
|
47134
|
+
var baseConstructorIndexInfo = void 0;
|
|
47135
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47136
|
+
if (symbol.flags & 32) {
|
|
47137
|
+
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47138
|
+
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
47139
|
+
if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) {
|
|
47140
|
+
members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
|
47141
|
+
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
|
47142
|
+
}
|
|
47143
|
+
else if (baseConstructorType === anyType) {
|
|
47144
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47145
|
+
}
|
|
47110
47146
|
}
|
|
47111
|
-
|
|
47112
|
-
|
|
47113
|
-
|
|
47114
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47115
|
-
}
|
|
47116
|
-
else {
|
|
47117
|
-
if (baseConstructorIndexInfo) {
|
|
47118
|
-
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
47147
|
+
var indexSymbol = getIndexSymbolFromSymbolTable(members);
|
|
47148
|
+
if (indexSymbol) {
|
|
47149
|
+
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47119
47150
|
}
|
|
47120
|
-
|
|
47121
|
-
|
|
47122
|
-
|
|
47151
|
+
else {
|
|
47152
|
+
if (baseConstructorIndexInfo) {
|
|
47153
|
+
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
47154
|
+
}
|
|
47155
|
+
if (symbol.flags & 384 && (getDeclaredTypeOfSymbol(symbol).flags & 32 ||
|
|
47156
|
+
ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296); }))) {
|
|
47157
|
+
indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
|
|
47158
|
+
}
|
|
47123
47159
|
}
|
|
47124
|
-
|
|
47125
|
-
|
|
47126
|
-
|
|
47127
|
-
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
47128
|
-
}
|
|
47129
|
-
if (symbol.flags & 32) {
|
|
47130
|
-
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47131
|
-
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor")) : ts.emptyArray;
|
|
47132
|
-
if (symbol.flags & 16) {
|
|
47133
|
-
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
47134
|
-
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, undefined, sig.minArgumentCount, sig.flags & 39) :
|
|
47135
|
-
undefined; }));
|
|
47160
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
|
|
47161
|
+
if (symbol.flags & (16 | 8192)) {
|
|
47162
|
+
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
47136
47163
|
}
|
|
47137
|
-
if (
|
|
47138
|
-
|
|
47164
|
+
if (symbol.flags & 32) {
|
|
47165
|
+
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47166
|
+
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor")) : ts.emptyArray;
|
|
47167
|
+
if (symbol.flags & 16) {
|
|
47168
|
+
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
47169
|
+
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, undefined, sig.minArgumentCount, sig.flags & 39) :
|
|
47170
|
+
undefined; }));
|
|
47171
|
+
}
|
|
47172
|
+
if (!constructSignatures.length) {
|
|
47173
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
47174
|
+
}
|
|
47175
|
+
type.constructSignatures = constructSignatures;
|
|
47139
47176
|
}
|
|
47140
|
-
type.constructSignatures = constructSignatures;
|
|
47141
47177
|
}
|
|
47142
47178
|
}
|
|
47143
47179
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -47988,8 +48024,8 @@ var ts;
|
|
|
47988
48024
|
var stringIndexInfo;
|
|
47989
48025
|
var applicableInfo;
|
|
47990
48026
|
var applicableInfos;
|
|
47991
|
-
for (var _i = 0,
|
|
47992
|
-
var info =
|
|
48027
|
+
for (var _i = 0, indexInfos_1 = indexInfos; _i < indexInfos_1.length; _i++) {
|
|
48028
|
+
var info = indexInfos_1[_i];
|
|
47993
48029
|
if (info.keyType === stringType) {
|
|
47994
48030
|
stringIndexInfo = info;
|
|
47995
48031
|
}
|
|
@@ -48499,14 +48535,14 @@ var ts;
|
|
|
48499
48535
|
}
|
|
48500
48536
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
48501
48537
|
if (indexSymbol.declarations) {
|
|
48502
|
-
var
|
|
48538
|
+
var indexInfos_2 = [];
|
|
48503
48539
|
var _loop_14 = function (declaration) {
|
|
48504
48540
|
if (declaration.parameters.length === 1) {
|
|
48505
48541
|
var parameter = declaration.parameters[0];
|
|
48506
48542
|
if (parameter.type) {
|
|
48507
48543
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
48508
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
48509
|
-
|
|
48544
|
+
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_2, keyType)) {
|
|
48545
|
+
indexInfos_2.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64), declaration));
|
|
48510
48546
|
}
|
|
48511
48547
|
});
|
|
48512
48548
|
}
|
|
@@ -48516,7 +48552,7 @@ var ts;
|
|
|
48516
48552
|
var declaration = _a[_i];
|
|
48517
48553
|
_loop_14(declaration);
|
|
48518
48554
|
}
|
|
48519
|
-
return
|
|
48555
|
+
return indexInfos_2;
|
|
48520
48556
|
}
|
|
48521
48557
|
return ts.emptyArray;
|
|
48522
48558
|
}
|
|
@@ -49001,7 +49037,7 @@ var ts;
|
|
|
49001
49037
|
function getTypeFromTypeQueryNode(node) {
|
|
49002
49038
|
var links = getNodeLinks(node);
|
|
49003
49039
|
if (!links.resolvedType) {
|
|
49004
|
-
var type =
|
|
49040
|
+
var type = ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
49005
49041
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
49006
49042
|
}
|
|
49007
49043
|
return links.resolvedType;
|
|
@@ -51427,9 +51463,7 @@ var ts;
|
|
|
51427
51463
|
return result;
|
|
51428
51464
|
}
|
|
51429
51465
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
51430
|
-
var declaration = type.objectFlags & 4 ? type.node :
|
|
51431
|
-
type.objectFlags & 16777216 ? type.node :
|
|
51432
|
-
type.symbol.declarations[0];
|
|
51466
|
+
var declaration = type.objectFlags & 4 ? type.node : type.symbol.declarations[0];
|
|
51433
51467
|
var links = getNodeLinks(declaration);
|
|
51434
51468
|
var target = type.objectFlags & 4 ? links.resolvedType :
|
|
51435
51469
|
type.objectFlags & 64 ? type.target : type;
|
|
@@ -51441,8 +51475,8 @@ var ts;
|
|
|
51441
51475
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
51442
51476
|
}
|
|
51443
51477
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
51444
|
-
var allDeclarations_1 = type.objectFlags &
|
|
51445
|
-
typeParameters = (target.objectFlags &
|
|
51478
|
+
var allDeclarations_1 = type.objectFlags & 4 ? [declaration] : type.symbol.declarations;
|
|
51479
|
+
typeParameters = (target.objectFlags & 4 || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ?
|
|
51446
51480
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
51447
51481
|
typeParameters;
|
|
51448
51482
|
links.outerTypeParameters = typeParameters;
|
|
@@ -51591,9 +51625,6 @@ var ts;
|
|
|
51591
51625
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
51592
51626
|
freshTypeParameter.mapper = mapper;
|
|
51593
51627
|
}
|
|
51594
|
-
if (type.objectFlags & 16777216) {
|
|
51595
|
-
result.node = type.node;
|
|
51596
|
-
}
|
|
51597
51628
|
result.target = type;
|
|
51598
51629
|
result.mapper = mapper;
|
|
51599
51630
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -54327,8 +54358,8 @@ var ts;
|
|
|
54327
54358
|
var indexInfos = getIndexInfosOfType(target);
|
|
54328
54359
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
54329
54360
|
var result = -1;
|
|
54330
|
-
for (var _i = 0,
|
|
54331
|
-
var targetInfo =
|
|
54361
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
54362
|
+
var targetInfo = indexInfos_3[_i];
|
|
54332
54363
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
|
|
54333
54364
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
|
|
54334
54365
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -54837,10 +54868,10 @@ var ts;
|
|
|
54837
54868
|
if (!(ts.getObjectFlags(type) & 4) || !(ts.getObjectFlags(type.target) & 3)) {
|
|
54838
54869
|
return undefined;
|
|
54839
54870
|
}
|
|
54840
|
-
if (ts.getObjectFlags(type) &
|
|
54841
|
-
return ts.getObjectFlags(type) &
|
|
54871
|
+
if (ts.getObjectFlags(type) & 33554432) {
|
|
54872
|
+
return ts.getObjectFlags(type) & 67108864 ? type.cachedEquivalentBaseType : undefined;
|
|
54842
54873
|
}
|
|
54843
|
-
type.objectFlags |=
|
|
54874
|
+
type.objectFlags |= 33554432;
|
|
54844
54875
|
var target = type.target;
|
|
54845
54876
|
if (ts.getObjectFlags(target) & 1) {
|
|
54846
54877
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -54859,7 +54890,7 @@ var ts;
|
|
|
54859
54890
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
54860
54891
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
54861
54892
|
}
|
|
54862
|
-
type.objectFlags |=
|
|
54893
|
+
type.objectFlags |= 67108864;
|
|
54863
54894
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
54864
54895
|
}
|
|
54865
54896
|
function isEmptyLiteralType(type) {
|
|
@@ -55456,7 +55487,7 @@ var ts;
|
|
|
55456
55487
|
var result = !!(type.flags & 465829888 ||
|
|
55457
55488
|
type.flags & 524288 && !isNonGenericTopLevelType(type) && (objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
55458
55489
|
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ||
|
|
55459
|
-
objectFlags & (32 | 1024 | 8388608
|
|
55490
|
+
objectFlags & (32 | 1024 | 8388608)) ||
|
|
55460
55491
|
type.flags & 3145728 && !(type.flags & 1024) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
55461
55492
|
if (type.flags & 3899393) {
|
|
55462
55493
|
type.objectFlags |= 1048576 | (result ? 2097152 : 0);
|
|
@@ -56223,8 +56254,8 @@ var ts;
|
|
|
56223
56254
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32) ? 8 : 0;
|
|
56224
56255
|
var indexInfos = getIndexInfosOfType(target);
|
|
56225
56256
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
56226
|
-
for (var _i = 0,
|
|
56227
|
-
var targetInfo =
|
|
56257
|
+
for (var _i = 0, indexInfos_4 = indexInfos; _i < indexInfos_4.length; _i++) {
|
|
56258
|
+
var targetInfo = indexInfos_4[_i];
|
|
56228
56259
|
var propTypes = [];
|
|
56229
56260
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
56230
56261
|
var prop = _b[_a];
|
|
@@ -56244,8 +56275,8 @@ var ts;
|
|
|
56244
56275
|
}
|
|
56245
56276
|
}
|
|
56246
56277
|
}
|
|
56247
|
-
for (var _e = 0,
|
|
56248
|
-
var targetInfo =
|
|
56278
|
+
for (var _e = 0, indexInfos_5 = indexInfos; _e < indexInfos_5.length; _e++) {
|
|
56279
|
+
var targetInfo = indexInfos_5[_e];
|
|
56249
56280
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
56250
56281
|
if (sourceInfo) {
|
|
56251
56282
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -63213,66 +63244,6 @@ var ts;
|
|
|
63213
63244
|
return node.flags & 32 ? checkNonNullChain(node) :
|
|
63214
63245
|
getNonNullableType(checkExpression(node.expression));
|
|
63215
63246
|
}
|
|
63216
|
-
function checkExpressionWithTypeArguments(node) {
|
|
63217
|
-
checkGrammarExpressionWithTypeArguments(node);
|
|
63218
|
-
var exprType = node.kind === 227 ? checkExpression(node.expression) :
|
|
63219
|
-
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
63220
|
-
checkExpression(node.exprName);
|
|
63221
|
-
var typeArguments = node.typeArguments;
|
|
63222
|
-
if (!ts.some(typeArguments)) {
|
|
63223
|
-
return exprType;
|
|
63224
|
-
}
|
|
63225
|
-
var funcType = getApparentType(exprType);
|
|
63226
|
-
if (funcType === silentNeverType || isErrorType(funcType)) {
|
|
63227
|
-
return funcType;
|
|
63228
|
-
}
|
|
63229
|
-
var hasSomeApplicableSignature = false;
|
|
63230
|
-
var nonApplicableType;
|
|
63231
|
-
var hasSignatures;
|
|
63232
|
-
var hasApplicableSignature;
|
|
63233
|
-
var result = mapType(funcType, getInstantiatedType);
|
|
63234
|
-
var errorType = hasSomeApplicableSignature ? nonApplicableType : funcType;
|
|
63235
|
-
if (errorType) {
|
|
63236
|
-
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
63237
|
-
}
|
|
63238
|
-
return result;
|
|
63239
|
-
function getInstantiatedType(type) {
|
|
63240
|
-
hasSignatures = false;
|
|
63241
|
-
hasApplicableSignature = false;
|
|
63242
|
-
var result = getInstantiatedTypeWorker(type);
|
|
63243
|
-
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
63244
|
-
if (hasSignatures && !hasApplicableSignature) {
|
|
63245
|
-
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
63246
|
-
}
|
|
63247
|
-
return result;
|
|
63248
|
-
}
|
|
63249
|
-
function getInstantiatedTypeWorker(type) {
|
|
63250
|
-
if (type.flags & 524288) {
|
|
63251
|
-
var resolved = resolveStructuredTypeMembers(type);
|
|
63252
|
-
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
63253
|
-
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
63254
|
-
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
63255
|
-
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
63256
|
-
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
63257
|
-
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
63258
|
-
result_11.objectFlags |= 16777216;
|
|
63259
|
-
result_11.node = node;
|
|
63260
|
-
return result_11;
|
|
63261
|
-
}
|
|
63262
|
-
}
|
|
63263
|
-
else if (type.flags & 2097152) {
|
|
63264
|
-
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypeWorker));
|
|
63265
|
-
}
|
|
63266
|
-
return type;
|
|
63267
|
-
}
|
|
63268
|
-
function getInstantiatedSignatures(signatures) {
|
|
63269
|
-
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
63270
|
-
return ts.sameMap(applicableSignatures, function (sig) {
|
|
63271
|
-
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, true);
|
|
63272
|
-
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
63273
|
-
});
|
|
63274
|
-
}
|
|
63275
|
-
}
|
|
63276
63247
|
function checkMetaProperty(node) {
|
|
63277
63248
|
checkGrammarMetaProperty(node);
|
|
63278
63249
|
if (node.keywordToken === 103) {
|
|
@@ -65503,8 +65474,6 @@ var ts;
|
|
|
65503
65474
|
return checkAssertion(node);
|
|
65504
65475
|
case 229:
|
|
65505
65476
|
return checkNonNullAssertion(node);
|
|
65506
|
-
case 227:
|
|
65507
|
-
return checkExpressionWithTypeArguments(node);
|
|
65508
65477
|
case 230:
|
|
65509
65478
|
return checkMetaProperty(node);
|
|
65510
65479
|
case 214:
|
|
@@ -66589,12 +66558,12 @@ var ts;
|
|
|
66589
66558
|
case 264:
|
|
66590
66559
|
case 267:
|
|
66591
66560
|
case 266:
|
|
66592
|
-
var
|
|
66561
|
+
var result_11 = 0;
|
|
66593
66562
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
66594
66563
|
ts.forEach(target.declarations, function (d) {
|
|
66595
|
-
|
|
66564
|
+
result_11 |= getDeclarationSpaces(d);
|
|
66596
66565
|
});
|
|
66597
|
-
return
|
|
66566
|
+
return result_11;
|
|
66598
66567
|
case 253:
|
|
66599
66568
|
case 202:
|
|
66600
66569
|
case 255:
|
|
@@ -68614,8 +68583,8 @@ var ts;
|
|
|
68614
68583
|
}
|
|
68615
68584
|
}
|
|
68616
68585
|
if (indexInfos.length > 1) {
|
|
68617
|
-
for (var _d = 0,
|
|
68618
|
-
var info =
|
|
68586
|
+
for (var _d = 0, indexInfos_6 = indexInfos; _d < indexInfos_6.length; _d++) {
|
|
68587
|
+
var info = indexInfos_6[_d];
|
|
68619
68588
|
checkIndexConstraintForIndexSignature(type, info);
|
|
68620
68589
|
}
|
|
68621
68590
|
}
|
|
@@ -68638,8 +68607,8 @@ var ts;
|
|
|
68638
68607
|
error(errorNode, ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
|
|
68639
68608
|
}
|
|
68640
68609
|
};
|
|
68641
|
-
for (var _i = 0,
|
|
68642
|
-
var info =
|
|
68610
|
+
for (var _i = 0, indexInfos_7 = indexInfos; _i < indexInfos_7.length; _i++) {
|
|
68611
|
+
var info = indexInfos_7[_i];
|
|
68643
68612
|
_loop_27(info);
|
|
68644
68613
|
}
|
|
68645
68614
|
}
|
|
@@ -68658,8 +68627,8 @@ var ts;
|
|
|
68658
68627
|
error(errorNode, ts.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
|
|
68659
68628
|
}
|
|
68660
68629
|
};
|
|
68661
|
-
for (var _i = 0,
|
|
68662
|
-
var info =
|
|
68630
|
+
for (var _i = 0, indexInfos_8 = indexInfos; _i < indexInfos_8.length; _i++) {
|
|
68631
|
+
var info = indexInfos_8[_i];
|
|
68663
68632
|
_loop_28(info);
|
|
68664
68633
|
}
|
|
68665
68634
|
}
|
|
@@ -73717,7 +73686,7 @@ var ts;
|
|
|
73717
73686
|
return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
73718
73687
|
case 180:
|
|
73719
73688
|
ts.Debug.type(node);
|
|
73720
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)
|
|
73689
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
73721
73690
|
case 181:
|
|
73722
73691
|
ts.Debug.type(node);
|
|
73723
73692
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -75936,8 +75905,8 @@ var ts;
|
|
|
75936
75905
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
75937
75906
|
var members = getDecoratedClassElements(node, isStatic);
|
|
75938
75907
|
var expressions;
|
|
75939
|
-
for (var _i = 0,
|
|
75940
|
-
var member =
|
|
75908
|
+
for (var _i = 0, members_6 = members; _i < members_6.length; _i++) {
|
|
75909
|
+
var member = members_6[_i];
|
|
75941
75910
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
75942
75911
|
if (expression) {
|
|
75943
75912
|
if (!expressions) {
|
|
@@ -79957,8 +79926,8 @@ var ts;
|
|
|
79957
79926
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
79958
79927
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79959
79928
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
79960
|
-
var
|
|
79961
|
-
return
|
|
79929
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
79930
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
79962
79931
|
}
|
|
79963
79932
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
79964
79933
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -89809,8 +89778,6 @@ var ts;
|
|
|
89809
89778
|
return emitAsExpression(node);
|
|
89810
89779
|
case 229:
|
|
89811
89780
|
return emitNonNullExpression(node);
|
|
89812
|
-
case 227:
|
|
89813
|
-
return emitExpressionWithTypeArguments(node);
|
|
89814
89781
|
case 230:
|
|
89815
89782
|
return emitMetaProperty(node);
|
|
89816
89783
|
case 231:
|
|
@@ -90204,7 +90171,6 @@ var ts;
|
|
|
90204
90171
|
writeKeyword("typeof");
|
|
90205
90172
|
writeSpace();
|
|
90206
90173
|
emit(node.exprName);
|
|
90207
|
-
emitTypeArguments(node, node.typeArguments);
|
|
90208
90174
|
}
|
|
90209
90175
|
function emitTypeLiteral(node) {
|
|
90210
90176
|
writePunctuation("{");
|
|
@@ -94667,15 +94633,15 @@ var ts;
|
|
|
94667
94633
|
}
|
|
94668
94634
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
94669
94635
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
94670
|
-
var
|
|
94636
|
+
var result_13 = [];
|
|
94671
94637
|
var i = 0;
|
|
94672
94638
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
94673
94639
|
var moduleName = moduleNames_1[_i];
|
|
94674
94640
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
94675
94641
|
i++;
|
|
94676
|
-
|
|
94642
|
+
result_13.push(resolvedModule);
|
|
94677
94643
|
}
|
|
94678
|
-
return
|
|
94644
|
+
return result_13;
|
|
94679
94645
|
}
|
|
94680
94646
|
var unknownModuleNames;
|
|
94681
94647
|
var result;
|
|
@@ -99038,9 +99004,9 @@ var ts;
|
|
|
99038
99004
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
99039
99005
|
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
99040
99006
|
if (!preferSymlinks) {
|
|
99041
|
-
var
|
|
99042
|
-
if (
|
|
99043
|
-
return
|
|
99007
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
99008
|
+
if (result_14)
|
|
99009
|
+
return result_14;
|
|
99044
99010
|
}
|
|
99045
99011
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
99046
99012
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -99059,10 +99025,10 @@ var ts;
|
|
|
99059
99025
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
99060
99026
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
99061
99027
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
99062
|
-
var
|
|
99028
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
99063
99029
|
shouldFilterIgnoredPaths = true;
|
|
99064
|
-
if (
|
|
99065
|
-
return
|
|
99030
|
+
if (result_15)
|
|
99031
|
+
return result_15;
|
|
99066
99032
|
}
|
|
99067
99033
|
});
|
|
99068
99034
|
});
|
|
@@ -99268,7 +99234,7 @@ var ts;
|
|
|
99268
99234
|
if (!host.fileExists || !host.readFile) {
|
|
99269
99235
|
return undefined;
|
|
99270
99236
|
}
|
|
99271
|
-
var parts = getNodeModulePathParts(path);
|
|
99237
|
+
var parts = ts.getNodeModulePathParts(path);
|
|
99272
99238
|
if (!parts) {
|
|
99273
99239
|
return undefined;
|
|
99274
99240
|
}
|
|
@@ -99375,48 +99341,6 @@ var ts;
|
|
|
99375
99341
|
}
|
|
99376
99342
|
}
|
|
99377
99343
|
}
|
|
99378
|
-
function getNodeModulePathParts(fullPath) {
|
|
99379
|
-
var topLevelNodeModulesIndex = 0;
|
|
99380
|
-
var topLevelPackageNameIndex = 0;
|
|
99381
|
-
var packageRootIndex = 0;
|
|
99382
|
-
var fileNameIndex = 0;
|
|
99383
|
-
var partStart = 0;
|
|
99384
|
-
var partEnd = 0;
|
|
99385
|
-
var state = 0;
|
|
99386
|
-
while (partEnd >= 0) {
|
|
99387
|
-
partStart = partEnd;
|
|
99388
|
-
partEnd = fullPath.indexOf("/", partStart + 1);
|
|
99389
|
-
switch (state) {
|
|
99390
|
-
case 0:
|
|
99391
|
-
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
99392
|
-
topLevelNodeModulesIndex = partStart;
|
|
99393
|
-
topLevelPackageNameIndex = partEnd;
|
|
99394
|
-
state = 1;
|
|
99395
|
-
}
|
|
99396
|
-
break;
|
|
99397
|
-
case 1:
|
|
99398
|
-
case 2:
|
|
99399
|
-
if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
|
|
99400
|
-
state = 2;
|
|
99401
|
-
}
|
|
99402
|
-
else {
|
|
99403
|
-
packageRootIndex = partEnd;
|
|
99404
|
-
state = 3;
|
|
99405
|
-
}
|
|
99406
|
-
break;
|
|
99407
|
-
case 3:
|
|
99408
|
-
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
99409
|
-
state = 1;
|
|
99410
|
-
}
|
|
99411
|
-
else {
|
|
99412
|
-
state = 3;
|
|
99413
|
-
}
|
|
99414
|
-
break;
|
|
99415
|
-
}
|
|
99416
|
-
}
|
|
99417
|
-
fileNameIndex = partStart;
|
|
99418
|
-
return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
|
|
99419
|
-
}
|
|
99420
99344
|
function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
99421
99345
|
return ts.firstDefined(rootDirs, function (rootDir) {
|
|
99422
99346
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|