typescript 5.4.0-dev.20240111 → 5.4.0-dev.20240112
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.esnext.collection.d.ts +29 -0
- package/lib/lib.esnext.d.ts +2 -0
- package/lib/lib.esnext.object.d.ts +29 -0
- package/lib/tsc.js +102 -52
- package/lib/tsserver.js +173 -60
- package/lib/typescript.d.ts +5 -2
- package/lib/typescript.js +174 -60
- package/lib/typingsInstaller.js +4 -2
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/// <reference no-default-lib="true"/>
|
|
18
|
+
|
|
19
|
+
interface MapConstructor {
|
|
20
|
+
/**
|
|
21
|
+
* Groups members of an iterable according to the return value of the passed callback.
|
|
22
|
+
* @param items An iterable.
|
|
23
|
+
* @param keySelector A callback which will be invoked for each item in items.
|
|
24
|
+
*/
|
|
25
|
+
groupBy<K, T>(
|
|
26
|
+
items: Iterable<T>,
|
|
27
|
+
keySelector: (item: T, index: number) => K,
|
|
28
|
+
): Map<K, T[]>;
|
|
29
|
+
}
|
package/lib/lib.esnext.d.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/// <reference no-default-lib="true"/>
|
|
18
|
+
|
|
19
|
+
interface ObjectConstructor {
|
|
20
|
+
/**
|
|
21
|
+
* Groups members of an iterable according to the return value of the passed callback.
|
|
22
|
+
* @param items An iterable.
|
|
23
|
+
* @param keySelector A callback which will be invoked for each item in items.
|
|
24
|
+
*/
|
|
25
|
+
groupBy<K extends PropertyKey, T>(
|
|
26
|
+
items: Iterable<T>,
|
|
27
|
+
keySelector: (item: T, index: number) => K,
|
|
28
|
+
): Partial<Record<K, T[]>>;
|
|
29
|
+
}
|
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-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240112`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -4898,6 +4898,7 @@ var sys = (() => {
|
|
|
4898
4898
|
resolvePath: (path) => _path.resolve(path),
|
|
4899
4899
|
fileExists,
|
|
4900
4900
|
directoryExists,
|
|
4901
|
+
getAccessibleFileSystemEntries,
|
|
4901
4902
|
createDirectory(directoryName) {
|
|
4902
4903
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
4903
4904
|
try {
|
|
@@ -11372,6 +11373,45 @@ function isRestParameter(node) {
|
|
|
11372
11373
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
11373
11374
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
11374
11375
|
}
|
|
11376
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
11377
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
11378
|
+
return comment.includes("@internal");
|
|
11379
|
+
}
|
|
11380
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
11381
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
11382
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
11383
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
11384
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
11385
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
11386
|
+
const text = sourceFile.text;
|
|
11387
|
+
const commentRanges = previousSibling ? concatenate(
|
|
11388
|
+
// to handle
|
|
11389
|
+
// ... parameters, /** @internal */
|
|
11390
|
+
// public param: string
|
|
11391
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
11392
|
+
text,
|
|
11393
|
+
previousSibling.end + 1,
|
|
11394
|
+
/*stopAfterLineBreak*/
|
|
11395
|
+
false,
|
|
11396
|
+
/*stopAtComments*/
|
|
11397
|
+
true
|
|
11398
|
+
)),
|
|
11399
|
+
getLeadingCommentRanges(text, node.pos)
|
|
11400
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
11401
|
+
text,
|
|
11402
|
+
node.pos,
|
|
11403
|
+
/*stopAfterLineBreak*/
|
|
11404
|
+
false,
|
|
11405
|
+
/*stopAtComments*/
|
|
11406
|
+
true
|
|
11407
|
+
));
|
|
11408
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
11409
|
+
}
|
|
11410
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
11411
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
11412
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
11413
|
+
});
|
|
11414
|
+
}
|
|
11375
11415
|
|
|
11376
11416
|
// src/compiler/utilities.ts
|
|
11377
11417
|
var resolvingEmptyArray = [];
|
|
@@ -34068,7 +34108,7 @@ var libEntries = [
|
|
|
34068
34108
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
34069
34109
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
34070
34110
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
34071
|
-
["esnext.collection", "lib.
|
|
34111
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
34072
34112
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
34073
34113
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
34074
34114
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -34078,6 +34118,7 @@ var libEntries = [
|
|
|
34078
34118
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
34079
34119
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
34080
34120
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
34121
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
34081
34122
|
["decorators", "lib.decorators.d.ts"],
|
|
34082
34123
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
34083
34124
|
];
|
|
@@ -44606,7 +44647,12 @@ function createTypeChecker(host) {
|
|
|
44606
44647
|
}
|
|
44607
44648
|
function markAsSynthetic(node) {
|
|
44608
44649
|
setTextRangePosEnd(node, -1, -1);
|
|
44609
|
-
return visitEachChild(
|
|
44650
|
+
return visitEachChild(
|
|
44651
|
+
node,
|
|
44652
|
+
markAsSynthetic,
|
|
44653
|
+
/*context*/
|
|
44654
|
+
void 0
|
|
44655
|
+
);
|
|
44610
44656
|
}
|
|
44611
44657
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
44612
44658
|
getDiagnostics(sourceFile, cancellationToken2);
|
|
@@ -48648,7 +48694,13 @@ function createTypeChecker(host) {
|
|
|
48648
48694
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
48649
48695
|
return node;
|
|
48650
48696
|
}
|
|
48651
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
48697
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
48698
|
+
node,
|
|
48699
|
+
deepCloneOrReuseNode,
|
|
48700
|
+
/*context*/
|
|
48701
|
+
void 0,
|
|
48702
|
+
deepCloneOrReuseNodes
|
|
48703
|
+
)), node);
|
|
48652
48704
|
}
|
|
48653
48705
|
function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
|
|
48654
48706
|
if (nodes && nodes.length === 0) {
|
|
@@ -49370,7 +49422,8 @@ function createTypeChecker(host) {
|
|
|
49370
49422
|
let visited = visitEachChild(
|
|
49371
49423
|
node2,
|
|
49372
49424
|
elideInitializerAndSetEmitFlags,
|
|
49373
|
-
|
|
49425
|
+
/*context*/
|
|
49426
|
+
void 0,
|
|
49374
49427
|
/*nodesVisitor*/
|
|
49375
49428
|
void 0,
|
|
49376
49429
|
elideInitializerAndSetEmitFlags
|
|
@@ -50148,7 +50201,12 @@ function createTypeChecker(host) {
|
|
|
50148
50201
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
50149
50202
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
50150
50203
|
}
|
|
50151
|
-
return visitEachChild(
|
|
50204
|
+
return visitEachChild(
|
|
50205
|
+
node,
|
|
50206
|
+
visitExistingNodeTreeSymbols,
|
|
50207
|
+
/*context*/
|
|
50208
|
+
void 0
|
|
50209
|
+
);
|
|
50152
50210
|
function getEffectiveDotDotDotForParameter(p) {
|
|
50153
50211
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
50154
50212
|
}
|
|
@@ -50248,7 +50306,7 @@ function createTypeChecker(host) {
|
|
|
50248
50306
|
});
|
|
50249
50307
|
let addingDeclare = !bundled;
|
|
50250
50308
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
50251
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
50309
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
50252
50310
|
symbolTable = createSymbolTable();
|
|
50253
50311
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
50254
50312
|
}
|
|
@@ -50705,8 +50763,18 @@ function createTypeChecker(host) {
|
|
|
50705
50763
|
);
|
|
50706
50764
|
}
|
|
50707
50765
|
function getNamespaceMembersForSerialization(symbol) {
|
|
50708
|
-
|
|
50709
|
-
|
|
50766
|
+
let exports2 = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
50767
|
+
const merged = getMergedSymbol(symbol);
|
|
50768
|
+
if (merged !== symbol) {
|
|
50769
|
+
const membersSet = new Set(exports2);
|
|
50770
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
50771
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
50772
|
+
membersSet.add(exported);
|
|
50773
|
+
}
|
|
50774
|
+
}
|
|
50775
|
+
exports2 = arrayFrom(membersSet);
|
|
50776
|
+
}
|
|
50777
|
+
return filter(exports2, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
50710
50778
|
}
|
|
50711
50779
|
function isTypeOnlyNamespace(symbol) {
|
|
50712
50780
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -85645,7 +85713,7 @@ function visitCommaListElements(elements, visitor, discardVisitor = visitor) {
|
|
|
85645
85713
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
85646
85714
|
}, isExpression);
|
|
85647
85715
|
}
|
|
85648
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
85716
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
85649
85717
|
if (node === void 0) {
|
|
85650
85718
|
return void 0;
|
|
85651
85719
|
}
|
|
@@ -99948,12 +100016,22 @@ function transformES2015(context) {
|
|
|
99948
100016
|
case 172 /* PropertyDeclaration */: {
|
|
99949
100017
|
const named = node;
|
|
99950
100018
|
if (isComputedPropertyName(named.name)) {
|
|
99951
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
100019
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
100020
|
+
named.name,
|
|
100021
|
+
elideUnusedThisCaptureWorker,
|
|
100022
|
+
/*context*/
|
|
100023
|
+
void 0
|
|
100024
|
+
));
|
|
99952
100025
|
}
|
|
99953
100026
|
return node;
|
|
99954
100027
|
}
|
|
99955
100028
|
}
|
|
99956
|
-
return visitEachChild(
|
|
100029
|
+
return visitEachChild(
|
|
100030
|
+
node,
|
|
100031
|
+
elideUnusedThisCaptureWorker,
|
|
100032
|
+
/*context*/
|
|
100033
|
+
void 0
|
|
100034
|
+
);
|
|
99957
100035
|
}
|
|
99958
100036
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
99959
100037
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -99989,12 +100067,22 @@ function transformES2015(context) {
|
|
|
99989
100067
|
case 172 /* PropertyDeclaration */: {
|
|
99990
100068
|
const named = node;
|
|
99991
100069
|
if (isComputedPropertyName(named.name)) {
|
|
99992
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
100070
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
100071
|
+
named.name,
|
|
100072
|
+
injectSuperPresenceCheckWorker,
|
|
100073
|
+
/*context*/
|
|
100074
|
+
void 0
|
|
100075
|
+
));
|
|
99993
100076
|
}
|
|
99994
100077
|
return node;
|
|
99995
100078
|
}
|
|
99996
100079
|
}
|
|
99997
|
-
return visitEachChild(
|
|
100080
|
+
return visitEachChild(
|
|
100081
|
+
node,
|
|
100082
|
+
injectSuperPresenceCheckWorker,
|
|
100083
|
+
/*context*/
|
|
100084
|
+
void 0
|
|
100085
|
+
);
|
|
99998
100086
|
}
|
|
99999
100087
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
100000
100088
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -108392,44 +108480,6 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
108392
108480
|
);
|
|
108393
108481
|
return result.diagnostics;
|
|
108394
108482
|
}
|
|
108395
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
108396
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
108397
|
-
return comment.includes("@internal");
|
|
108398
|
-
}
|
|
108399
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
108400
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
108401
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
108402
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
108403
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
108404
|
-
const text = currentSourceFile.text;
|
|
108405
|
-
const commentRanges = previousSibling ? concatenate(
|
|
108406
|
-
// to handle
|
|
108407
|
-
// ... parameters, /** @internal */
|
|
108408
|
-
// public param: string
|
|
108409
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
108410
|
-
text,
|
|
108411
|
-
previousSibling.end + 1,
|
|
108412
|
-
/*stopAfterLineBreak*/
|
|
108413
|
-
false,
|
|
108414
|
-
/*stopAtComments*/
|
|
108415
|
-
true
|
|
108416
|
-
)),
|
|
108417
|
-
getLeadingCommentRanges(text, node.pos)
|
|
108418
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
108419
|
-
text,
|
|
108420
|
-
node.pos,
|
|
108421
|
-
/*stopAfterLineBreak*/
|
|
108422
|
-
false,
|
|
108423
|
-
/*stopAtComments*/
|
|
108424
|
-
true
|
|
108425
|
-
));
|
|
108426
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
108427
|
-
}
|
|
108428
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
108429
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
108430
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
108431
|
-
});
|
|
108432
|
-
}
|
|
108433
108483
|
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
108434
108484
|
function transformDeclarations(context) {
|
|
108435
108485
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
package/lib/tsserver.js
CHANGED
|
@@ -2341,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2341
2341
|
|
|
2342
2342
|
// src/compiler/corePublic.ts
|
|
2343
2343
|
var versionMajorMinor = "5.4";
|
|
2344
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2344
|
+
var version = `${versionMajorMinor}.0-dev.20240112`;
|
|
2345
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2346
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2347
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8448,6 +8448,7 @@ var sys = (() => {
|
|
|
8448
8448
|
resolvePath: (path) => _path.resolve(path),
|
|
8449
8449
|
fileExists,
|
|
8450
8450
|
directoryExists,
|
|
8451
|
+
getAccessibleFileSystemEntries,
|
|
8451
8452
|
createDirectory(directoryName) {
|
|
8452
8453
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
8453
8454
|
try {
|
|
@@ -15132,6 +15133,45 @@ function isRestParameter(node) {
|
|
|
15132
15133
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
15133
15134
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
15134
15135
|
}
|
|
15136
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
15137
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
15138
|
+
return comment.includes("@internal");
|
|
15139
|
+
}
|
|
15140
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
15141
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
15142
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
15143
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
15144
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
15145
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
15146
|
+
const text = sourceFile.text;
|
|
15147
|
+
const commentRanges = previousSibling ? concatenate(
|
|
15148
|
+
// to handle
|
|
15149
|
+
// ... parameters, /** @internal */
|
|
15150
|
+
// public param: string
|
|
15151
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
15152
|
+
text,
|
|
15153
|
+
previousSibling.end + 1,
|
|
15154
|
+
/*stopAfterLineBreak*/
|
|
15155
|
+
false,
|
|
15156
|
+
/*stopAtComments*/
|
|
15157
|
+
true
|
|
15158
|
+
)),
|
|
15159
|
+
getLeadingCommentRanges(text, node.pos)
|
|
15160
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
15161
|
+
text,
|
|
15162
|
+
node.pos,
|
|
15163
|
+
/*stopAfterLineBreak*/
|
|
15164
|
+
false,
|
|
15165
|
+
/*stopAtComments*/
|
|
15166
|
+
true
|
|
15167
|
+
));
|
|
15168
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
15169
|
+
}
|
|
15170
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
15171
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
15172
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
15173
|
+
});
|
|
15174
|
+
}
|
|
15135
15175
|
|
|
15136
15176
|
// src/compiler/utilities.ts
|
|
15137
15177
|
var resolvingEmptyArray = [];
|
|
@@ -38508,7 +38548,7 @@ var libEntries = [
|
|
|
38508
38548
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
38509
38549
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38510
38550
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38511
|
-
["esnext.collection", "lib.
|
|
38551
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38512
38552
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38513
38553
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38514
38554
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38518,6 +38558,7 @@ var libEntries = [
|
|
|
38518
38558
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38519
38559
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38520
38560
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38561
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38521
38562
|
["decorators", "lib.decorators.d.ts"],
|
|
38522
38563
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38523
38564
|
];
|
|
@@ -49346,7 +49387,12 @@ function createTypeChecker(host) {
|
|
|
49346
49387
|
}
|
|
49347
49388
|
function markAsSynthetic(node) {
|
|
49348
49389
|
setTextRangePosEnd(node, -1, -1);
|
|
49349
|
-
return visitEachChild(
|
|
49390
|
+
return visitEachChild(
|
|
49391
|
+
node,
|
|
49392
|
+
markAsSynthetic,
|
|
49393
|
+
/*context*/
|
|
49394
|
+
void 0
|
|
49395
|
+
);
|
|
49350
49396
|
}
|
|
49351
49397
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
49352
49398
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -53388,7 +53434,13 @@ function createTypeChecker(host) {
|
|
|
53388
53434
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
53389
53435
|
return node;
|
|
53390
53436
|
}
|
|
53391
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53437
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53438
|
+
node,
|
|
53439
|
+
deepCloneOrReuseNode,
|
|
53440
|
+
/*context*/
|
|
53441
|
+
void 0,
|
|
53442
|
+
deepCloneOrReuseNodes
|
|
53443
|
+
)), node);
|
|
53392
53444
|
}
|
|
53393
53445
|
function deepCloneOrReuseNodes(nodes, visitor, test, start2, count) {
|
|
53394
53446
|
if (nodes && nodes.length === 0) {
|
|
@@ -54110,7 +54162,8 @@ function createTypeChecker(host) {
|
|
|
54110
54162
|
let visited = visitEachChild(
|
|
54111
54163
|
node2,
|
|
54112
54164
|
elideInitializerAndSetEmitFlags,
|
|
54113
|
-
|
|
54165
|
+
/*context*/
|
|
54166
|
+
void 0,
|
|
54114
54167
|
/*nodesVisitor*/
|
|
54115
54168
|
void 0,
|
|
54116
54169
|
elideInitializerAndSetEmitFlags
|
|
@@ -54888,7 +54941,12 @@ function createTypeChecker(host) {
|
|
|
54888
54941
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
54889
54942
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
54890
54943
|
}
|
|
54891
|
-
return visitEachChild(
|
|
54944
|
+
return visitEachChild(
|
|
54945
|
+
node,
|
|
54946
|
+
visitExistingNodeTreeSymbols,
|
|
54947
|
+
/*context*/
|
|
54948
|
+
void 0
|
|
54949
|
+
);
|
|
54892
54950
|
function getEffectiveDotDotDotForParameter(p) {
|
|
54893
54951
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
54894
54952
|
}
|
|
@@ -54988,7 +55046,7 @@ function createTypeChecker(host) {
|
|
|
54988
55046
|
});
|
|
54989
55047
|
let addingDeclare = !bundled;
|
|
54990
55048
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
54991
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
55049
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
54992
55050
|
symbolTable = createSymbolTable();
|
|
54993
55051
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
54994
55052
|
}
|
|
@@ -55445,8 +55503,18 @@ function createTypeChecker(host) {
|
|
|
55445
55503
|
);
|
|
55446
55504
|
}
|
|
55447
55505
|
function getNamespaceMembersForSerialization(symbol) {
|
|
55448
|
-
|
|
55449
|
-
|
|
55506
|
+
let exports2 = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
55507
|
+
const merged = getMergedSymbol(symbol);
|
|
55508
|
+
if (merged !== symbol) {
|
|
55509
|
+
const membersSet = new Set(exports2);
|
|
55510
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
55511
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
55512
|
+
membersSet.add(exported);
|
|
55513
|
+
}
|
|
55514
|
+
}
|
|
55515
|
+
exports2 = arrayFrom(membersSet);
|
|
55516
|
+
}
|
|
55517
|
+
return filter(exports2, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
55450
55518
|
}
|
|
55451
55519
|
function isTypeOnlyNamespace(symbol) {
|
|
55452
55520
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -90385,7 +90453,7 @@ function visitCommaListElements(elements, visitor, discardVisitor = visitor) {
|
|
|
90385
90453
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
90386
90454
|
}, isExpression);
|
|
90387
90455
|
}
|
|
90388
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90456
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90389
90457
|
if (node === void 0) {
|
|
90390
90458
|
return void 0;
|
|
90391
90459
|
}
|
|
@@ -104859,12 +104927,22 @@ function transformES2015(context) {
|
|
|
104859
104927
|
case 172 /* PropertyDeclaration */: {
|
|
104860
104928
|
const named = node;
|
|
104861
104929
|
if (isComputedPropertyName(named.name)) {
|
|
104862
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
104930
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
104931
|
+
named.name,
|
|
104932
|
+
elideUnusedThisCaptureWorker,
|
|
104933
|
+
/*context*/
|
|
104934
|
+
void 0
|
|
104935
|
+
));
|
|
104863
104936
|
}
|
|
104864
104937
|
return node;
|
|
104865
104938
|
}
|
|
104866
104939
|
}
|
|
104867
|
-
return visitEachChild(
|
|
104940
|
+
return visitEachChild(
|
|
104941
|
+
node,
|
|
104942
|
+
elideUnusedThisCaptureWorker,
|
|
104943
|
+
/*context*/
|
|
104944
|
+
void 0
|
|
104945
|
+
);
|
|
104868
104946
|
}
|
|
104869
104947
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
104870
104948
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -104900,12 +104978,22 @@ function transformES2015(context) {
|
|
|
104900
104978
|
case 172 /* PropertyDeclaration */: {
|
|
104901
104979
|
const named = node;
|
|
104902
104980
|
if (isComputedPropertyName(named.name)) {
|
|
104903
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
104981
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
104982
|
+
named.name,
|
|
104983
|
+
injectSuperPresenceCheckWorker,
|
|
104984
|
+
/*context*/
|
|
104985
|
+
void 0
|
|
104986
|
+
));
|
|
104904
104987
|
}
|
|
104905
104988
|
return node;
|
|
104906
104989
|
}
|
|
104907
104990
|
}
|
|
104908
|
-
return visitEachChild(
|
|
104991
|
+
return visitEachChild(
|
|
104992
|
+
node,
|
|
104993
|
+
injectSuperPresenceCheckWorker,
|
|
104994
|
+
/*context*/
|
|
104995
|
+
void 0
|
|
104996
|
+
);
|
|
104909
104997
|
}
|
|
104910
104998
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
104911
104999
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -113303,44 +113391,6 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
113303
113391
|
);
|
|
113304
113392
|
return result.diagnostics;
|
|
113305
113393
|
}
|
|
113306
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
113307
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
113308
|
-
return comment.includes("@internal");
|
|
113309
|
-
}
|
|
113310
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
113311
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
113312
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
113313
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
113314
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
113315
|
-
const text = currentSourceFile.text;
|
|
113316
|
-
const commentRanges = previousSibling ? concatenate(
|
|
113317
|
-
// to handle
|
|
113318
|
-
// ... parameters, /** @internal */
|
|
113319
|
-
// public param: string
|
|
113320
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
113321
|
-
text,
|
|
113322
|
-
previousSibling.end + 1,
|
|
113323
|
-
/*stopAfterLineBreak*/
|
|
113324
|
-
false,
|
|
113325
|
-
/*stopAtComments*/
|
|
113326
|
-
true
|
|
113327
|
-
)),
|
|
113328
|
-
getLeadingCommentRanges(text, node.pos)
|
|
113329
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
113330
|
-
text,
|
|
113331
|
-
node.pos,
|
|
113332
|
-
/*stopAfterLineBreak*/
|
|
113333
|
-
false,
|
|
113334
|
-
/*stopAtComments*/
|
|
113335
|
-
true
|
|
113336
|
-
));
|
|
113337
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
113338
|
-
}
|
|
113339
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
113340
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
113341
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
113342
|
-
});
|
|
113343
|
-
}
|
|
113344
113394
|
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
113345
113395
|
function transformDeclarations(context) {
|
|
113346
113396
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
@@ -134712,7 +134762,14 @@ function getSynthesizedDeepCloneWorker(node, replaceNode) {
|
|
|
134712
134762
|
true,
|
|
134713
134763
|
replaceNode
|
|
134714
134764
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
134715
|
-
const visited = visitEachChild(
|
|
134765
|
+
const visited = visitEachChild(
|
|
134766
|
+
node,
|
|
134767
|
+
nodeClone,
|
|
134768
|
+
/*context*/
|
|
134769
|
+
void 0,
|
|
134770
|
+
nodesClone,
|
|
134771
|
+
nodeClone
|
|
134772
|
+
);
|
|
134716
134773
|
if (visited === node) {
|
|
134717
134774
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
134718
134775
|
return setTextRange(clone2, node);
|
|
@@ -144497,7 +144554,12 @@ function transformFunctionBody(body, exposedVariableDeclarations, writes, substi
|
|
|
144497
144554
|
const oldIgnoreReturns = ignoreReturns;
|
|
144498
144555
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
144499
144556
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144500
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144557
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144558
|
+
node,
|
|
144559
|
+
visitor,
|
|
144560
|
+
/*context*/
|
|
144561
|
+
void 0
|
|
144562
|
+
);
|
|
144501
144563
|
ignoreReturns = oldIgnoreReturns;
|
|
144502
144564
|
return result;
|
|
144503
144565
|
}
|
|
@@ -144507,7 +144569,12 @@ function transformConstantInitializer(initializer, substitutions) {
|
|
|
144507
144569
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
144508
144570
|
function visitor(node) {
|
|
144509
144571
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144510
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144572
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144573
|
+
node,
|
|
144574
|
+
visitor,
|
|
144575
|
+
/*context*/
|
|
144576
|
+
void 0
|
|
144577
|
+
);
|
|
144511
144578
|
}
|
|
144512
144579
|
}
|
|
144513
144580
|
function getStatementsOrClassElements(scope) {
|
|
@@ -149276,7 +149343,12 @@ function transformJSDocType(node) {
|
|
|
149276
149343
|
case 329 /* JSDocTypeLiteral */:
|
|
149277
149344
|
return transformJSDocTypeLiteral(node);
|
|
149278
149345
|
default:
|
|
149279
|
-
const visited = visitEachChild(
|
|
149346
|
+
const visited = visitEachChild(
|
|
149347
|
+
node,
|
|
149348
|
+
transformJSDocType,
|
|
149349
|
+
/*context*/
|
|
149350
|
+
void 0
|
|
149351
|
+
);
|
|
149280
149352
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
149281
149353
|
return visited;
|
|
149282
149354
|
}
|
|
@@ -157405,7 +157477,12 @@ function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget)
|
|
|
157405
157477
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
157406
157478
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
157407
157479
|
}
|
|
157408
|
-
return visitEachChild(
|
|
157480
|
+
return visitEachChild(
|
|
157481
|
+
node,
|
|
157482
|
+
visit,
|
|
157483
|
+
/*context*/
|
|
157484
|
+
void 0
|
|
157485
|
+
);
|
|
157409
157486
|
}
|
|
157410
157487
|
}
|
|
157411
157488
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -163923,6 +164000,11 @@ function getContextNode(node) {
|
|
|
163923
164000
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163924
164001
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163925
164002
|
) : node;
|
|
164003
|
+
case 255 /* SwitchStatement */:
|
|
164004
|
+
return {
|
|
164005
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
164006
|
+
end: node.caseBlock
|
|
164007
|
+
};
|
|
163926
164008
|
default:
|
|
163927
164009
|
return node;
|
|
163928
164010
|
}
|
|
@@ -164223,6 +164305,9 @@ function getTextSpan(node, sourceFile, endNode2) {
|
|
|
164223
164305
|
start2 += 1;
|
|
164224
164306
|
end -= 1;
|
|
164225
164307
|
}
|
|
164308
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
164309
|
+
end = endNode2.getFullStart();
|
|
164310
|
+
}
|
|
164226
164311
|
return createTextSpanFromBounds(start2, end);
|
|
164227
164312
|
}
|
|
164228
164313
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165778,9 +165863,20 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
165778
165863
|
void 0
|
|
165779
165864
|
)] : void 0;
|
|
165780
165865
|
}
|
|
165781
|
-
|
|
165782
|
-
|
|
165783
|
-
|
|
165866
|
+
switch (node.kind) {
|
|
165867
|
+
case 107 /* ReturnKeyword */:
|
|
165868
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165869
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165870
|
+
case 90 /* DefaultKeyword */:
|
|
165871
|
+
if (!isDefaultClause(node.parent)) {
|
|
165872
|
+
break;
|
|
165873
|
+
}
|
|
165874
|
+
case 84 /* CaseKeyword */:
|
|
165875
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165876
|
+
if (switchStatement) {
|
|
165877
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165878
|
+
}
|
|
165879
|
+
break;
|
|
165784
165880
|
}
|
|
165785
165881
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165786
165882
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -166198,6 +166294,23 @@ function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolNa
|
|
|
166198
166294
|
failedAliasResolution
|
|
166199
166295
|
};
|
|
166200
166296
|
}
|
|
166297
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
166298
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
166299
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
166300
|
+
return {
|
|
166301
|
+
fileName: sourceFile.fileName,
|
|
166302
|
+
textSpan,
|
|
166303
|
+
kind: "keyword" /* keyword */,
|
|
166304
|
+
name: "switch",
|
|
166305
|
+
containerKind: void 0,
|
|
166306
|
+
containerName: "",
|
|
166307
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
166308
|
+
isLocal: true,
|
|
166309
|
+
isAmbient: false,
|
|
166310
|
+
unverified: false,
|
|
166311
|
+
failedAliasResolution: void 0
|
|
166312
|
+
};
|
|
166313
|
+
}
|
|
166201
166314
|
function isDefinitionVisible(checker, declaration) {
|
|
166202
166315
|
if (checker.isDeclarationVisible(declaration))
|
|
166203
166316
|
return true;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -9198,6 +9198,7 @@ declare namespace ts {
|
|
|
9198
9198
|
function isForInitializer(node: Node): node is ForInitializer;
|
|
9199
9199
|
function isModuleBody(node: Node): node is ModuleBody;
|
|
9200
9200
|
function isNamedImportBindings(node: Node): node is NamedImportBindings;
|
|
9201
|
+
function isDeclarationStatement(node: Node): node is DeclarationStatement;
|
|
9201
9202
|
function isStatement(node: Node): node is Statement;
|
|
9202
9203
|
function isModuleReference(node: Node): node is ModuleReference;
|
|
9203
9204
|
function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression;
|
|
@@ -9217,11 +9218,13 @@ declare namespace ts {
|
|
|
9217
9218
|
function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain;
|
|
9218
9219
|
function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean;
|
|
9219
9220
|
function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean;
|
|
9221
|
+
function isInternalDeclaration(node: Node, sourceFile?: SourceFile): boolean;
|
|
9220
9222
|
const unchangedTextChangeRange: TextChangeRange;
|
|
9221
9223
|
type ParameterPropertyDeclaration = ParameterDeclaration & {
|
|
9222
9224
|
parent: ConstructorDeclaration;
|
|
9223
9225
|
name: Identifier;
|
|
9224
9226
|
};
|
|
9227
|
+
function isPartOfTypeNode(node: Node): boolean;
|
|
9225
9228
|
/**
|
|
9226
9229
|
* This function checks multiple locations for JSDoc comments that apply to a host node.
|
|
9227
9230
|
* At each location, the whole comment may apply to the node, or only a specific tag in
|
|
@@ -9860,7 +9863,7 @@ declare namespace ts {
|
|
|
9860
9863
|
* @param visitor The callback used to visit each child.
|
|
9861
9864
|
* @param context A lexical environment context for the visitor.
|
|
9862
9865
|
*/
|
|
9863
|
-
function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
|
|
9866
|
+
function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext | undefined): T;
|
|
9864
9867
|
/**
|
|
9865
9868
|
* Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
|
|
9866
9869
|
*
|
|
@@ -9868,7 +9871,7 @@ declare namespace ts {
|
|
|
9868
9871
|
* @param visitor The callback used to visit each child.
|
|
9869
9872
|
* @param context A lexical environment context for the visitor.
|
|
9870
9873
|
*/
|
|
9871
|
-
function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
|
|
9874
|
+
function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext | undefined, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
|
|
9872
9875
|
function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
|
|
9873
9876
|
function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[];
|
|
9874
9877
|
function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
|
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.20240112`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6206,6 +6206,7 @@ ${lanes.join("\n")}
|
|
|
6206
6206
|
resolvePath: (path) => _path.resolve(path),
|
|
6207
6207
|
fileExists,
|
|
6208
6208
|
directoryExists,
|
|
6209
|
+
getAccessibleFileSystemEntries,
|
|
6209
6210
|
createDirectory(directoryName) {
|
|
6210
6211
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
6211
6212
|
try {
|
|
@@ -12907,6 +12908,45 @@ ${lanes.join("\n")}
|
|
|
12907
12908
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
12908
12909
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
12909
12910
|
}
|
|
12911
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
12912
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
12913
|
+
return comment.includes("@internal");
|
|
12914
|
+
}
|
|
12915
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
12916
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
12917
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
12918
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
12919
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
12920
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
12921
|
+
const text = sourceFile.text;
|
|
12922
|
+
const commentRanges = previousSibling ? concatenate(
|
|
12923
|
+
// to handle
|
|
12924
|
+
// ... parameters, /** @internal */
|
|
12925
|
+
// public param: string
|
|
12926
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
12927
|
+
text,
|
|
12928
|
+
previousSibling.end + 1,
|
|
12929
|
+
/*stopAfterLineBreak*/
|
|
12930
|
+
false,
|
|
12931
|
+
/*stopAtComments*/
|
|
12932
|
+
true
|
|
12933
|
+
)),
|
|
12934
|
+
getLeadingCommentRanges(text, node.pos)
|
|
12935
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
12936
|
+
text,
|
|
12937
|
+
node.pos,
|
|
12938
|
+
/*stopAfterLineBreak*/
|
|
12939
|
+
false,
|
|
12940
|
+
/*stopAtComments*/
|
|
12941
|
+
true
|
|
12942
|
+
));
|
|
12943
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
12944
|
+
}
|
|
12945
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
12946
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
12947
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
12948
|
+
});
|
|
12949
|
+
}
|
|
12910
12950
|
var unchangedTextChangeRange, supportedLocaleDirectories, MAX_SMI_X86;
|
|
12911
12951
|
var init_utilitiesPublic = __esm({
|
|
12912
12952
|
"src/compiler/utilitiesPublic.ts"() {
|
|
@@ -38002,7 +38042,7 @@ ${lanes.join("\n")}
|
|
|
38002
38042
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
38003
38043
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38004
38044
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38005
|
-
["esnext.collection", "lib.
|
|
38045
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38006
38046
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38007
38047
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38008
38048
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38012,6 +38052,7 @@ ${lanes.join("\n")}
|
|
|
38012
38052
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38013
38053
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38014
38054
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38055
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38015
38056
|
["decorators", "lib.decorators.d.ts"],
|
|
38016
38057
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38017
38058
|
];
|
|
@@ -47100,7 +47141,12 @@ ${lanes.join("\n")}
|
|
|
47100
47141
|
}
|
|
47101
47142
|
function markAsSynthetic(node) {
|
|
47102
47143
|
setTextRangePosEnd(node, -1, -1);
|
|
47103
|
-
return visitEachChild(
|
|
47144
|
+
return visitEachChild(
|
|
47145
|
+
node,
|
|
47146
|
+
markAsSynthetic,
|
|
47147
|
+
/*context*/
|
|
47148
|
+
void 0
|
|
47149
|
+
);
|
|
47104
47150
|
}
|
|
47105
47151
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
47106
47152
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -51142,7 +51188,13 @@ ${lanes.join("\n")}
|
|
|
51142
51188
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
51143
51189
|
return node;
|
|
51144
51190
|
}
|
|
51145
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51191
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51192
|
+
node,
|
|
51193
|
+
deepCloneOrReuseNode,
|
|
51194
|
+
/*context*/
|
|
51195
|
+
void 0,
|
|
51196
|
+
deepCloneOrReuseNodes
|
|
51197
|
+
)), node);
|
|
51146
51198
|
}
|
|
51147
51199
|
function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
|
|
51148
51200
|
if (nodes && nodes.length === 0) {
|
|
@@ -51864,7 +51916,8 @@ ${lanes.join("\n")}
|
|
|
51864
51916
|
let visited = visitEachChild(
|
|
51865
51917
|
node2,
|
|
51866
51918
|
elideInitializerAndSetEmitFlags,
|
|
51867
|
-
|
|
51919
|
+
/*context*/
|
|
51920
|
+
void 0,
|
|
51868
51921
|
/*nodesVisitor*/
|
|
51869
51922
|
void 0,
|
|
51870
51923
|
elideInitializerAndSetEmitFlags
|
|
@@ -52642,7 +52695,12 @@ ${lanes.join("\n")}
|
|
|
52642
52695
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
52643
52696
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
52644
52697
|
}
|
|
52645
|
-
return visitEachChild(
|
|
52698
|
+
return visitEachChild(
|
|
52699
|
+
node,
|
|
52700
|
+
visitExistingNodeTreeSymbols,
|
|
52701
|
+
/*context*/
|
|
52702
|
+
void 0
|
|
52703
|
+
);
|
|
52646
52704
|
function getEffectiveDotDotDotForParameter(p) {
|
|
52647
52705
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
52648
52706
|
}
|
|
@@ -52742,7 +52800,7 @@ ${lanes.join("\n")}
|
|
|
52742
52800
|
});
|
|
52743
52801
|
let addingDeclare = !bundled;
|
|
52744
52802
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
52745
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
52803
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
52746
52804
|
symbolTable = createSymbolTable();
|
|
52747
52805
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
52748
52806
|
}
|
|
@@ -53199,8 +53257,18 @@ ${lanes.join("\n")}
|
|
|
53199
53257
|
);
|
|
53200
53258
|
}
|
|
53201
53259
|
function getNamespaceMembersForSerialization(symbol) {
|
|
53202
|
-
|
|
53203
|
-
|
|
53260
|
+
let exports = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
53261
|
+
const merged = getMergedSymbol(symbol);
|
|
53262
|
+
if (merged !== symbol) {
|
|
53263
|
+
const membersSet = new Set(exports);
|
|
53264
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
53265
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
53266
|
+
membersSet.add(exported);
|
|
53267
|
+
}
|
|
53268
|
+
}
|
|
53269
|
+
exports = arrayFrom(membersSet);
|
|
53270
|
+
}
|
|
53271
|
+
return filter(exports, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
53204
53272
|
}
|
|
53205
53273
|
function isTypeOnlyNamespace(symbol) {
|
|
53206
53274
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -88272,7 +88340,7 @@ ${lanes.join("\n")}
|
|
|
88272
88340
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
88273
88341
|
}, isExpression);
|
|
88274
88342
|
}
|
|
88275
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88343
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88276
88344
|
if (node === void 0) {
|
|
88277
88345
|
return void 0;
|
|
88278
88346
|
}
|
|
@@ -102874,12 +102942,22 @@ ${lanes.join("\n")}
|
|
|
102874
102942
|
case 172 /* PropertyDeclaration */: {
|
|
102875
102943
|
const named = node;
|
|
102876
102944
|
if (isComputedPropertyName(named.name)) {
|
|
102877
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
102945
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
102946
|
+
named.name,
|
|
102947
|
+
elideUnusedThisCaptureWorker,
|
|
102948
|
+
/*context*/
|
|
102949
|
+
void 0
|
|
102950
|
+
));
|
|
102878
102951
|
}
|
|
102879
102952
|
return node;
|
|
102880
102953
|
}
|
|
102881
102954
|
}
|
|
102882
|
-
return visitEachChild(
|
|
102955
|
+
return visitEachChild(
|
|
102956
|
+
node,
|
|
102957
|
+
elideUnusedThisCaptureWorker,
|
|
102958
|
+
/*context*/
|
|
102959
|
+
void 0
|
|
102960
|
+
);
|
|
102883
102961
|
}
|
|
102884
102962
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
102885
102963
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -102915,12 +102993,22 @@ ${lanes.join("\n")}
|
|
|
102915
102993
|
case 172 /* PropertyDeclaration */: {
|
|
102916
102994
|
const named = node;
|
|
102917
102995
|
if (isComputedPropertyName(named.name)) {
|
|
102918
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
102996
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
102997
|
+
named.name,
|
|
102998
|
+
injectSuperPresenceCheckWorker,
|
|
102999
|
+
/*context*/
|
|
103000
|
+
void 0
|
|
103001
|
+
));
|
|
102919
103002
|
}
|
|
102920
103003
|
return node;
|
|
102921
103004
|
}
|
|
102922
103005
|
}
|
|
102923
|
-
return visitEachChild(
|
|
103006
|
+
return visitEachChild(
|
|
103007
|
+
node,
|
|
103008
|
+
injectSuperPresenceCheckWorker,
|
|
103009
|
+
/*context*/
|
|
103010
|
+
void 0
|
|
103011
|
+
);
|
|
102924
103012
|
}
|
|
102925
103013
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
102926
103014
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -111367,44 +111455,6 @@ ${lanes.join("\n")}
|
|
|
111367
111455
|
);
|
|
111368
111456
|
return result.diagnostics;
|
|
111369
111457
|
}
|
|
111370
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111371
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111372
|
-
return comment.includes("@internal");
|
|
111373
|
-
}
|
|
111374
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
111375
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
111376
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
111377
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
111378
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
111379
|
-
const text = currentSourceFile.text;
|
|
111380
|
-
const commentRanges = previousSibling ? concatenate(
|
|
111381
|
-
// to handle
|
|
111382
|
-
// ... parameters, /** @internal */
|
|
111383
|
-
// public param: string
|
|
111384
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
111385
|
-
text,
|
|
111386
|
-
previousSibling.end + 1,
|
|
111387
|
-
/*stopAfterLineBreak*/
|
|
111388
|
-
false,
|
|
111389
|
-
/*stopAtComments*/
|
|
111390
|
-
true
|
|
111391
|
-
)),
|
|
111392
|
-
getLeadingCommentRanges(text, node.pos)
|
|
111393
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
111394
|
-
text,
|
|
111395
|
-
node.pos,
|
|
111396
|
-
/*stopAfterLineBreak*/
|
|
111397
|
-
false,
|
|
111398
|
-
/*stopAtComments*/
|
|
111399
|
-
true
|
|
111400
|
-
));
|
|
111401
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
111402
|
-
}
|
|
111403
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
111404
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
111405
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
111406
|
-
});
|
|
111407
|
-
}
|
|
111408
111458
|
function transformDeclarations(context) {
|
|
111409
111459
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
111410
111460
|
let getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
|
@@ -132964,7 +133014,14 @@ ${lanes.join("\n")}
|
|
|
132964
133014
|
true,
|
|
132965
133015
|
replaceNode
|
|
132966
133016
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
132967
|
-
const visited = visitEachChild(
|
|
133017
|
+
const visited = visitEachChild(
|
|
133018
|
+
node,
|
|
133019
|
+
nodeClone,
|
|
133020
|
+
/*context*/
|
|
133021
|
+
void 0,
|
|
133022
|
+
nodesClone,
|
|
133023
|
+
nodeClone
|
|
133024
|
+
);
|
|
132968
133025
|
if (visited === node) {
|
|
132969
133026
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
132970
133027
|
return setTextRange(clone2, node);
|
|
@@ -142921,7 +142978,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142921
142978
|
const oldIgnoreReturns = ignoreReturns;
|
|
142922
142979
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
142923
142980
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142924
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142981
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142982
|
+
node,
|
|
142983
|
+
visitor,
|
|
142984
|
+
/*context*/
|
|
142985
|
+
void 0
|
|
142986
|
+
);
|
|
142925
142987
|
ignoreReturns = oldIgnoreReturns;
|
|
142926
142988
|
return result;
|
|
142927
142989
|
}
|
|
@@ -142931,7 +142993,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142931
142993
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
142932
142994
|
function visitor(node) {
|
|
142933
142995
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142934
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142996
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142997
|
+
node,
|
|
142998
|
+
visitor,
|
|
142999
|
+
/*context*/
|
|
143000
|
+
void 0
|
|
143001
|
+
);
|
|
142935
143002
|
}
|
|
142936
143003
|
}
|
|
142937
143004
|
function getStatementsOrClassElements(scope) {
|
|
@@ -147942,7 +148009,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
147942
148009
|
case 329 /* JSDocTypeLiteral */:
|
|
147943
148010
|
return transformJSDocTypeLiteral(node);
|
|
147944
148011
|
default:
|
|
147945
|
-
const visited = visitEachChild(
|
|
148012
|
+
const visited = visitEachChild(
|
|
148013
|
+
node,
|
|
148014
|
+
transformJSDocType,
|
|
148015
|
+
/*context*/
|
|
148016
|
+
void 0
|
|
148017
|
+
);
|
|
147946
148018
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
147947
148019
|
return visited;
|
|
147948
148020
|
}
|
|
@@ -156433,7 +156505,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156433
156505
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
156434
156506
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
156435
156507
|
}
|
|
156436
|
-
return visitEachChild(
|
|
156508
|
+
return visitEachChild(
|
|
156509
|
+
node,
|
|
156510
|
+
visit,
|
|
156511
|
+
/*context*/
|
|
156512
|
+
void 0
|
|
156513
|
+
);
|
|
156437
156514
|
}
|
|
156438
156515
|
}
|
|
156439
156516
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -163192,6 +163269,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163192
163269
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163193
163270
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163194
163271
|
) : node;
|
|
163272
|
+
case 255 /* SwitchStatement */:
|
|
163273
|
+
return {
|
|
163274
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
163275
|
+
end: node.caseBlock
|
|
163276
|
+
};
|
|
163195
163277
|
default:
|
|
163196
163278
|
return node;
|
|
163197
163279
|
}
|
|
@@ -163486,6 +163568,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163486
163568
|
start += 1;
|
|
163487
163569
|
end -= 1;
|
|
163488
163570
|
}
|
|
163571
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
163572
|
+
end = endNode2.getFullStart();
|
|
163573
|
+
}
|
|
163489
163574
|
return createTextSpanFromBounds(start, end);
|
|
163490
163575
|
}
|
|
163491
163576
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165096,9 +165181,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165096
165181
|
void 0
|
|
165097
165182
|
)] : void 0;
|
|
165098
165183
|
}
|
|
165099
|
-
|
|
165100
|
-
|
|
165101
|
-
|
|
165184
|
+
switch (node.kind) {
|
|
165185
|
+
case 107 /* ReturnKeyword */:
|
|
165186
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165187
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165188
|
+
case 90 /* DefaultKeyword */:
|
|
165189
|
+
if (!isDefaultClause(node.parent)) {
|
|
165190
|
+
break;
|
|
165191
|
+
}
|
|
165192
|
+
case 84 /* CaseKeyword */:
|
|
165193
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165194
|
+
if (switchStatement) {
|
|
165195
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165196
|
+
}
|
|
165197
|
+
break;
|
|
165102
165198
|
}
|
|
165103
165199
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165104
165200
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -165495,6 +165591,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165495
165591
|
failedAliasResolution
|
|
165496
165592
|
};
|
|
165497
165593
|
}
|
|
165594
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
165595
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
165596
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
165597
|
+
return {
|
|
165598
|
+
fileName: sourceFile.fileName,
|
|
165599
|
+
textSpan,
|
|
165600
|
+
kind: "keyword" /* keyword */,
|
|
165601
|
+
name: "switch",
|
|
165602
|
+
containerKind: void 0,
|
|
165603
|
+
containerName: "",
|
|
165604
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
165605
|
+
isLocal: true,
|
|
165606
|
+
isAmbient: false,
|
|
165607
|
+
unverified: false,
|
|
165608
|
+
failedAliasResolution: void 0
|
|
165609
|
+
};
|
|
165610
|
+
}
|
|
165498
165611
|
function isDefinitionVisible(checker, declaration) {
|
|
165499
165612
|
if (checker.isDeclarationVisible(declaration))
|
|
165500
165613
|
return true;
|
|
@@ -165572,6 +165685,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165572
165685
|
"src/services/goToDefinition.ts"() {
|
|
165573
165686
|
"use strict";
|
|
165574
165687
|
init_ts4();
|
|
165688
|
+
init_ts_FindAllReferences();
|
|
165575
165689
|
typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([
|
|
165576
165690
|
"Array",
|
|
165577
165691
|
"ArrayLike",
|
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.20240112`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -4311,6 +4311,7 @@ var sys = (() => {
|
|
|
4311
4311
|
resolvePath: (path2) => _path.resolve(path2),
|
|
4312
4312
|
fileExists,
|
|
4313
4313
|
directoryExists,
|
|
4314
|
+
getAccessibleFileSystemEntries,
|
|
4314
4315
|
createDirectory(directoryName) {
|
|
4315
4316
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
4316
4317
|
try {
|
|
@@ -25933,7 +25934,7 @@ var libEntries = [
|
|
|
25933
25934
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
25934
25935
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
25935
25936
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
25936
|
-
["esnext.collection", "lib.
|
|
25937
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
25937
25938
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
25938
25939
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
25939
25940
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -25943,6 +25944,7 @@ var libEntries = [
|
|
|
25943
25944
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
25944
25945
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
25945
25946
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
25947
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
25946
25948
|
["decorators", "lib.decorators.d.ts"],
|
|
25947
25949
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
25948
25950
|
];
|
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.20240112",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "7f3e34b02203c3cf5d9fa14370f47d7dce4cac06"
|
|
117
117
|
}
|