@typescript-deploys/pr-build 5.4.0-pr-55774-37 → 5.4.0-pr-56429-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +31 -34
- package/lib/tsserver.js +48 -44
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +48 -44
- package/lib/typingsInstaller.js +6 -5
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231116`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -6682,6 +6682,7 @@ var Diagnostics = {
|
|
|
6682
6682
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6683
6683
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6684
6684
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6685
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6685
6686
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6686
6687
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
|
|
6687
6688
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
|
|
@@ -10976,7 +10977,7 @@ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
|
|
|
10976
10977
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */;
|
|
10977
10978
|
}
|
|
10978
10979
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
10979
|
-
return isCallLikeExpression(node) ||
|
|
10980
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
10980
10981
|
}
|
|
10981
10982
|
function isCallLikeExpression(node) {
|
|
10982
10983
|
switch (node.kind) {
|
|
@@ -18838,10 +18839,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18838
18839
|
return update(updated, original);
|
|
18839
18840
|
}
|
|
18840
18841
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
18841
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
18842
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
18843
18842
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
18844
|
-
node.text =
|
|
18843
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
18845
18844
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
18846
18845
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
18847
18846
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -43707,7 +43706,7 @@ function createTypeChecker(host) {
|
|
|
43707
43706
|
const nodeLinks2 = getNodeLinks(node);
|
|
43708
43707
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
43709
43708
|
nodeLinks2.resolvedSignature = void 0;
|
|
43710
|
-
if (
|
|
43709
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
43711
43710
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
43712
43711
|
const type = symbolLinks2.type;
|
|
43713
43712
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -48269,6 +48268,8 @@ function createTypeChecker(host) {
|
|
|
48269
48268
|
context.symbolDepth.set(id, depth + 1);
|
|
48270
48269
|
}
|
|
48271
48270
|
context.visitedTypes.add(typeId);
|
|
48271
|
+
const prevTrackedSymbols = context.trackedSymbols;
|
|
48272
|
+
context.trackedSymbols = void 0;
|
|
48272
48273
|
const startLength = context.approximateLength;
|
|
48273
48274
|
const result = transform(type2);
|
|
48274
48275
|
const addedLength = context.approximateLength - startLength;
|
|
@@ -48284,6 +48285,7 @@ function createTypeChecker(host) {
|
|
|
48284
48285
|
if (id) {
|
|
48285
48286
|
context.symbolDepth.set(id, depth);
|
|
48286
48287
|
}
|
|
48288
|
+
context.trackedSymbols = prevTrackedSymbols;
|
|
48287
48289
|
return result;
|
|
48288
48290
|
function deepCloneOrReuseNode(node) {
|
|
48289
48291
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
@@ -49535,7 +49537,7 @@ function createTypeChecker(host) {
|
|
|
49535
49537
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
49536
49538
|
}
|
|
49537
49539
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
49538
|
-
return factory.createComputedPropertyName(factory.
|
|
49540
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
49539
49541
|
}
|
|
49540
49542
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
49541
49543
|
}
|
|
@@ -52608,7 +52610,7 @@ function createTypeChecker(host) {
|
|
|
52608
52610
|
} else if (getter && noImplicitAny) {
|
|
52609
52611
|
error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
52610
52612
|
}
|
|
52611
|
-
type =
|
|
52613
|
+
type = errorType;
|
|
52612
52614
|
}
|
|
52613
52615
|
links.type = type;
|
|
52614
52616
|
}
|
|
@@ -52626,7 +52628,7 @@ function createTypeChecker(host) {
|
|
|
52626
52628
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
52627
52629
|
error(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
52628
52630
|
}
|
|
52629
|
-
writeType =
|
|
52631
|
+
writeType = errorType;
|
|
52630
52632
|
}
|
|
52631
52633
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
52632
52634
|
}
|
|
@@ -52707,8 +52709,7 @@ function createTypeChecker(host) {
|
|
|
52707
52709
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
52708
52710
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
52709
52711
|
if (!popTypeResolution()) {
|
|
52710
|
-
reportCircularityError(exportSymbol ?? symbol);
|
|
52711
|
-
return links.type = errorType;
|
|
52712
|
+
return links.type = reportCircularityError(exportSymbol ?? symbol);
|
|
52712
52713
|
}
|
|
52713
52714
|
}
|
|
52714
52715
|
return links.type;
|
|
@@ -52737,7 +52738,7 @@ function createTypeChecker(host) {
|
|
|
52737
52738
|
error(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
52738
52739
|
}
|
|
52739
52740
|
}
|
|
52740
|
-
return
|
|
52741
|
+
return errorType;
|
|
52741
52742
|
}
|
|
52742
52743
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
52743
52744
|
const links = getSymbolLinks(symbol);
|
|
@@ -54238,14 +54239,6 @@ function createTypeChecker(host) {
|
|
|
54238
54239
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
54239
54240
|
}
|
|
54240
54241
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
54241
|
-
if (isTupleType(type)) {
|
|
54242
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
54243
|
-
return;
|
|
54244
|
-
}
|
|
54245
|
-
if (isArrayType(type)) {
|
|
54246
|
-
cb(numberType);
|
|
54247
|
-
return;
|
|
54248
|
-
}
|
|
54249
54242
|
for (const prop of getPropertiesOfType(type)) {
|
|
54250
54243
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
54251
54244
|
}
|
|
@@ -55506,7 +55499,7 @@ function createTypeChecker(host) {
|
|
|
55506
55499
|
}
|
|
55507
55500
|
}
|
|
55508
55501
|
}
|
|
55509
|
-
type =
|
|
55502
|
+
type = errorType;
|
|
55510
55503
|
}
|
|
55511
55504
|
signature.resolvedReturnType = type;
|
|
55512
55505
|
}
|
|
@@ -56082,7 +56075,7 @@ function createTypeChecker(host) {
|
|
|
56082
56075
|
if (constraint) {
|
|
56083
56076
|
constraints = append(constraints, constraint);
|
|
56084
56077
|
}
|
|
56085
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 200 /* MappedType */ &&
|
|
56078
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 200 /* MappedType */ && node === parent.type) {
|
|
56086
56079
|
const mappedType = getTypeFromTypeNode(parent);
|
|
56087
56080
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
56088
56081
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -75426,14 +75419,9 @@ function createTypeChecker(host) {
|
|
|
75426
75419
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
75427
75420
|
case 11 /* StringLiteral */:
|
|
75428
75421
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
75429
|
-
case 9 /* NumericLiteral */:
|
|
75422
|
+
case 9 /* NumericLiteral */:
|
|
75430
75423
|
checkGrammarNumericLiteral(node);
|
|
75431
|
-
|
|
75432
|
-
if (!isFinite(value)) {
|
|
75433
|
-
return numberType;
|
|
75434
|
-
}
|
|
75435
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
75436
|
-
}
|
|
75424
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
75437
75425
|
case 10 /* BigIntLiteral */:
|
|
75438
75426
|
checkGrammarBigIntLiteral(node);
|
|
75439
75427
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -80338,6 +80326,16 @@ function createTypeChecker(host) {
|
|
|
80338
80326
|
if (targetFlags & excludedMeanings) {
|
|
80339
80327
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
80340
80328
|
error(node, message, symbolToString(symbol));
|
|
80329
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
80330
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
80331
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
80332
|
+
error(
|
|
80333
|
+
node,
|
|
80334
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
80335
|
+
symbolToString(symbol),
|
|
80336
|
+
isolatedModulesLikeFlagName
|
|
80337
|
+
);
|
|
80338
|
+
}
|
|
80341
80339
|
}
|
|
80342
80340
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
80343
80341
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -82434,7 +82432,7 @@ function createTypeChecker(host) {
|
|
|
82434
82432
|
if (enumResult)
|
|
82435
82433
|
return enumResult;
|
|
82436
82434
|
const literalValue = type.value;
|
|
82437
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
82435
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
82438
82436
|
}
|
|
82439
82437
|
function createLiteralConstValue(node, tracker) {
|
|
82440
82438
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -88863,7 +88861,7 @@ function transformTypeScript(context) {
|
|
|
88863
88861
|
function transformEnumMemberDeclarationValue(member) {
|
|
88864
88862
|
const value = resolver.getConstantValue(member);
|
|
88865
88863
|
if (value !== void 0) {
|
|
88866
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
88864
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
88867
88865
|
} else {
|
|
88868
88866
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
88869
88867
|
if (member.initializer) {
|
|
@@ -103183,7 +103181,7 @@ function transformGenerators(context) {
|
|
|
103183
103181
|
if (labelExpressions === void 0) {
|
|
103184
103182
|
labelExpressions = [];
|
|
103185
103183
|
}
|
|
103186
|
-
const expression = factory2.createNumericLiteral(
|
|
103184
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
103187
103185
|
if (labelExpressions[label] === void 0) {
|
|
103188
103186
|
labelExpressions[label] = [expression];
|
|
103189
103187
|
} else {
|
|
@@ -109058,8 +109056,7 @@ function transformDeclarations(context) {
|
|
|
109058
109056
|
if (shouldStripInternal(m))
|
|
109059
109057
|
return;
|
|
109060
109058
|
const constValue = resolver.getConstantValue(m);
|
|
109061
|
-
|
|
109062
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
109059
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
109063
109060
|
}))
|
|
109064
109061
|
));
|
|
109065
109062
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2330
2330
|
|
|
2331
2331
|
// src/compiler/corePublic.ts
|
|
2332
2332
|
var versionMajorMinor = "5.4";
|
|
2333
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20231116`;
|
|
2334
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2335
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2336
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10214,6 +10214,7 @@ var Diagnostics = {
|
|
|
10214
10214
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
10215
10215
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
10216
10216
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
10217
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
10217
10218
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10218
10219
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
|
|
10219
10220
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
|
|
@@ -14658,7 +14659,7 @@ function isPropertyAccessOrQualifiedName(node) {
|
|
|
14658
14659
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
14659
14660
|
}
|
|
14660
14661
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
14661
|
-
return isCallLikeExpression(node) ||
|
|
14662
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
14662
14663
|
}
|
|
14663
14664
|
function isCallLikeExpression(node) {
|
|
14664
14665
|
switch (node.kind) {
|
|
@@ -23050,10 +23051,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23050
23051
|
return update(updated, original);
|
|
23051
23052
|
}
|
|
23052
23053
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
23053
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
23054
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
23055
23054
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
23056
|
-
node.text =
|
|
23055
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
23057
23056
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
23058
23057
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
23059
23058
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -48415,7 +48414,7 @@ function createTypeChecker(host) {
|
|
|
48415
48414
|
const nodeLinks2 = getNodeLinks(node);
|
|
48416
48415
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
48417
48416
|
nodeLinks2.resolvedSignature = void 0;
|
|
48418
|
-
if (
|
|
48417
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
48419
48418
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
48420
48419
|
const type = symbolLinks2.type;
|
|
48421
48420
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -52977,6 +52976,8 @@ function createTypeChecker(host) {
|
|
|
52977
52976
|
context.symbolDepth.set(id, depth + 1);
|
|
52978
52977
|
}
|
|
52979
52978
|
context.visitedTypes.add(typeId);
|
|
52979
|
+
const prevTrackedSymbols = context.trackedSymbols;
|
|
52980
|
+
context.trackedSymbols = void 0;
|
|
52980
52981
|
const startLength = context.approximateLength;
|
|
52981
52982
|
const result = transform2(type2);
|
|
52982
52983
|
const addedLength = context.approximateLength - startLength;
|
|
@@ -52992,6 +52993,7 @@ function createTypeChecker(host) {
|
|
|
52992
52993
|
if (id) {
|
|
52993
52994
|
context.symbolDepth.set(id, depth);
|
|
52994
52995
|
}
|
|
52996
|
+
context.trackedSymbols = prevTrackedSymbols;
|
|
52995
52997
|
return result;
|
|
52996
52998
|
function deepCloneOrReuseNode(node) {
|
|
52997
52999
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
@@ -54243,7 +54245,7 @@ function createTypeChecker(host) {
|
|
|
54243
54245
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
54244
54246
|
}
|
|
54245
54247
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
54246
|
-
return factory.createComputedPropertyName(factory.
|
|
54248
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
54247
54249
|
}
|
|
54248
54250
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
54249
54251
|
}
|
|
@@ -57316,7 +57318,7 @@ function createTypeChecker(host) {
|
|
|
57316
57318
|
} else if (getter && noImplicitAny) {
|
|
57317
57319
|
error2(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
57318
57320
|
}
|
|
57319
|
-
type =
|
|
57321
|
+
type = errorType;
|
|
57320
57322
|
}
|
|
57321
57323
|
links.type = type;
|
|
57322
57324
|
}
|
|
@@ -57334,7 +57336,7 @@ function createTypeChecker(host) {
|
|
|
57334
57336
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
57335
57337
|
error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
57336
57338
|
}
|
|
57337
|
-
writeType =
|
|
57339
|
+
writeType = errorType;
|
|
57338
57340
|
}
|
|
57339
57341
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
57340
57342
|
}
|
|
@@ -57415,8 +57417,7 @@ function createTypeChecker(host) {
|
|
|
57415
57417
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
57416
57418
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
57417
57419
|
if (!popTypeResolution()) {
|
|
57418
|
-
reportCircularityError(exportSymbol ?? symbol);
|
|
57419
|
-
return links.type = errorType;
|
|
57420
|
+
return links.type = reportCircularityError(exportSymbol ?? symbol);
|
|
57420
57421
|
}
|
|
57421
57422
|
}
|
|
57422
57423
|
return links.type;
|
|
@@ -57445,7 +57446,7 @@ function createTypeChecker(host) {
|
|
|
57445
57446
|
error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
57446
57447
|
}
|
|
57447
57448
|
}
|
|
57448
|
-
return
|
|
57449
|
+
return errorType;
|
|
57449
57450
|
}
|
|
57450
57451
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
57451
57452
|
const links = getSymbolLinks(symbol);
|
|
@@ -58946,14 +58947,6 @@ function createTypeChecker(host) {
|
|
|
58946
58947
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
58947
58948
|
}
|
|
58948
58949
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
58949
|
-
if (isTupleType(type)) {
|
|
58950
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
58951
|
-
return;
|
|
58952
|
-
}
|
|
58953
|
-
if (isArrayType(type)) {
|
|
58954
|
-
cb(numberType);
|
|
58955
|
-
return;
|
|
58956
|
-
}
|
|
58957
58950
|
for (const prop of getPropertiesOfType(type)) {
|
|
58958
58951
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
58959
58952
|
}
|
|
@@ -60214,7 +60207,7 @@ function createTypeChecker(host) {
|
|
|
60214
60207
|
}
|
|
60215
60208
|
}
|
|
60216
60209
|
}
|
|
60217
|
-
type =
|
|
60210
|
+
type = errorType;
|
|
60218
60211
|
}
|
|
60219
60212
|
signature.resolvedReturnType = type;
|
|
60220
60213
|
}
|
|
@@ -60790,7 +60783,7 @@ function createTypeChecker(host) {
|
|
|
60790
60783
|
if (constraint) {
|
|
60791
60784
|
constraints = append(constraints, constraint);
|
|
60792
60785
|
}
|
|
60793
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ &&
|
|
60786
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
|
|
60794
60787
|
const mappedType = getTypeFromTypeNode(parent2);
|
|
60795
60788
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
60796
60789
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -80134,14 +80127,9 @@ function createTypeChecker(host) {
|
|
|
80134
80127
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
80135
80128
|
case 11 /* StringLiteral */:
|
|
80136
80129
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
80137
|
-
case 9 /* NumericLiteral */:
|
|
80130
|
+
case 9 /* NumericLiteral */:
|
|
80138
80131
|
checkGrammarNumericLiteral(node);
|
|
80139
|
-
|
|
80140
|
-
if (!isFinite(value)) {
|
|
80141
|
-
return numberType;
|
|
80142
|
-
}
|
|
80143
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
80144
|
-
}
|
|
80132
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
80145
80133
|
case 10 /* BigIntLiteral */:
|
|
80146
80134
|
checkGrammarBigIntLiteral(node);
|
|
80147
80135
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -85046,6 +85034,16 @@ function createTypeChecker(host) {
|
|
|
85046
85034
|
if (targetFlags & excludedMeanings) {
|
|
85047
85035
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
85048
85036
|
error2(node, message, symbolToString(symbol));
|
|
85037
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
85038
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
85039
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
85040
|
+
error2(
|
|
85041
|
+
node,
|
|
85042
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
85043
|
+
symbolToString(symbol),
|
|
85044
|
+
isolatedModulesLikeFlagName
|
|
85045
|
+
);
|
|
85046
|
+
}
|
|
85049
85047
|
}
|
|
85050
85048
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
85051
85049
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -87142,7 +87140,7 @@ function createTypeChecker(host) {
|
|
|
87142
87140
|
if (enumResult)
|
|
87143
87141
|
return enumResult;
|
|
87144
87142
|
const literalValue = type.value;
|
|
87145
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
87143
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
87146
87144
|
}
|
|
87147
87145
|
function createLiteralConstValue(node, tracker) {
|
|
87148
87146
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -93742,7 +93740,7 @@ function transformTypeScript(context) {
|
|
|
93742
93740
|
function transformEnumMemberDeclarationValue(member) {
|
|
93743
93741
|
const value = resolver.getConstantValue(member);
|
|
93744
93742
|
if (value !== void 0) {
|
|
93745
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
93743
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
93746
93744
|
} else {
|
|
93747
93745
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
93748
93746
|
if (member.initializer) {
|
|
@@ -108062,7 +108060,7 @@ function transformGenerators(context) {
|
|
|
108062
108060
|
if (labelExpressions === void 0) {
|
|
108063
108061
|
labelExpressions = [];
|
|
108064
108062
|
}
|
|
108065
|
-
const expression = factory2.createNumericLiteral(
|
|
108063
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
108066
108064
|
if (labelExpressions[label] === void 0) {
|
|
108067
108065
|
labelExpressions[label] = [expression];
|
|
108068
108066
|
} else {
|
|
@@ -113937,8 +113935,7 @@ function transformDeclarations(context) {
|
|
|
113937
113935
|
if (shouldStripInternal(m))
|
|
113938
113936
|
return;
|
|
113939
113937
|
const constValue = resolver.getConstantValue(m);
|
|
113940
|
-
|
|
113941
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
113938
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
113942
113939
|
}))
|
|
113943
113940
|
));
|
|
113944
113941
|
}
|
|
@@ -175484,7 +175481,7 @@ var TypingsInstaller = class {
|
|
|
175484
175481
|
}
|
|
175485
175482
|
/** @internal */
|
|
175486
175483
|
installPackage(req) {
|
|
175487
|
-
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
175484
|
+
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
175488
175485
|
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
175489
175486
|
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
175490
175487
|
return directory;
|
|
@@ -175496,6 +175493,7 @@ var TypingsInstaller = class {
|
|
|
175496
175493
|
const response = {
|
|
175497
175494
|
kind: ActionPackageInstalled,
|
|
175498
175495
|
projectName,
|
|
175496
|
+
id,
|
|
175499
175497
|
success,
|
|
175500
175498
|
message
|
|
175501
175499
|
};
|
|
@@ -175505,6 +175503,7 @@ var TypingsInstaller = class {
|
|
|
175505
175503
|
const response = {
|
|
175506
175504
|
kind: ActionPackageInstalled,
|
|
175507
175505
|
projectName,
|
|
175506
|
+
id,
|
|
175508
175507
|
success: false,
|
|
175509
175508
|
message: "Could not determine a project root path."
|
|
175510
175509
|
};
|
|
@@ -186700,6 +186699,7 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
|
|
|
186700
186699
|
// Maps project name to newest requestQueue entry for that project
|
|
186701
186700
|
/** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
|
|
186702
186701
|
this.requestedRegistry = false;
|
|
186702
|
+
this.packageInstallId = 0;
|
|
186703
186703
|
}
|
|
186704
186704
|
isKnownTypesPackageName(name) {
|
|
186705
186705
|
var _a;
|
|
@@ -186714,11 +186714,13 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
|
|
|
186714
186714
|
return !!((_a = this.typesRegistryCache) == null ? void 0 : _a.has(name));
|
|
186715
186715
|
}
|
|
186716
186716
|
installPackage(options) {
|
|
186717
|
-
this.
|
|
186718
|
-
|
|
186719
|
-
|
|
186720
|
-
this.packageInstalledPromise = { resolve, reject };
|
|
186717
|
+
this.packageInstallId++;
|
|
186718
|
+
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
186719
|
+
const promise = new Promise((resolve, reject) => {
|
|
186720
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve, reject });
|
|
186721
186721
|
});
|
|
186722
|
+
this.installer.send(request);
|
|
186723
|
+
return promise;
|
|
186722
186724
|
}
|
|
186723
186725
|
attach(projectService) {
|
|
186724
186726
|
this.projectService = projectService;
|
|
@@ -186743,6 +186745,7 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
|
|
|
186743
186745
|
}
|
|
186744
186746
|
}
|
|
186745
186747
|
handleMessage(response) {
|
|
186748
|
+
var _a, _b;
|
|
186746
186749
|
if (this.logger.hasLevel(3 /* verbose */)) {
|
|
186747
186750
|
this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`);
|
|
186748
186751
|
}
|
|
@@ -186751,13 +186754,14 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
|
|
|
186751
186754
|
this.typesRegistryCache = new Map(Object.entries(response.typesRegistry));
|
|
186752
186755
|
break;
|
|
186753
186756
|
case ActionPackageInstalled: {
|
|
186754
|
-
const
|
|
186755
|
-
|
|
186756
|
-
|
|
186757
|
+
const promise = (_a = this.packageInstalledPromise) == null ? void 0 : _a.get(response.id);
|
|
186758
|
+
Debug.assertIsDefined(promise, "Should find the promise for package install");
|
|
186759
|
+
(_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id);
|
|
186760
|
+
if (response.success) {
|
|
186761
|
+
promise.resolve({ successMessage: response.message });
|
|
186757
186762
|
} else {
|
|
186758
|
-
|
|
186763
|
+
promise.reject(response.message);
|
|
186759
186764
|
}
|
|
186760
|
-
this.packageInstalledPromise = void 0;
|
|
186761
186765
|
this.projectService.updateTypingsForProject(response);
|
|
186762
186766
|
this.event(response, "setTypings");
|
|
186763
186767
|
break;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -49,9 +49,11 @@ declare namespace ts {
|
|
|
49
49
|
readonly fileName: Path;
|
|
50
50
|
readonly packageName: string;
|
|
51
51
|
readonly projectRootPath: Path;
|
|
52
|
+
readonly id: number;
|
|
52
53
|
}
|
|
53
54
|
interface PackageInstalledResponse extends ProjectResponse {
|
|
54
55
|
readonly kind: ActionPackageInstalled;
|
|
56
|
+
readonly id: number;
|
|
55
57
|
readonly success: boolean;
|
|
56
58
|
readonly message: string;
|
|
57
59
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20231116`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7994,6 +7994,7 @@ ${lanes.join("\n")}
|
|
|
7994
7994
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
7995
7995
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
7996
7996
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
7997
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
7997
7998
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
7998
7999
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
|
|
7999
8000
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
|
|
@@ -12445,7 +12446,7 @@ ${lanes.join("\n")}
|
|
|
12445
12446
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
12446
12447
|
}
|
|
12447
12448
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
12448
|
-
return isCallLikeExpression(node) ||
|
|
12449
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
12449
12450
|
}
|
|
12450
12451
|
function isCallLikeExpression(node) {
|
|
12451
12452
|
switch (node.kind) {
|
|
@@ -20862,10 +20863,8 @@ ${lanes.join("\n")}
|
|
|
20862
20863
|
return update(updated, original);
|
|
20863
20864
|
}
|
|
20864
20865
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
20865
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
20866
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
20867
20866
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
20868
|
-
node.text =
|
|
20867
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
20869
20868
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
20870
20869
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
20871
20870
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -46180,7 +46179,7 @@ ${lanes.join("\n")}
|
|
|
46180
46179
|
const nodeLinks2 = getNodeLinks(node);
|
|
46181
46180
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
46182
46181
|
nodeLinks2.resolvedSignature = void 0;
|
|
46183
|
-
if (
|
|
46182
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
46184
46183
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
46185
46184
|
const type = symbolLinks2.type;
|
|
46186
46185
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -50742,6 +50741,8 @@ ${lanes.join("\n")}
|
|
|
50742
50741
|
context.symbolDepth.set(id, depth + 1);
|
|
50743
50742
|
}
|
|
50744
50743
|
context.visitedTypes.add(typeId);
|
|
50744
|
+
const prevTrackedSymbols = context.trackedSymbols;
|
|
50745
|
+
context.trackedSymbols = void 0;
|
|
50745
50746
|
const startLength = context.approximateLength;
|
|
50746
50747
|
const result = transform2(type2);
|
|
50747
50748
|
const addedLength = context.approximateLength - startLength;
|
|
@@ -50757,6 +50758,7 @@ ${lanes.join("\n")}
|
|
|
50757
50758
|
if (id) {
|
|
50758
50759
|
context.symbolDepth.set(id, depth);
|
|
50759
50760
|
}
|
|
50761
|
+
context.trackedSymbols = prevTrackedSymbols;
|
|
50760
50762
|
return result;
|
|
50761
50763
|
function deepCloneOrReuseNode(node) {
|
|
50762
50764
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
@@ -52008,7 +52010,7 @@ ${lanes.join("\n")}
|
|
|
52008
52010
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
52009
52011
|
}
|
|
52010
52012
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
52011
|
-
return factory.createComputedPropertyName(factory.
|
|
52013
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
52012
52014
|
}
|
|
52013
52015
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
52014
52016
|
}
|
|
@@ -55081,7 +55083,7 @@ ${lanes.join("\n")}
|
|
|
55081
55083
|
} else if (getter && noImplicitAny) {
|
|
55082
55084
|
error2(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
55083
55085
|
}
|
|
55084
|
-
type =
|
|
55086
|
+
type = errorType;
|
|
55085
55087
|
}
|
|
55086
55088
|
links.type = type;
|
|
55087
55089
|
}
|
|
@@ -55099,7 +55101,7 @@ ${lanes.join("\n")}
|
|
|
55099
55101
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
55100
55102
|
error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
55101
55103
|
}
|
|
55102
|
-
writeType =
|
|
55104
|
+
writeType = errorType;
|
|
55103
55105
|
}
|
|
55104
55106
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
55105
55107
|
}
|
|
@@ -55180,8 +55182,7 @@ ${lanes.join("\n")}
|
|
|
55180
55182
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
55181
55183
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
55182
55184
|
if (!popTypeResolution()) {
|
|
55183
|
-
reportCircularityError(exportSymbol ?? symbol);
|
|
55184
|
-
return links.type = errorType;
|
|
55185
|
+
return links.type = reportCircularityError(exportSymbol ?? symbol);
|
|
55185
55186
|
}
|
|
55186
55187
|
}
|
|
55187
55188
|
return links.type;
|
|
@@ -55210,7 +55211,7 @@ ${lanes.join("\n")}
|
|
|
55210
55211
|
error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
55211
55212
|
}
|
|
55212
55213
|
}
|
|
55213
|
-
return
|
|
55214
|
+
return errorType;
|
|
55214
55215
|
}
|
|
55215
55216
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
55216
55217
|
const links = getSymbolLinks(symbol);
|
|
@@ -56711,14 +56712,6 @@ ${lanes.join("\n")}
|
|
|
56711
56712
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
56712
56713
|
}
|
|
56713
56714
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
56714
|
-
if (isTupleType(type)) {
|
|
56715
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
56716
|
-
return;
|
|
56717
|
-
}
|
|
56718
|
-
if (isArrayType(type)) {
|
|
56719
|
-
cb(numberType);
|
|
56720
|
-
return;
|
|
56721
|
-
}
|
|
56722
56715
|
for (const prop of getPropertiesOfType(type)) {
|
|
56723
56716
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
56724
56717
|
}
|
|
@@ -57979,7 +57972,7 @@ ${lanes.join("\n")}
|
|
|
57979
57972
|
}
|
|
57980
57973
|
}
|
|
57981
57974
|
}
|
|
57982
|
-
type =
|
|
57975
|
+
type = errorType;
|
|
57983
57976
|
}
|
|
57984
57977
|
signature.resolvedReturnType = type;
|
|
57985
57978
|
}
|
|
@@ -58555,7 +58548,7 @@ ${lanes.join("\n")}
|
|
|
58555
58548
|
if (constraint) {
|
|
58556
58549
|
constraints = append(constraints, constraint);
|
|
58557
58550
|
}
|
|
58558
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ &&
|
|
58551
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
|
|
58559
58552
|
const mappedType = getTypeFromTypeNode(parent2);
|
|
58560
58553
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
58561
58554
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -77899,14 +77892,9 @@ ${lanes.join("\n")}
|
|
|
77899
77892
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
77900
77893
|
case 11 /* StringLiteral */:
|
|
77901
77894
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
77902
|
-
case 9 /* NumericLiteral */:
|
|
77895
|
+
case 9 /* NumericLiteral */:
|
|
77903
77896
|
checkGrammarNumericLiteral(node);
|
|
77904
|
-
|
|
77905
|
-
if (!isFinite(value)) {
|
|
77906
|
-
return numberType;
|
|
77907
|
-
}
|
|
77908
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
77909
|
-
}
|
|
77897
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
77910
77898
|
case 10 /* BigIntLiteral */:
|
|
77911
77899
|
checkGrammarBigIntLiteral(node);
|
|
77912
77900
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -82811,6 +82799,16 @@ ${lanes.join("\n")}
|
|
|
82811
82799
|
if (targetFlags & excludedMeanings) {
|
|
82812
82800
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
82813
82801
|
error2(node, message, symbolToString(symbol));
|
|
82802
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
82803
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
82804
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
82805
|
+
error2(
|
|
82806
|
+
node,
|
|
82807
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
82808
|
+
symbolToString(symbol),
|
|
82809
|
+
isolatedModulesLikeFlagName
|
|
82810
|
+
);
|
|
82811
|
+
}
|
|
82814
82812
|
}
|
|
82815
82813
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
82816
82814
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -84907,7 +84905,7 @@ ${lanes.join("\n")}
|
|
|
84907
84905
|
if (enumResult)
|
|
84908
84906
|
return enumResult;
|
|
84909
84907
|
const literalValue = type.value;
|
|
84910
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
84908
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
84911
84909
|
}
|
|
84912
84910
|
function createLiteralConstValue(node, tracker) {
|
|
84913
84911
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -91687,7 +91685,7 @@ ${lanes.join("\n")}
|
|
|
91687
91685
|
function transformEnumMemberDeclarationValue(member) {
|
|
91688
91686
|
const value = resolver.getConstantValue(member);
|
|
91689
91687
|
if (value !== void 0) {
|
|
91690
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
91688
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
91691
91689
|
} else {
|
|
91692
91690
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
91693
91691
|
if (member.initializer) {
|
|
@@ -106100,7 +106098,7 @@ ${lanes.join("\n")}
|
|
|
106100
106098
|
if (labelExpressions === void 0) {
|
|
106101
106099
|
labelExpressions = [];
|
|
106102
106100
|
}
|
|
106103
|
-
const expression = factory2.createNumericLiteral(
|
|
106101
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
106104
106102
|
if (labelExpressions[label] === void 0) {
|
|
106105
106103
|
labelExpressions[label] = [expression];
|
|
106106
106104
|
} else {
|
|
@@ -112011,8 +112009,7 @@ ${lanes.join("\n")}
|
|
|
112011
112009
|
if (shouldStripInternal(m))
|
|
112012
112010
|
return;
|
|
112013
112011
|
const constValue = resolver.getConstantValue(m);
|
|
112014
|
-
|
|
112015
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
112012
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
112016
112013
|
}))
|
|
112017
112014
|
));
|
|
112018
112015
|
}
|
|
@@ -172698,7 +172695,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
172698
172695
|
}
|
|
172699
172696
|
/** @internal */
|
|
172700
172697
|
installPackage(req) {
|
|
172701
|
-
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
172698
|
+
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
172702
172699
|
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
172703
172700
|
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
172704
172701
|
return directory;
|
|
@@ -172710,6 +172707,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
172710
172707
|
const response = {
|
|
172711
172708
|
kind: ActionPackageInstalled,
|
|
172712
172709
|
projectName,
|
|
172710
|
+
id,
|
|
172713
172711
|
success,
|
|
172714
172712
|
message
|
|
172715
172713
|
};
|
|
@@ -172719,6 +172717,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
172719
172717
|
const response = {
|
|
172720
172718
|
kind: ActionPackageInstalled,
|
|
172721
172719
|
projectName,
|
|
172720
|
+
id,
|
|
172722
172721
|
success: false,
|
|
172723
172722
|
message: "Could not determine a project root path."
|
|
172724
172723
|
};
|
|
@@ -184039,6 +184038,7 @@ ${e.message}`;
|
|
|
184039
184038
|
// Maps project name to newest requestQueue entry for that project
|
|
184040
184039
|
/** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
|
|
184041
184040
|
this.requestedRegistry = false;
|
|
184041
|
+
this.packageInstallId = 0;
|
|
184042
184042
|
}
|
|
184043
184043
|
isKnownTypesPackageName(name) {
|
|
184044
184044
|
var _a;
|
|
@@ -184053,11 +184053,13 @@ ${e.message}`;
|
|
|
184053
184053
|
return !!((_a = this.typesRegistryCache) == null ? void 0 : _a.has(name));
|
|
184054
184054
|
}
|
|
184055
184055
|
installPackage(options) {
|
|
184056
|
-
this.
|
|
184057
|
-
|
|
184058
|
-
|
|
184059
|
-
this.packageInstalledPromise = { resolve, reject };
|
|
184056
|
+
this.packageInstallId++;
|
|
184057
|
+
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
184058
|
+
const promise = new Promise((resolve, reject) => {
|
|
184059
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve, reject });
|
|
184060
184060
|
});
|
|
184061
|
+
this.installer.send(request);
|
|
184062
|
+
return promise;
|
|
184061
184063
|
}
|
|
184062
184064
|
attach(projectService) {
|
|
184063
184065
|
this.projectService = projectService;
|
|
@@ -184082,6 +184084,7 @@ ${e.message}`;
|
|
|
184082
184084
|
}
|
|
184083
184085
|
}
|
|
184084
184086
|
handleMessage(response) {
|
|
184087
|
+
var _a, _b;
|
|
184085
184088
|
if (this.logger.hasLevel(3 /* verbose */)) {
|
|
184086
184089
|
this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`);
|
|
184087
184090
|
}
|
|
@@ -184090,13 +184093,14 @@ ${e.message}`;
|
|
|
184090
184093
|
this.typesRegistryCache = new Map(Object.entries(response.typesRegistry));
|
|
184091
184094
|
break;
|
|
184092
184095
|
case ActionPackageInstalled: {
|
|
184093
|
-
const
|
|
184094
|
-
|
|
184095
|
-
|
|
184096
|
+
const promise = (_a = this.packageInstalledPromise) == null ? void 0 : _a.get(response.id);
|
|
184097
|
+
Debug.assertIsDefined(promise, "Should find the promise for package install");
|
|
184098
|
+
(_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id);
|
|
184099
|
+
if (response.success) {
|
|
184100
|
+
promise.resolve({ successMessage: response.message });
|
|
184096
184101
|
} else {
|
|
184097
|
-
|
|
184102
|
+
promise.reject(response.message);
|
|
184098
184103
|
}
|
|
184099
|
-
this.packageInstalledPromise = void 0;
|
|
184100
184104
|
this.projectService.updateTypingsForProject(response);
|
|
184101
184105
|
this.event(response, "setTypings");
|
|
184102
184106
|
break;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20231116`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -6059,6 +6059,7 @@ var Diagnostics = {
|
|
|
6059
6059
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6060
6060
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6061
6061
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6062
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6062
6063
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6063
6064
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
|
|
6064
6065
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
|
|
@@ -13056,10 +13057,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13056
13057
|
return update(updated, original);
|
|
13057
13058
|
}
|
|
13058
13059
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
13059
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
13060
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
13061
13060
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
13062
|
-
node.text =
|
|
13061
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
13063
13062
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
13064
13063
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
13065
13064
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -31948,7 +31947,7 @@ var TypingsInstaller = class {
|
|
|
31948
31947
|
}
|
|
31949
31948
|
/** @internal */
|
|
31950
31949
|
installPackage(req) {
|
|
31951
|
-
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
31950
|
+
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
31952
31951
|
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
31953
31952
|
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
31954
31953
|
return directory;
|
|
@@ -31960,6 +31959,7 @@ var TypingsInstaller = class {
|
|
|
31960
31959
|
const response = {
|
|
31961
31960
|
kind: ActionPackageInstalled,
|
|
31962
31961
|
projectName,
|
|
31962
|
+
id,
|
|
31963
31963
|
success,
|
|
31964
31964
|
message
|
|
31965
31965
|
};
|
|
@@ -31969,6 +31969,7 @@ var TypingsInstaller = class {
|
|
|
31969
31969
|
const response = {
|
|
31970
31970
|
kind: ActionPackageInstalled,
|
|
31971
31971
|
projectName,
|
|
31972
|
+
id,
|
|
31972
31973
|
success: false,
|
|
31973
31974
|
message: "Could not determine a project root path."
|
|
31974
31975
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56429-7",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "1f095db76098959d2ad1e8beef365f4e5b2a7b9a"
|
|
119
119
|
}
|