typescript 5.4.0-dev.20231128 → 5.4.0-dev.20231130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2018.intl.d.ts +4 -3
- package/lib/lib.es2020.intl.d.ts +36 -16
- package/lib/lib.es2020.string.d.ts +14 -0
- package/lib/lib.es2021.intl.d.ts +2 -2
- package/lib/lib.es2022.intl.d.ts +2 -2
- package/lib/lib.es5.d.ts +15 -6
- package/lib/lib.esnext.d.ts +1 -0
- package/lib/lib.esnext.promise.d.ts +35 -0
- package/lib/tsc.js +83 -48
- package/lib/tsserver.js +135 -50
- package/lib/typescript.js +134 -50
- package/lib/typingsInstaller.js +23 -14
- package/package.json +2 -2
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-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231130`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -35191,18 +35191,7 @@ ${lanes.join("\n")}
|
|
|
35191
35191
|
}
|
|
35192
35192
|
nextTokenJSDoc();
|
|
35193
35193
|
skipWhitespace();
|
|
35194
|
-
const
|
|
35195
|
-
let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(
|
|
35196
|
-
/*allowReservedWords*/
|
|
35197
|
-
true
|
|
35198
|
-
) : void 0;
|
|
35199
|
-
if (name) {
|
|
35200
|
-
while (token() === 81 /* PrivateIdentifier */) {
|
|
35201
|
-
reScanHashToken();
|
|
35202
|
-
nextTokenJSDoc();
|
|
35203
|
-
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2);
|
|
35204
|
-
}
|
|
35205
|
-
}
|
|
35194
|
+
const name = parseJSDocLinkName();
|
|
35206
35195
|
const text = [];
|
|
35207
35196
|
while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
|
|
35208
35197
|
text.push(scanner2.getTokenText());
|
|
@@ -35211,6 +35200,26 @@ ${lanes.join("\n")}
|
|
|
35211
35200
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
35212
35201
|
return finishNode(create(name, text.join("")), start2, scanner2.getTokenEnd());
|
|
35213
35202
|
}
|
|
35203
|
+
function parseJSDocLinkName() {
|
|
35204
|
+
if (tokenIsIdentifierOrKeyword(token())) {
|
|
35205
|
+
const pos = getNodePos();
|
|
35206
|
+
let name = parseIdentifierName();
|
|
35207
|
+
while (parseOptional(25 /* DotToken */)) {
|
|
35208
|
+
name = finishNode(factory2.createQualifiedName(name, token() === 81 /* PrivateIdentifier */ ? createMissingNode(
|
|
35209
|
+
80 /* Identifier */,
|
|
35210
|
+
/*reportAtCurrentPosition*/
|
|
35211
|
+
false
|
|
35212
|
+
) : parseIdentifier()), pos);
|
|
35213
|
+
}
|
|
35214
|
+
while (token() === 81 /* PrivateIdentifier */) {
|
|
35215
|
+
reScanHashToken();
|
|
35216
|
+
nextTokenJSDoc();
|
|
35217
|
+
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), pos);
|
|
35218
|
+
}
|
|
35219
|
+
return name;
|
|
35220
|
+
}
|
|
35221
|
+
return void 0;
|
|
35222
|
+
}
|
|
35214
35223
|
function parseJSDocLinkPrefix() {
|
|
35215
35224
|
skipWhitespaceOrAsterisk();
|
|
35216
35225
|
if (token() === 19 /* OpenBraceToken */ && nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
@@ -37805,7 +37814,7 @@ ${lanes.join("\n")}
|
|
|
37805
37814
|
["esnext.disposable", "lib.esnext.disposable.d.ts"],
|
|
37806
37815
|
["esnext.bigint", "lib.es2020.bigint.d.ts"],
|
|
37807
37816
|
["esnext.string", "lib.es2022.string.d.ts"],
|
|
37808
|
-
["esnext.promise", "lib.
|
|
37817
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
37809
37818
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
37810
37819
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
37811
37820
|
["decorators", "lib.decorators.d.ts"],
|
|
@@ -44301,7 +44310,7 @@ ${lanes.join("\n")}
|
|
|
44301
44310
|
}
|
|
44302
44311
|
function bindSpecialPropertyAssignment(node) {
|
|
44303
44312
|
var _a;
|
|
44304
|
-
const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression,
|
|
44313
|
+
const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer) || lookupSymbolForPropertyAccess(node.left.expression, container);
|
|
44305
44314
|
if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) {
|
|
44306
44315
|
return;
|
|
44307
44316
|
}
|
|
@@ -44399,7 +44408,7 @@ ${lanes.join("\n")}
|
|
|
44399
44408
|
return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 312 /* SourceFile */ : propertyAccess.parent.parent.kind === 312 /* SourceFile */;
|
|
44400
44409
|
}
|
|
44401
44410
|
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
|
|
44402
|
-
let namespaceSymbol = lookupSymbolForPropertyAccess(name,
|
|
44411
|
+
let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container);
|
|
44403
44412
|
const isToplevel = isTopLevelNamespaceAssignment(propertyAccess);
|
|
44404
44413
|
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass);
|
|
44405
44414
|
bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
|
|
@@ -56952,7 +56961,12 @@ ${lanes.join("\n")}
|
|
|
56952
56961
|
for (const current of type.types) {
|
|
56953
56962
|
for (const prop of getPropertiesOfType(current)) {
|
|
56954
56963
|
if (!members.has(prop.escapedName)) {
|
|
56955
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
56964
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
56965
|
+
type,
|
|
56966
|
+
prop.escapedName,
|
|
56967
|
+
/*skipObjectFunctionPropertyAugment*/
|
|
56968
|
+
!!(type.flags & 2097152 /* Intersection */)
|
|
56969
|
+
);
|
|
56956
56970
|
if (combinedProp) {
|
|
56957
56971
|
members.set(prop.escapedName, combinedProp);
|
|
56958
56972
|
}
|
|
@@ -57442,13 +57456,17 @@ ${lanes.join("\n")}
|
|
|
57442
57456
|
return result;
|
|
57443
57457
|
}
|
|
57444
57458
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
57445
|
-
var _a, _b;
|
|
57459
|
+
var _a, _b, _c;
|
|
57446
57460
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
57447
57461
|
if (!property) {
|
|
57448
57462
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
57449
57463
|
if (property) {
|
|
57450
57464
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
57451
57465
|
properties.set(name, property);
|
|
57466
|
+
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
57467
|
+
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
57468
|
+
properties2.set(name, property);
|
|
57469
|
+
}
|
|
57452
57470
|
}
|
|
57453
57471
|
}
|
|
57454
57472
|
return property;
|
|
@@ -57558,7 +57576,22 @@ ${lanes.join("\n")}
|
|
|
57558
57576
|
}
|
|
57559
57577
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
57560
57578
|
}
|
|
57561
|
-
if (type.flags &
|
|
57579
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
57580
|
+
const prop = getPropertyOfUnionOrIntersectionType(
|
|
57581
|
+
type,
|
|
57582
|
+
name,
|
|
57583
|
+
/*skipObjectFunctionPropertyAugment*/
|
|
57584
|
+
true
|
|
57585
|
+
);
|
|
57586
|
+
if (prop) {
|
|
57587
|
+
return prop;
|
|
57588
|
+
}
|
|
57589
|
+
if (!skipObjectFunctionPropertyAugment) {
|
|
57590
|
+
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57591
|
+
}
|
|
57592
|
+
return void 0;
|
|
57593
|
+
}
|
|
57594
|
+
if (type.flags & 1048576 /* Union */) {
|
|
57562
57595
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
57563
57596
|
}
|
|
57564
57597
|
return void 0;
|
|
@@ -66411,12 +66444,12 @@ ${lanes.join("\n")}
|
|
|
66411
66444
|
return false;
|
|
66412
66445
|
}
|
|
66413
66446
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
66414
|
-
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
66415
|
-
return true;
|
|
66416
|
-
}
|
|
66417
66447
|
if (target.flags & 2097152 /* Intersection */) {
|
|
66418
66448
|
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
66419
66449
|
}
|
|
66450
|
+
if (target.flags & 4 /* String */ || isTypeAssignableTo(source, target)) {
|
|
66451
|
+
return true;
|
|
66452
|
+
}
|
|
66420
66453
|
if (source.flags & 128 /* StringLiteral */) {
|
|
66421
66454
|
const value = source.value;
|
|
66422
66455
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -66433,7 +66466,7 @@ ${lanes.join("\n")}
|
|
|
66433
66466
|
const texts = source.texts;
|
|
66434
66467
|
return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
|
|
66435
66468
|
}
|
|
66436
|
-
return
|
|
66469
|
+
return false;
|
|
66437
66470
|
}
|
|
66438
66471
|
function inferTypesFromTemplateLiteralType(source, target) {
|
|
66439
66472
|
return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arraysEqual(source.texts, target.texts) ? map(source.types, getStringLikeTypeForType) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
|
|
@@ -69391,14 +69424,15 @@ ${lanes.join("\n")}
|
|
|
69391
69424
|
if (declaration) {
|
|
69392
69425
|
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
69393
69426
|
const parent2 = declaration.parent.parent;
|
|
69394
|
-
|
|
69427
|
+
const rootDeclaration = getRootDeclaration(parent2);
|
|
69428
|
+
if (rootDeclaration.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 169 /* Parameter */) {
|
|
69395
69429
|
const links = getNodeLinks(parent2);
|
|
69396
69430
|
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
69397
69431
|
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
69398
69432
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
69399
69433
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
69400
69434
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
69401
|
-
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(
|
|
69435
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
69402
69436
|
const pattern = declaration.parent;
|
|
69403
69437
|
const narrowedType = getFlowTypeOfReference(
|
|
69404
69438
|
pattern,
|
|
@@ -73571,19 +73605,9 @@ ${lanes.join("\n")}
|
|
|
73571
73605
|
return Debug.fail();
|
|
73572
73606
|
}
|
|
73573
73607
|
}
|
|
73574
|
-
function getDiagnosticSpanForCallNode(node
|
|
73575
|
-
let start;
|
|
73576
|
-
let length2;
|
|
73608
|
+
function getDiagnosticSpanForCallNode(node) {
|
|
73577
73609
|
const sourceFile = getSourceFileOfNode(node);
|
|
73578
|
-
|
|
73579
|
-
const nameSpan = getErrorSpanForNode(sourceFile, node.expression.name);
|
|
73580
|
-
start = nameSpan.start;
|
|
73581
|
-
length2 = doNotIncludeArguments ? nameSpan.length : node.end - start;
|
|
73582
|
-
} else {
|
|
73583
|
-
const expressionSpan = getErrorSpanForNode(sourceFile, node.expression);
|
|
73584
|
-
start = expressionSpan.start;
|
|
73585
|
-
length2 = doNotIncludeArguments ? expressionSpan.length : node.end - start;
|
|
73586
|
-
}
|
|
73610
|
+
const { start, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression);
|
|
73587
73611
|
return { start, length: length2, sourceFile };
|
|
73588
73612
|
}
|
|
73589
73613
|
function getDiagnosticForCallNode(node, message, ...args) {
|
|
@@ -73600,6 +73624,18 @@ ${lanes.join("\n")}
|
|
|
73600
73624
|
return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message);
|
|
73601
73625
|
}
|
|
73602
73626
|
}
|
|
73627
|
+
function getErrorNodeForCallNode(callLike) {
|
|
73628
|
+
if (isCallOrNewExpression(callLike)) {
|
|
73629
|
+
return isPropertyAccessExpression(callLike.expression) ? callLike.expression.name : callLike.expression;
|
|
73630
|
+
}
|
|
73631
|
+
if (isTaggedTemplateExpression(callLike)) {
|
|
73632
|
+
return isPropertyAccessExpression(callLike.tag) ? callLike.tag.name : callLike.tag;
|
|
73633
|
+
}
|
|
73634
|
+
if (isJsxOpeningLikeElement(callLike)) {
|
|
73635
|
+
return callLike.tagName;
|
|
73636
|
+
}
|
|
73637
|
+
return callLike;
|
|
73638
|
+
}
|
|
73603
73639
|
function isPromiseResolveArityError(node) {
|
|
73604
73640
|
if (!isCallExpression(node) || !isIdentifier(node.expression))
|
|
73605
73641
|
return false;
|
|
@@ -73901,7 +73937,7 @@ ${lanes.join("\n")}
|
|
|
73901
73937
|
const { file, start, length: length2 } = diags[0];
|
|
73902
73938
|
diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };
|
|
73903
73939
|
} else {
|
|
73904
|
-
diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related);
|
|
73940
|
+
diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain, related);
|
|
73905
73941
|
}
|
|
73906
73942
|
addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2);
|
|
73907
73943
|
diagnostics.add(diag2);
|
|
@@ -74429,11 +74465,7 @@ ${lanes.join("\n")}
|
|
|
74429
74465
|
addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo));
|
|
74430
74466
|
}
|
|
74431
74467
|
if (isCallExpression(errorTarget.parent)) {
|
|
74432
|
-
const { start, length: length2 } = getDiagnosticSpanForCallNode(
|
|
74433
|
-
errorTarget.parent,
|
|
74434
|
-
/*doNotIncludeArguments*/
|
|
74435
|
-
true
|
|
74436
|
-
);
|
|
74468
|
+
const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent);
|
|
74437
74469
|
diagnostic.start = start;
|
|
74438
74470
|
diagnostic.length = length2;
|
|
74439
74471
|
}
|
|
@@ -77803,16 +77835,19 @@ ${lanes.join("\n")}
|
|
|
77803
77835
|
}
|
|
77804
77836
|
}
|
|
77805
77837
|
}
|
|
77806
|
-
function
|
|
77838
|
+
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
|
|
77807
77839
|
const signature = getSingleCallSignature(funcType);
|
|
77808
|
-
if (signature
|
|
77809
|
-
|
|
77840
|
+
if (signature) {
|
|
77841
|
+
const returnType = getReturnTypeOfSignature(signature);
|
|
77842
|
+
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
77843
|
+
return returnType;
|
|
77844
|
+
}
|
|
77810
77845
|
}
|
|
77811
77846
|
}
|
|
77812
77847
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
77813
77848
|
const funcType = checkExpression(expr.expression);
|
|
77814
77849
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
77815
|
-
const returnType =
|
|
77850
|
+
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
|
|
77816
77851
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
77817
77852
|
}
|
|
77818
77853
|
function getTypeOfExpression(node) {
|
|
@@ -77857,7 +77892,7 @@ ${lanes.join("\n")}
|
|
|
77857
77892
|
/*requireStringLiteralLikeArgument*/
|
|
77858
77893
|
true
|
|
77859
77894
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
77860
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
77895
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
|
|
77861
77896
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
77862
77897
|
return getTypeFromTypeNode(expr.type);
|
|
77863
77898
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -165137,6 +165172,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165137
165172
|
visitForDisplayParts(node.type);
|
|
165138
165173
|
}
|
|
165139
165174
|
break;
|
|
165175
|
+
case 181 /* IndexSignature */:
|
|
165176
|
+
Debug.assertNode(node, isIndexSignatureDeclaration);
|
|
165177
|
+
Debug.assertEqual(node.parameters.length, 1);
|
|
165178
|
+
parts.push({ text: "[" });
|
|
165179
|
+
visitForDisplayParts(node.parameters[0]);
|
|
165180
|
+
parts.push({ text: "]" });
|
|
165181
|
+
if (node.type) {
|
|
165182
|
+
parts.push({ text: ": " });
|
|
165183
|
+
visitForDisplayParts(node.type);
|
|
165184
|
+
}
|
|
165185
|
+
break;
|
|
165140
165186
|
case 173 /* MethodSignature */:
|
|
165141
165187
|
Debug.assertNode(node, isMethodSignature);
|
|
165142
165188
|
if ((_b = node.modifiers) == null ? void 0 : _b.length) {
|
|
@@ -165186,6 +165232,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165186
165232
|
parts.push({ text: tokenToString(node.operator) });
|
|
165187
165233
|
visitForDisplayParts(node.operand);
|
|
165188
165234
|
break;
|
|
165235
|
+
case 203 /* TemplateLiteralType */:
|
|
165236
|
+
Debug.assertNode(node, isTemplateLiteralTypeNode);
|
|
165237
|
+
visitForDisplayParts(node.head);
|
|
165238
|
+
node.templateSpans.forEach(visitForDisplayParts);
|
|
165239
|
+
break;
|
|
165240
|
+
case 16 /* TemplateHead */:
|
|
165241
|
+
Debug.assertNode(node, isTemplateHead);
|
|
165242
|
+
parts.push({ text: getLiteralText2(node) });
|
|
165243
|
+
break;
|
|
165244
|
+
case 204 /* TemplateLiteralTypeSpan */:
|
|
165245
|
+
Debug.assertNode(node, isTemplateLiteralTypeSpan);
|
|
165246
|
+
visitForDisplayParts(node.type);
|
|
165247
|
+
visitForDisplayParts(node.literal);
|
|
165248
|
+
break;
|
|
165249
|
+
case 17 /* TemplateMiddle */:
|
|
165250
|
+
Debug.assertNode(node, isTemplateMiddle);
|
|
165251
|
+
parts.push({ text: getLiteralText2(node) });
|
|
165252
|
+
break;
|
|
165253
|
+
case 18 /* TemplateTail */:
|
|
165254
|
+
Debug.assertNode(node, isTemplateTail);
|
|
165255
|
+
parts.push({ text: getLiteralText2(node) });
|
|
165256
|
+
break;
|
|
165189
165257
|
case 197 /* ThisType */:
|
|
165190
165258
|
Debug.assertNode(node, isThisTypeNode);
|
|
165191
165259
|
parts.push({ text: "this" });
|
|
@@ -165213,8 +165281,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165213
165281
|
});
|
|
165214
165282
|
}
|
|
165215
165283
|
function getLiteralText2(node) {
|
|
165216
|
-
|
|
165217
|
-
|
|
165284
|
+
switch (node.kind) {
|
|
165285
|
+
case 11 /* StringLiteral */:
|
|
165286
|
+
return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
|
|
165287
|
+
case 16 /* TemplateHead */:
|
|
165288
|
+
case 17 /* TemplateMiddle */:
|
|
165289
|
+
case 18 /* TemplateTail */: {
|
|
165290
|
+
const rawText = node.rawText ?? escapeTemplateSubstitution(escapeString(node.text, 96 /* backtick */));
|
|
165291
|
+
switch (node.kind) {
|
|
165292
|
+
case 16 /* TemplateHead */:
|
|
165293
|
+
return "`" + rawText + "${";
|
|
165294
|
+
case 17 /* TemplateMiddle */:
|
|
165295
|
+
return "}" + rawText + "${";
|
|
165296
|
+
case 18 /* TemplateTail */:
|
|
165297
|
+
return "}" + rawText + "`";
|
|
165298
|
+
}
|
|
165299
|
+
}
|
|
165218
165300
|
}
|
|
165219
165301
|
return node.text;
|
|
165220
165302
|
}
|
|
@@ -184995,6 +185077,7 @@ ${e.message}`;
|
|
|
184995
185077
|
escapeNonAsciiString: () => escapeNonAsciiString,
|
|
184996
185078
|
escapeSnippetText: () => escapeSnippetText,
|
|
184997
185079
|
escapeString: () => escapeString,
|
|
185080
|
+
escapeTemplateSubstitution: () => escapeTemplateSubstitution,
|
|
184998
185081
|
every: () => every,
|
|
184999
185082
|
expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression,
|
|
185000
185083
|
explainFiles: () => explainFiles,
|
|
@@ -187407,6 +187490,7 @@ ${e.message}`;
|
|
|
187407
187490
|
escapeNonAsciiString: () => escapeNonAsciiString,
|
|
187408
187491
|
escapeSnippetText: () => escapeSnippetText,
|
|
187409
187492
|
escapeString: () => escapeString,
|
|
187493
|
+
escapeTemplateSubstitution: () => escapeTemplateSubstitution,
|
|
187410
187494
|
every: () => every,
|
|
187411
187495
|
expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression,
|
|
187412
187496
|
explainFiles: () => explainFiles,
|
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-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20231130`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -24510,18 +24510,7 @@ var Parser;
|
|
|
24510
24510
|
}
|
|
24511
24511
|
nextTokenJSDoc();
|
|
24512
24512
|
skipWhitespace();
|
|
24513
|
-
const
|
|
24514
|
-
let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(
|
|
24515
|
-
/*allowReservedWords*/
|
|
24516
|
-
true
|
|
24517
|
-
) : void 0;
|
|
24518
|
-
if (name) {
|
|
24519
|
-
while (token() === 81 /* PrivateIdentifier */) {
|
|
24520
|
-
reScanHashToken();
|
|
24521
|
-
nextTokenJSDoc();
|
|
24522
|
-
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2);
|
|
24523
|
-
}
|
|
24524
|
-
}
|
|
24513
|
+
const name = parseJSDocLinkName();
|
|
24525
24514
|
const text = [];
|
|
24526
24515
|
while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
|
|
24527
24516
|
text.push(scanner.getTokenText());
|
|
@@ -24530,6 +24519,26 @@ var Parser;
|
|
|
24530
24519
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
24531
24520
|
return finishNode(create(name, text.join("")), start2, scanner.getTokenEnd());
|
|
24532
24521
|
}
|
|
24522
|
+
function parseJSDocLinkName() {
|
|
24523
|
+
if (tokenIsIdentifierOrKeyword(token())) {
|
|
24524
|
+
const pos = getNodePos();
|
|
24525
|
+
let name = parseIdentifierName();
|
|
24526
|
+
while (parseOptional(25 /* DotToken */)) {
|
|
24527
|
+
name = finishNode(factory2.createQualifiedName(name, token() === 81 /* PrivateIdentifier */ ? createMissingNode(
|
|
24528
|
+
80 /* Identifier */,
|
|
24529
|
+
/*reportAtCurrentPosition*/
|
|
24530
|
+
false
|
|
24531
|
+
) : parseIdentifier()), pos);
|
|
24532
|
+
}
|
|
24533
|
+
while (token() === 81 /* PrivateIdentifier */) {
|
|
24534
|
+
reScanHashToken();
|
|
24535
|
+
nextTokenJSDoc();
|
|
24536
|
+
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), pos);
|
|
24537
|
+
}
|
|
24538
|
+
return name;
|
|
24539
|
+
}
|
|
24540
|
+
return void 0;
|
|
24541
|
+
}
|
|
24533
24542
|
function parseJSDocLinkPrefix() {
|
|
24534
24543
|
skipWhitespaceOrAsterisk();
|
|
24535
24544
|
if (token() === 19 /* OpenBraceToken */ && nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
@@ -25697,7 +25706,7 @@ var libEntries = [
|
|
|
25697
25706
|
["esnext.disposable", "lib.esnext.disposable.d.ts"],
|
|
25698
25707
|
["esnext.bigint", "lib.es2020.bigint.d.ts"],
|
|
25699
25708
|
["esnext.string", "lib.es2022.string.d.ts"],
|
|
25700
|
-
["esnext.promise", "lib.
|
|
25709
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
25701
25710
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
25702
25711
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
25703
25712
|
["decorators", "lib.decorators.d.ts"],
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-dev.
|
|
5
|
+
"version": "5.4.0-dev.20231130",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "7216ee0bb821b4b565d54c52dcbf788a3fdf7062"
|
|
118
118
|
}
|