typescript 5.5.0-dev.20240325 → 5.5.0-dev.20240327
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 +275 -115
- package/lib/tsserver.js +2 -2
- package/lib/typescript.d.ts +20 -9
- package/lib/typescript.js +336 -159
- 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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240327`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3346,12 +3346,13 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3346
3346
|
SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 348] = "JSDocPropertyTag";
|
|
3347
3347
|
SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 349] = "JSDocThrowsTag";
|
|
3348
3348
|
SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 350] = "JSDocSatisfiesTag";
|
|
3349
|
-
SyntaxKind4[SyntaxKind4["
|
|
3350
|
-
SyntaxKind4[SyntaxKind4["
|
|
3351
|
-
SyntaxKind4[SyntaxKind4["
|
|
3352
|
-
SyntaxKind4[SyntaxKind4["
|
|
3353
|
-
SyntaxKind4[SyntaxKind4["
|
|
3354
|
-
SyntaxKind4[SyntaxKind4["
|
|
3349
|
+
SyntaxKind4[SyntaxKind4["JSDocImportTag"] = 351] = "JSDocImportTag";
|
|
3350
|
+
SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
|
|
3351
|
+
SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
|
|
3352
|
+
SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
|
|
3353
|
+
SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
|
|
3354
|
+
SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 356] = "SyntheticReferenceExpression";
|
|
3355
|
+
SyntaxKind4[SyntaxKind4["Count"] = 357] = "Count";
|
|
3355
3356
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
|
|
3356
3357
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
|
|
3357
3358
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -3380,9 +3381,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3380
3381
|
SyntaxKind4[SyntaxKind4["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
|
|
3381
3382
|
SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
|
|
3382
3383
|
SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 309 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
3383
|
-
SyntaxKind4[SyntaxKind4["LastJSDocNode"] =
|
|
3384
|
+
SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 351 /* JSDocImportTag */] = "LastJSDocNode";
|
|
3384
3385
|
SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 327 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
3385
|
-
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] =
|
|
3386
|
+
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 351 /* JSDocImportTag */] = "LastJSDocTagNode";
|
|
3386
3387
|
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
3387
3388
|
SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
|
|
3388
3389
|
return SyntaxKind4;
|
|
@@ -4136,14 +4137,17 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
4136
4137
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
4137
4138
|
}
|
|
4138
4139
|
}
|
|
4139
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
4140
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
|
|
4140
4141
|
const fileWatcherCallbacks = createMultiMap();
|
|
4142
|
+
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
|
|
4141
4143
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
4142
4144
|
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
4143
4145
|
return nonPollingWatchFile;
|
|
4144
4146
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
4145
4147
|
const filePath = toCanonicalName(fileName);
|
|
4146
|
-
fileWatcherCallbacks.add(filePath, callback)
|
|
4148
|
+
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
|
|
4149
|
+
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
4150
|
+
}
|
|
4147
4151
|
const dirPath = getDirectoryPath(filePath) || ".";
|
|
4148
4152
|
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
|
|
4149
4153
|
watcher.referenceCount++;
|
|
@@ -4163,14 +4167,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
|
|
|
4163
4167
|
const watcher = fsWatch(
|
|
4164
4168
|
dirName,
|
|
4165
4169
|
1 /* Directory */,
|
|
4166
|
-
(
|
|
4170
|
+
(eventName, relativeFileName) => {
|
|
4167
4171
|
if (!isString(relativeFileName))
|
|
4168
4172
|
return;
|
|
4169
4173
|
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
|
|
4170
|
-
const
|
|
4174
|
+
const filePath = toCanonicalName(fileName);
|
|
4175
|
+
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
|
|
4171
4176
|
if (callbacks) {
|
|
4177
|
+
let currentModifiedTime;
|
|
4178
|
+
let eventKind = 1 /* Changed */;
|
|
4179
|
+
if (fileTimestamps) {
|
|
4180
|
+
const existingTime = fileTimestamps.get(filePath);
|
|
4181
|
+
if (eventName === "change") {
|
|
4182
|
+
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
|
|
4183
|
+
if (currentModifiedTime.getTime() === existingTime.getTime())
|
|
4184
|
+
return;
|
|
4185
|
+
}
|
|
4186
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
4187
|
+
fileTimestamps.set(filePath, currentModifiedTime);
|
|
4188
|
+
if (existingTime === missingFileModifiedTime)
|
|
4189
|
+
eventKind = 0 /* Created */;
|
|
4190
|
+
else if (currentModifiedTime === missingFileModifiedTime)
|
|
4191
|
+
eventKind = 2 /* Deleted */;
|
|
4192
|
+
}
|
|
4172
4193
|
for (const fileCallback of callbacks) {
|
|
4173
|
-
fileCallback(fileName,
|
|
4194
|
+
fileCallback(fileName, eventKind, currentModifiedTime);
|
|
4174
4195
|
}
|
|
4175
4196
|
}
|
|
4176
4197
|
},
|
|
@@ -4564,7 +4585,7 @@ function createSystemWatchFunctions({
|
|
|
4564
4585
|
);
|
|
4565
4586
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
4566
4587
|
if (!nonPollingWatchFile) {
|
|
4567
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
4588
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
|
|
4568
4589
|
}
|
|
4569
4590
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
4570
4591
|
default:
|
|
@@ -4739,7 +4760,7 @@ function createSystemWatchFunctions({
|
|
|
4739
4760
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4740
4761
|
}
|
|
4741
4762
|
try {
|
|
4742
|
-
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4763
|
+
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4743
4764
|
fileOrDirectory,
|
|
4744
4765
|
recursive,
|
|
4745
4766
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -4841,7 +4862,6 @@ var sys = (() => {
|
|
|
4841
4862
|
}
|
|
4842
4863
|
let activeSession;
|
|
4843
4864
|
let profilePath = "./profile.cpuprofile";
|
|
4844
|
-
const Buffer = require("buffer").Buffer;
|
|
4845
4865
|
const isMacOs = process.platform === "darwin";
|
|
4846
4866
|
const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
|
|
4847
4867
|
const platform = _os.platform();
|
|
@@ -4959,9 +4979,8 @@ var sys = (() => {
|
|
|
4959
4979
|
handle.setBlocking(true);
|
|
4960
4980
|
}
|
|
4961
4981
|
},
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
base64encode: (input) => bufferFrom(input).toString("base64"),
|
|
4982
|
+
base64decode: (input) => Buffer.from(input, "base64").toString("utf8"),
|
|
4983
|
+
base64encode: (input) => Buffer.from(input).toString("base64"),
|
|
4965
4984
|
require: (baseDir, moduleName) => {
|
|
4966
4985
|
try {
|
|
4967
4986
|
const modulePath = resolveJSModule(moduleName, baseDir, nodeSystem);
|
|
@@ -5050,9 +5069,6 @@ var sys = (() => {
|
|
|
5050
5069
|
return false;
|
|
5051
5070
|
}
|
|
5052
5071
|
}
|
|
5053
|
-
function bufferFrom(input, encoding) {
|
|
5054
|
-
return Buffer.from && Buffer.from !== Int8Array.from ? Buffer.from(input, encoding) : new Buffer(input, encoding);
|
|
5055
|
-
}
|
|
5056
5072
|
function isFileSystemCaseSensitive() {
|
|
5057
5073
|
if (platform === "win32" || platform === "win64") {
|
|
5058
5074
|
return false;
|
|
@@ -6187,7 +6203,6 @@ var Diagnostics = {
|
|
|
6187
6203
|
_0_and_1_index_signatures_are_incompatible: diag(2330, 1 /* Error */, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."),
|
|
6188
6204
|
this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, 1 /* Error */, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."),
|
|
6189
6205
|
this_cannot_be_referenced_in_current_location: diag(2332, 1 /* Error */, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."),
|
|
6190
|
-
this_cannot_be_referenced_in_constructor_arguments: diag(2333, 1 /* Error */, "this_cannot_be_referenced_in_constructor_arguments_2333", "'this' cannot be referenced in constructor arguments."),
|
|
6191
6206
|
this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, 1 /* Error */, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."),
|
|
6192
6207
|
super_can_only_be_referenced_in_a_derived_class: diag(2335, 1 /* Error */, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."),
|
|
6193
6208
|
super_cannot_be_referenced_in_constructor_arguments: diag(2336, 1 /* Error */, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."),
|
|
@@ -8452,7 +8467,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8452
8467
|
var tokenValue;
|
|
8453
8468
|
var tokenFlags;
|
|
8454
8469
|
var commentDirectives;
|
|
8455
|
-
var
|
|
8470
|
+
var skipJsDocLeadingAsterisks = 0;
|
|
8456
8471
|
var scriptKind = 0 /* Unknown */;
|
|
8457
8472
|
var jsDocParsingMode = 0 /* ParseAll */;
|
|
8458
8473
|
setText(text, start, length2);
|
|
@@ -8503,7 +8518,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8503
8518
|
setOnError,
|
|
8504
8519
|
resetTokenState,
|
|
8505
8520
|
setTextPos: resetTokenState,
|
|
8506
|
-
|
|
8521
|
+
setSkipJsDocLeadingAsterisks,
|
|
8507
8522
|
tryScan,
|
|
8508
8523
|
lookAhead,
|
|
8509
8524
|
scanRange
|
|
@@ -9219,7 +9234,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9219
9234
|
return pos += 2, token = 43 /* AsteriskAsteriskToken */;
|
|
9220
9235
|
}
|
|
9221
9236
|
pos++;
|
|
9222
|
-
if (
|
|
9237
|
+
if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
|
|
9223
9238
|
asteriskSeen = true;
|
|
9224
9239
|
continue;
|
|
9225
9240
|
}
|
|
@@ -9997,8 +10012,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9997
10012
|
tokenValue = void 0;
|
|
9998
10013
|
tokenFlags = 0 /* None */;
|
|
9999
10014
|
}
|
|
10000
|
-
function
|
|
10001
|
-
|
|
10015
|
+
function setSkipJsDocLeadingAsterisks(skip) {
|
|
10016
|
+
skipJsDocLeadingAsterisks += skip ? 1 : -1;
|
|
10002
10017
|
}
|
|
10003
10018
|
}
|
|
10004
10019
|
function codePointAt(s, i) {
|
|
@@ -11051,8 +11066,8 @@ function isExpressionKind(kind) {
|
|
|
11051
11066
|
case 230 /* SpreadElement */:
|
|
11052
11067
|
case 234 /* AsExpression */:
|
|
11053
11068
|
case 232 /* OmittedExpression */:
|
|
11054
|
-
case
|
|
11055
|
-
case
|
|
11069
|
+
case 355 /* CommaListExpression */:
|
|
11070
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
11056
11071
|
case 238 /* SatisfiesExpression */:
|
|
11057
11072
|
return true;
|
|
11058
11073
|
default:
|
|
@@ -11223,7 +11238,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
11223
11238
|
return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */;
|
|
11224
11239
|
}
|
|
11225
11240
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
11226
|
-
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind ===
|
|
11241
|
+
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 353 /* NotEmittedStatement */;
|
|
11227
11242
|
}
|
|
11228
11243
|
function isDeclaration(node) {
|
|
11229
11244
|
if (node.kind === 168 /* TypeParameter */) {
|
|
@@ -11284,10 +11299,10 @@ function isCaseOrDefaultClause(node) {
|
|
|
11284
11299
|
return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
|
|
11285
11300
|
}
|
|
11286
11301
|
function isJSDocNode(node) {
|
|
11287
|
-
return node.kind >= 309 /* FirstJSDocNode */ && node.kind <=
|
|
11302
|
+
return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */;
|
|
11288
11303
|
}
|
|
11289
11304
|
function isJSDocTag(node) {
|
|
11290
|
-
return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <=
|
|
11305
|
+
return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */;
|
|
11291
11306
|
}
|
|
11292
11307
|
function isSetAccessor(node) {
|
|
11293
11308
|
return node.kind === 178 /* SetAccessor */;
|
|
@@ -11728,7 +11743,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
11728
11743
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
11729
11744
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
11730
11745
|
}
|
|
11731
|
-
if (node.kind ===
|
|
11746
|
+
if (node.kind === 352 /* SyntaxList */ && node._children.length > 0) {
|
|
11732
11747
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
11733
11748
|
}
|
|
11734
11749
|
return skipTrivia(
|
|
@@ -13682,6 +13697,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
13682
13697
|
))) == null ? void 0 : _a.arguments[0];
|
|
13683
13698
|
case 272 /* ImportDeclaration */:
|
|
13684
13699
|
case 278 /* ExportDeclaration */:
|
|
13700
|
+
case 351 /* JSDocImportTag */:
|
|
13685
13701
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
13686
13702
|
case 271 /* ImportEqualsDeclaration */:
|
|
13687
13703
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -13703,6 +13719,7 @@ function getExternalModuleName(node) {
|
|
|
13703
13719
|
switch (node.kind) {
|
|
13704
13720
|
case 272 /* ImportDeclaration */:
|
|
13705
13721
|
case 278 /* ExportDeclaration */:
|
|
13722
|
+
case 351 /* JSDocImportTag */:
|
|
13706
13723
|
return node.moduleSpecifier;
|
|
13707
13724
|
case 271 /* ImportEqualsDeclaration */:
|
|
13708
13725
|
return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
|
|
@@ -13729,7 +13746,7 @@ function getNamespaceDeclarationNode(node) {
|
|
|
13729
13746
|
}
|
|
13730
13747
|
}
|
|
13731
13748
|
function isDefaultImport(node) {
|
|
13732
|
-
return node.kind === 272 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
|
|
13749
|
+
return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name;
|
|
13733
13750
|
}
|
|
13734
13751
|
function hasQuestionToken(node) {
|
|
13735
13752
|
if (node) {
|
|
@@ -14502,7 +14519,7 @@ function getOperator(expression) {
|
|
|
14502
14519
|
}
|
|
14503
14520
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
14504
14521
|
switch (nodeKind) {
|
|
14505
|
-
case
|
|
14522
|
+
case 355 /* CommaListExpression */:
|
|
14506
14523
|
return 0 /* Comma */;
|
|
14507
14524
|
case 230 /* SpreadElement */:
|
|
14508
14525
|
return 1 /* Spread */;
|
|
@@ -16051,7 +16068,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
16051
16068
|
case 212 /* ElementAccessExpression */:
|
|
16052
16069
|
case 211 /* PropertyAccessExpression */:
|
|
16053
16070
|
case 235 /* NonNullExpression */:
|
|
16054
|
-
case
|
|
16071
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
16055
16072
|
case 238 /* SatisfiesExpression */:
|
|
16056
16073
|
node = node.expression;
|
|
16057
16074
|
continue;
|
|
@@ -17438,7 +17455,7 @@ function getContainingNodeArray(node) {
|
|
|
17438
17455
|
return parent.types;
|
|
17439
17456
|
case 189 /* TupleType */:
|
|
17440
17457
|
case 209 /* ArrayLiteralExpression */:
|
|
17441
|
-
case
|
|
17458
|
+
case 355 /* CommaListExpression */:
|
|
17442
17459
|
case 275 /* NamedImports */:
|
|
17443
17460
|
case 279 /* NamedExports */:
|
|
17444
17461
|
return parent.elements;
|
|
@@ -18637,6 +18654,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18637
18654
|
updateJSDocImplementsTag,
|
|
18638
18655
|
createJSDocSeeTag,
|
|
18639
18656
|
updateJSDocSeeTag,
|
|
18657
|
+
createJSDocImportTag,
|
|
18658
|
+
updateJSDocImportTag,
|
|
18640
18659
|
createJSDocNameReference,
|
|
18641
18660
|
updateJSDocNameReference,
|
|
18642
18661
|
createJSDocMemberName,
|
|
@@ -21409,6 +21428,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21409
21428
|
function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
|
|
21410
21429
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
|
|
21411
21430
|
}
|
|
21431
|
+
function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) {
|
|
21432
|
+
const node = createBaseJSDocTag(351 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment);
|
|
21433
|
+
node.importClause = importClause;
|
|
21434
|
+
node.moduleSpecifier = moduleSpecifier;
|
|
21435
|
+
node.attributes = attributes;
|
|
21436
|
+
node.comment = comment;
|
|
21437
|
+
return node;
|
|
21438
|
+
}
|
|
21439
|
+
function updateJSDocImportTag(node, tagName, importClause, moduleSpecifier, attributes, comment) {
|
|
21440
|
+
return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment), node) : node;
|
|
21441
|
+
}
|
|
21412
21442
|
function createJSDocText(text) {
|
|
21413
21443
|
const node = createBaseNode(321 /* JSDocText */);
|
|
21414
21444
|
node.text = text;
|
|
@@ -21806,18 +21836,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21806
21836
|
return node;
|
|
21807
21837
|
}
|
|
21808
21838
|
function createSyntaxList(children) {
|
|
21809
|
-
const node = createBaseNode(
|
|
21839
|
+
const node = createBaseNode(352 /* SyntaxList */);
|
|
21810
21840
|
node._children = children;
|
|
21811
21841
|
return node;
|
|
21812
21842
|
}
|
|
21813
21843
|
function createNotEmittedStatement(original) {
|
|
21814
|
-
const node = createBaseNode(
|
|
21844
|
+
const node = createBaseNode(353 /* NotEmittedStatement */);
|
|
21815
21845
|
node.original = original;
|
|
21816
21846
|
setTextRange(node, original);
|
|
21817
21847
|
return node;
|
|
21818
21848
|
}
|
|
21819
21849
|
function createPartiallyEmittedExpression(expression, original) {
|
|
21820
|
-
const node = createBaseNode(
|
|
21850
|
+
const node = createBaseNode(354 /* PartiallyEmittedExpression */);
|
|
21821
21851
|
node.expression = expression;
|
|
21822
21852
|
node.original = original;
|
|
21823
21853
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -21839,7 +21869,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21839
21869
|
return node;
|
|
21840
21870
|
}
|
|
21841
21871
|
function createCommaListExpression(elements) {
|
|
21842
|
-
const node = createBaseNode(
|
|
21872
|
+
const node = createBaseNode(355 /* CommaListExpression */);
|
|
21843
21873
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
21844
21874
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
21845
21875
|
return node;
|
|
@@ -21848,7 +21878,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21848
21878
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
21849
21879
|
}
|
|
21850
21880
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
21851
|
-
const node = createBaseNode(
|
|
21881
|
+
const node = createBaseNode(356 /* SyntheticReferenceExpression */);
|
|
21852
21882
|
node.expression = expression;
|
|
21853
21883
|
node.thisArg = thisArg;
|
|
21854
21884
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -22094,7 +22124,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22094
22124
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
22095
22125
|
case 235 /* NonNullExpression */:
|
|
22096
22126
|
return updateNonNullExpression(outerExpression, expression);
|
|
22097
|
-
case
|
|
22127
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
22098
22128
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
22099
22129
|
}
|
|
22100
22130
|
}
|
|
@@ -22504,6 +22534,8 @@ function getDefaultTagNameForKind(kind) {
|
|
|
22504
22534
|
return "augments";
|
|
22505
22535
|
case 329 /* JSDocImplementsTag */:
|
|
22506
22536
|
return "implements";
|
|
22537
|
+
case 351 /* JSDocImportTag */:
|
|
22538
|
+
return "import";
|
|
22507
22539
|
default:
|
|
22508
22540
|
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
|
|
22509
22541
|
}
|
|
@@ -22644,7 +22676,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
22644
22676
|
case 216 /* TypeAssertionExpression */:
|
|
22645
22677
|
case 238 /* SatisfiesExpression */:
|
|
22646
22678
|
case 234 /* AsExpression */:
|
|
22647
|
-
case
|
|
22679
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
22648
22680
|
case 217 /* ParenthesizedExpression */:
|
|
22649
22681
|
case 108 /* SuperKeyword */:
|
|
22650
22682
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -24282,10 +24314,10 @@ function isMetaProperty(node) {
|
|
|
24282
24314
|
return node.kind === 236 /* MetaProperty */;
|
|
24283
24315
|
}
|
|
24284
24316
|
function isPartiallyEmittedExpression(node) {
|
|
24285
|
-
return node.kind ===
|
|
24317
|
+
return node.kind === 354 /* PartiallyEmittedExpression */;
|
|
24286
24318
|
}
|
|
24287
24319
|
function isCommaListExpression(node) {
|
|
24288
|
-
return node.kind ===
|
|
24320
|
+
return node.kind === 355 /* CommaListExpression */;
|
|
24289
24321
|
}
|
|
24290
24322
|
function isTemplateSpan(node) {
|
|
24291
24323
|
return node.kind === 239 /* TemplateSpan */;
|
|
@@ -24408,10 +24440,10 @@ function isExportSpecifier(node) {
|
|
|
24408
24440
|
return node.kind === 281 /* ExportSpecifier */;
|
|
24409
24441
|
}
|
|
24410
24442
|
function isNotEmittedStatement(node) {
|
|
24411
|
-
return node.kind ===
|
|
24443
|
+
return node.kind === 353 /* NotEmittedStatement */;
|
|
24412
24444
|
}
|
|
24413
24445
|
function isSyntheticReference(node) {
|
|
24414
|
-
return node.kind ===
|
|
24446
|
+
return node.kind === 356 /* SyntheticReferenceExpression */;
|
|
24415
24447
|
}
|
|
24416
24448
|
function isExternalModuleReference(node) {
|
|
24417
24449
|
return node.kind === 283 /* ExternalModuleReference */;
|
|
@@ -24578,6 +24610,9 @@ function isJSDocImplementsTag(node) {
|
|
|
24578
24610
|
function isJSDocSatisfiesTag(node) {
|
|
24579
24611
|
return node.kind === 350 /* JSDocSatisfiesTag */;
|
|
24580
24612
|
}
|
|
24613
|
+
function isJSDocImportTag(node) {
|
|
24614
|
+
return node.kind === 351 /* JSDocImportTag */;
|
|
24615
|
+
}
|
|
24581
24616
|
|
|
24582
24617
|
// src/compiler/factory/utilities.ts
|
|
24583
24618
|
function createEmptyExports(factory2) {
|
|
@@ -24960,7 +24995,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
24960
24995
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
24961
24996
|
case 235 /* NonNullExpression */:
|
|
24962
24997
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
24963
|
-
case
|
|
24998
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
24964
24999
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
24965
25000
|
}
|
|
24966
25001
|
return false;
|
|
@@ -26036,7 +26071,7 @@ var forEachChildTable = {
|
|
|
26036
26071
|
[282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
26037
26072
|
return visitNodes(cbNode, cbNodes, node.modifiers);
|
|
26038
26073
|
},
|
|
26039
|
-
[
|
|
26074
|
+
[355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
26040
26075
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26041
26076
|
},
|
|
26042
26077
|
[284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -26131,7 +26166,8 @@ var forEachChildTable = {
|
|
|
26131
26166
|
[336 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
26132
26167
|
[331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
26133
26168
|
[337 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
26134
|
-
[
|
|
26169
|
+
[351 /* JSDocImportTag */]: forEachChildInJSDocImportTag,
|
|
26170
|
+
[354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
26135
26171
|
};
|
|
26136
26172
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
26137
26173
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -26182,6 +26218,9 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
|
|
|
26182
26218
|
function forEachChildInJSDocTag(node, cbNode, cbNodes) {
|
|
26183
26219
|
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
26184
26220
|
}
|
|
26221
|
+
function forEachChildInJSDocImportTag(node, cbNode, cbNodes) {
|
|
26222
|
+
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
26223
|
+
}
|
|
26185
26224
|
function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
|
|
26186
26225
|
return visitNode2(cbNode, node.expression);
|
|
26187
26226
|
}
|
|
@@ -28174,7 +28213,7 @@ var Parser;
|
|
|
28174
28213
|
);
|
|
28175
28214
|
}
|
|
28176
28215
|
function parseJSDocType() {
|
|
28177
|
-
scanner.
|
|
28216
|
+
scanner.setSkipJsDocLeadingAsterisks(true);
|
|
28178
28217
|
const pos = getNodePos();
|
|
28179
28218
|
if (parseOptional(144 /* ModuleKeyword */)) {
|
|
28180
28219
|
const moduleTag = factory2.createJSDocNamepathType(
|
|
@@ -28193,12 +28232,12 @@ var Parser;
|
|
|
28193
28232
|
nextTokenJSDoc();
|
|
28194
28233
|
}
|
|
28195
28234
|
}
|
|
28196
|
-
scanner.
|
|
28235
|
+
scanner.setSkipJsDocLeadingAsterisks(false);
|
|
28197
28236
|
return finishNode(moduleTag, pos);
|
|
28198
28237
|
}
|
|
28199
28238
|
const hasDotDotDot = parseOptional(26 /* DotDotDotToken */);
|
|
28200
28239
|
let type = parseTypeOrTypePredicate();
|
|
28201
|
-
scanner.
|
|
28240
|
+
scanner.setSkipJsDocLeadingAsterisks(false);
|
|
28202
28241
|
if (hasDotDotDot) {
|
|
28203
28242
|
type = finishNode(factory2.createJSDocVariadicType(type), pos);
|
|
28204
28243
|
}
|
|
@@ -31761,22 +31800,28 @@ var Parser;
|
|
|
31761
31800
|
if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) {
|
|
31762
31801
|
return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly);
|
|
31763
31802
|
}
|
|
31803
|
+
const importClause = tryParseImportClause(identifier, afterImportPos, isTypeOnly);
|
|
31804
|
+
const moduleSpecifier = parseModuleSpecifier();
|
|
31805
|
+
const attributes = tryParseImportAttributes();
|
|
31806
|
+
parseSemicolon();
|
|
31807
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
31808
|
+
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31809
|
+
}
|
|
31810
|
+
function tryParseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks = false) {
|
|
31764
31811
|
let importClause;
|
|
31765
31812
|
if (identifier || // import id
|
|
31766
31813
|
token() === 42 /* AsteriskToken */ || // import *
|
|
31767
31814
|
token() === 19 /* OpenBraceToken */) {
|
|
31768
|
-
importClause = parseImportClause(identifier,
|
|
31815
|
+
importClause = parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks);
|
|
31769
31816
|
parseExpected(161 /* FromKeyword */);
|
|
31770
31817
|
}
|
|
31771
|
-
|
|
31818
|
+
return importClause;
|
|
31819
|
+
}
|
|
31820
|
+
function tryParseImportAttributes() {
|
|
31772
31821
|
const currentToken2 = token();
|
|
31773
|
-
let attributes;
|
|
31774
31822
|
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
31775
|
-
|
|
31823
|
+
return parseImportAttributes(currentToken2);
|
|
31776
31824
|
}
|
|
31777
|
-
parseSemicolon();
|
|
31778
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
31779
|
-
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31780
31825
|
}
|
|
31781
31826
|
function parseImportAttribute() {
|
|
31782
31827
|
const pos = getNodePos();
|
|
@@ -31843,10 +31888,14 @@ var Parser;
|
|
|
31843
31888
|
const finished = withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31844
31889
|
return finished;
|
|
31845
31890
|
}
|
|
31846
|
-
function parseImportClause(identifier, pos, isTypeOnly) {
|
|
31891
|
+
function parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks) {
|
|
31847
31892
|
let namedBindings;
|
|
31848
31893
|
if (!identifier || parseOptional(28 /* CommaToken */)) {
|
|
31894
|
+
if (skipJsDocLeadingAsterisks)
|
|
31895
|
+
scanner.setSkipJsDocLeadingAsterisks(true);
|
|
31849
31896
|
namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */);
|
|
31897
|
+
if (skipJsDocLeadingAsterisks)
|
|
31898
|
+
scanner.setSkipJsDocLeadingAsterisks(false);
|
|
31850
31899
|
}
|
|
31851
31900
|
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
|
|
31852
31901
|
}
|
|
@@ -32417,6 +32466,9 @@ var Parser;
|
|
|
32417
32466
|
case "throws":
|
|
32418
32467
|
tag = parseThrowsTag(start2, tagName, margin, indentText);
|
|
32419
32468
|
break;
|
|
32469
|
+
case "import":
|
|
32470
|
+
tag = parseImportTag(start2, tagName, margin, indentText);
|
|
32471
|
+
break;
|
|
32420
32472
|
default:
|
|
32421
32473
|
tag = parseUnknownTag(start2, tagName, margin, indentText);
|
|
32422
32474
|
break;
|
|
@@ -32736,13 +32788,32 @@ var Parser;
|
|
|
32736
32788
|
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
32737
32789
|
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
32738
32790
|
}
|
|
32791
|
+
function parseImportTag(start2, tagName, margin, indentText) {
|
|
32792
|
+
const afterImportTagPos = scanner.getTokenFullStart();
|
|
32793
|
+
let identifier;
|
|
32794
|
+
if (isIdentifier2()) {
|
|
32795
|
+
identifier = parseIdentifier();
|
|
32796
|
+
}
|
|
32797
|
+
const importClause = tryParseImportClause(
|
|
32798
|
+
identifier,
|
|
32799
|
+
afterImportTagPos,
|
|
32800
|
+
/*isTypeOnly*/
|
|
32801
|
+
true,
|
|
32802
|
+
/*skipJsDocLeadingAsterisks*/
|
|
32803
|
+
true
|
|
32804
|
+
);
|
|
32805
|
+
const moduleSpecifier = parseModuleSpecifier();
|
|
32806
|
+
const attributes = tryParseImportAttributes();
|
|
32807
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
32808
|
+
return finishNode(factory2.createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comments2), start2);
|
|
32809
|
+
}
|
|
32739
32810
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
32740
32811
|
const usedBrace = parseOptional(19 /* OpenBraceToken */);
|
|
32741
32812
|
const pos = getNodePos();
|
|
32742
32813
|
const expression = parsePropertyAccessEntityNameExpression();
|
|
32743
|
-
scanner.
|
|
32814
|
+
scanner.setSkipJsDocLeadingAsterisks(true);
|
|
32744
32815
|
const typeArguments = tryParseTypeArguments();
|
|
32745
|
-
scanner.
|
|
32816
|
+
scanner.setSkipJsDocLeadingAsterisks(false);
|
|
32746
32817
|
const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
|
|
32747
32818
|
const res = finishNode(node, pos);
|
|
32748
32819
|
if (usedBrace) {
|
|
@@ -39421,6 +39492,7 @@ function createBinder() {
|
|
|
39421
39492
|
var lastContainer;
|
|
39422
39493
|
var delayedTypeAliases;
|
|
39423
39494
|
var seenThisKeyword;
|
|
39495
|
+
var jsDocImports;
|
|
39424
39496
|
var currentFlow;
|
|
39425
39497
|
var currentBreakTarget;
|
|
39426
39498
|
var currentContinueTarget;
|
|
@@ -39468,6 +39540,7 @@ function createBinder() {
|
|
|
39468
39540
|
file.symbolCount = symbolCount;
|
|
39469
39541
|
file.classifiableNames = classifiableNames;
|
|
39470
39542
|
delayedBindJSDocTypedefTag();
|
|
39543
|
+
bindJSDocImports();
|
|
39471
39544
|
}
|
|
39472
39545
|
file = void 0;
|
|
39473
39546
|
options = void 0;
|
|
@@ -39478,6 +39551,7 @@ function createBinder() {
|
|
|
39478
39551
|
blockScopeContainer = void 0;
|
|
39479
39552
|
lastContainer = void 0;
|
|
39480
39553
|
delayedTypeAliases = void 0;
|
|
39554
|
+
jsDocImports = void 0;
|
|
39481
39555
|
seenThisKeyword = false;
|
|
39482
39556
|
currentFlow = void 0;
|
|
39483
39557
|
currentBreakTarget = void 0;
|
|
@@ -39912,6 +39986,9 @@ function createBinder() {
|
|
|
39912
39986
|
case 340 /* JSDocEnumTag */:
|
|
39913
39987
|
bindJSDocTypeAlias(node);
|
|
39914
39988
|
break;
|
|
39989
|
+
case 351 /* JSDocImportTag */:
|
|
39990
|
+
bindJSDocImportTag(node);
|
|
39991
|
+
break;
|
|
39915
39992
|
case 307 /* SourceFile */: {
|
|
39916
39993
|
bindEachFunctionsFirst(node.statements);
|
|
39917
39994
|
bind(node.endOfFileToken);
|
|
@@ -40644,6 +40721,12 @@ function createBinder() {
|
|
|
40644
40721
|
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
|
|
40645
40722
|
}
|
|
40646
40723
|
}
|
|
40724
|
+
function bindJSDocImportTag(node) {
|
|
40725
|
+
bind(node.tagName);
|
|
40726
|
+
if (typeof node.comment !== "string") {
|
|
40727
|
+
bindEach(node.comment);
|
|
40728
|
+
}
|
|
40729
|
+
}
|
|
40647
40730
|
function bindOptionalExpression(node, trueTarget, falseTarget) {
|
|
40648
40731
|
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
|
40649
40732
|
if (!isOptionalChain(node) || isOutermostOptionalChain(node)) {
|
|
@@ -40960,6 +41043,31 @@ function createBinder() {
|
|
|
40960
41043
|
parent = saveParent;
|
|
40961
41044
|
currentFlow = saveCurrentFlow;
|
|
40962
41045
|
}
|
|
41046
|
+
function bindJSDocImports() {
|
|
41047
|
+
if (jsDocImports === void 0) {
|
|
41048
|
+
return;
|
|
41049
|
+
}
|
|
41050
|
+
const saveContainer = container;
|
|
41051
|
+
const saveLastContainer = lastContainer;
|
|
41052
|
+
const saveBlockScopeContainer = blockScopeContainer;
|
|
41053
|
+
const saveParent = parent;
|
|
41054
|
+
const saveCurrentFlow = currentFlow;
|
|
41055
|
+
for (const jsDocImportTag of jsDocImports) {
|
|
41056
|
+
const host = getJSDocHost(jsDocImportTag);
|
|
41057
|
+
const enclosingContainer = host ? getEnclosingContainer(host) : void 0;
|
|
41058
|
+
const enclosingBlockScopeContainer = host ? getEnclosingBlockScopeContainer(host) : void 0;
|
|
41059
|
+
container = enclosingContainer || file;
|
|
41060
|
+
blockScopeContainer = enclosingBlockScopeContainer || file;
|
|
41061
|
+
currentFlow = initFlowNode({ flags: 2 /* Start */ });
|
|
41062
|
+
parent = jsDocImportTag;
|
|
41063
|
+
bind(jsDocImportTag.importClause);
|
|
41064
|
+
}
|
|
41065
|
+
container = saveContainer;
|
|
41066
|
+
lastContainer = saveLastContainer;
|
|
41067
|
+
blockScopeContainer = saveBlockScopeContainer;
|
|
41068
|
+
parent = saveParent;
|
|
41069
|
+
currentFlow = saveCurrentFlow;
|
|
41070
|
+
}
|
|
40963
41071
|
function checkContextualIdentifier(node) {
|
|
40964
41072
|
if (!file.parseDiagnostics.length && !(node.flags & 33554432 /* Ambient */) && !(node.flags & 16777216 /* JSDoc */) && !isIdentifierName(node)) {
|
|
40965
41073
|
const originalKeywordKind = identifierToKeywordKind(node);
|
|
@@ -41384,6 +41492,8 @@ function createBinder() {
|
|
|
41384
41492
|
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
|
|
41385
41493
|
case 339 /* JSDocOverloadTag */:
|
|
41386
41494
|
return bind(node.typeExpression);
|
|
41495
|
+
case 351 /* JSDocImportTag */:
|
|
41496
|
+
return (jsDocImports || (jsDocImports = [])).push(node);
|
|
41387
41497
|
}
|
|
41388
41498
|
}
|
|
41389
41499
|
function bindPropertyWorker(node) {
|
|
@@ -44668,11 +44778,11 @@ function createTypeChecker(host) {
|
|
|
44668
44778
|
} else if (declaration.kind === 260 /* VariableDeclaration */) {
|
|
44669
44779
|
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
|
|
44670
44780
|
} else if (isClassLike(declaration)) {
|
|
44671
|
-
const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration));
|
|
44781
|
+
const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : !legacyDecorators && isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration));
|
|
44672
44782
|
if (!container) {
|
|
44673
44783
|
return true;
|
|
44674
44784
|
}
|
|
44675
|
-
if (isDecorator(container)) {
|
|
44785
|
+
if (!legacyDecorators && isDecorator(container)) {
|
|
44676
44786
|
return !!findAncestor(usage, (n) => n === container ? "quit" : isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression(n));
|
|
44677
44787
|
}
|
|
44678
44788
|
return false;
|
|
@@ -45024,6 +45134,7 @@ function createTypeChecker(host) {
|
|
|
45024
45134
|
case 346 /* JSDocTypedefTag */:
|
|
45025
45135
|
case 338 /* JSDocCallbackTag */:
|
|
45026
45136
|
case 340 /* JSDocEnumTag */:
|
|
45137
|
+
case 351 /* JSDocImportTag */:
|
|
45027
45138
|
const root = getJSDocRoot(location);
|
|
45028
45139
|
if (root) {
|
|
45029
45140
|
location = root.parent;
|
|
@@ -46516,7 +46627,7 @@ function createTypeChecker(host) {
|
|
|
46516
46627
|
return ambientModule;
|
|
46517
46628
|
}
|
|
46518
46629
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
46519
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
46630
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isInJSFile(location) && isJSDocImportTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
46520
46631
|
location.initializer,
|
|
46521
46632
|
/*requireStringLiteralLikeArgument*/
|
|
46522
46633
|
true
|
|
@@ -50892,19 +51003,20 @@ function createTypeChecker(host) {
|
|
|
50892
51003
|
case 273 /* ImportClause */: {
|
|
50893
51004
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
50894
51005
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
|
|
51006
|
+
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
51007
|
+
const isTypeOnly = isJSDocImportTag(node.parent);
|
|
50895
51008
|
addResult(
|
|
50896
51009
|
factory.createImportDeclaration(
|
|
50897
51010
|
/*modifiers*/
|
|
50898
51011
|
void 0,
|
|
50899
51012
|
factory.createImportClause(
|
|
50900
|
-
|
|
50901
|
-
false,
|
|
51013
|
+
isTypeOnly,
|
|
50902
51014
|
factory.createIdentifier(localName),
|
|
50903
51015
|
/*namedBindings*/
|
|
50904
51016
|
void 0
|
|
50905
51017
|
),
|
|
50906
51018
|
specifier2,
|
|
50907
|
-
|
|
51019
|
+
attributes
|
|
50908
51020
|
),
|
|
50909
51021
|
0 /* None */
|
|
50910
51022
|
);
|
|
@@ -50913,13 +51025,13 @@ function createTypeChecker(host) {
|
|
|
50913
51025
|
case 274 /* NamespaceImport */: {
|
|
50914
51026
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
50915
51027
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
|
|
51028
|
+
const isTypeOnly = isJSDocImportTag(node.parent.parent);
|
|
50916
51029
|
addResult(
|
|
50917
51030
|
factory.createImportDeclaration(
|
|
50918
51031
|
/*modifiers*/
|
|
50919
51032
|
void 0,
|
|
50920
51033
|
factory.createImportClause(
|
|
50921
|
-
|
|
50922
|
-
false,
|
|
51034
|
+
isTypeOnly,
|
|
50923
51035
|
/*name*/
|
|
50924
51036
|
void 0,
|
|
50925
51037
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
@@ -50947,13 +51059,13 @@ function createTypeChecker(host) {
|
|
|
50947
51059
|
case 276 /* ImportSpecifier */: {
|
|
50948
51060
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
50949
51061
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
|
|
51062
|
+
const isTypeOnly = isJSDocImportTag(node.parent.parent.parent);
|
|
50950
51063
|
addResult(
|
|
50951
51064
|
factory.createImportDeclaration(
|
|
50952
51065
|
/*modifiers*/
|
|
50953
51066
|
void 0,
|
|
50954
51067
|
factory.createImportClause(
|
|
50955
|
-
|
|
50956
|
-
false,
|
|
51068
|
+
isTypeOnly,
|
|
50957
51069
|
/*name*/
|
|
50958
51070
|
void 0,
|
|
50959
51071
|
factory.createNamedImports([
|
|
@@ -53633,7 +53745,7 @@ function createTypeChecker(host) {
|
|
|
53633
53745
|
if (!lateSymbol)
|
|
53634
53746
|
lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
|
|
53635
53747
|
const earlySymbol = earlySymbols && earlySymbols.get(memberName);
|
|
53636
|
-
if (!(parent.flags & 32 /* Class */) &&
|
|
53748
|
+
if (!(parent.flags & 32 /* Class */) && lateSymbol.flags & getExcludedSymbolFlags(symbolFlags)) {
|
|
53637
53749
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
53638
53750
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
53639
53751
|
forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
|
|
@@ -65159,13 +65271,20 @@ function createTypeChecker(host) {
|
|
|
65159
65271
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
65160
65272
|
case 166 /* QualifiedName */:
|
|
65161
65273
|
const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
|
|
65162
|
-
return left && left
|
|
65274
|
+
return left && `${left}.${node.right.escapedText}`;
|
|
65163
65275
|
case 211 /* PropertyAccessExpression */:
|
|
65164
65276
|
case 212 /* ElementAccessExpression */:
|
|
65165
65277
|
const propName = getAccessedPropertyName(node);
|
|
65166
65278
|
if (propName !== void 0) {
|
|
65167
65279
|
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
65168
|
-
return key && key
|
|
65280
|
+
return key && `${key}.${propName}`;
|
|
65281
|
+
}
|
|
65282
|
+
if (isElementAccessExpression(node) && isIdentifier(node.argumentExpression)) {
|
|
65283
|
+
const symbol = getResolvedSymbol(node.argumentExpression);
|
|
65284
|
+
if (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol)) {
|
|
65285
|
+
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
65286
|
+
return key && `${key}.@${getSymbolId(symbol)}`;
|
|
65287
|
+
}
|
|
65169
65288
|
}
|
|
65170
65289
|
break;
|
|
65171
65290
|
case 206 /* ObjectBindingPattern */:
|
|
@@ -65202,8 +65321,19 @@ function createTypeChecker(host) {
|
|
|
65202
65321
|
case 211 /* PropertyAccessExpression */:
|
|
65203
65322
|
case 212 /* ElementAccessExpression */:
|
|
65204
65323
|
const sourcePropertyName = getAccessedPropertyName(source);
|
|
65205
|
-
|
|
65206
|
-
|
|
65324
|
+
if (sourcePropertyName !== void 0) {
|
|
65325
|
+
const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
|
|
65326
|
+
if (targetPropertyName !== void 0) {
|
|
65327
|
+
return targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
|
|
65328
|
+
}
|
|
65329
|
+
}
|
|
65330
|
+
if (isElementAccessExpression(source) && isElementAccessExpression(target) && isIdentifier(source.argumentExpression) && isIdentifier(target.argumentExpression)) {
|
|
65331
|
+
const symbol = getResolvedSymbol(source.argumentExpression);
|
|
65332
|
+
if (symbol === getResolvedSymbol(target.argumentExpression) && (isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol))) {
|
|
65333
|
+
return isMatchingReference(source.expression, target.expression);
|
|
65334
|
+
}
|
|
65335
|
+
}
|
|
65336
|
+
break;
|
|
65207
65337
|
case 166 /* QualifiedName */:
|
|
65208
65338
|
return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
|
|
65209
65339
|
case 226 /* BinaryExpression */:
|
|
@@ -67747,11 +67877,6 @@ function createTypeChecker(host) {
|
|
|
67747
67877
|
case 266 /* EnumDeclaration */:
|
|
67748
67878
|
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
|
|
67749
67879
|
break;
|
|
67750
|
-
case 176 /* Constructor */:
|
|
67751
|
-
if (isInConstructorArgumentInitializer(node, container)) {
|
|
67752
|
-
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
|
|
67753
|
-
}
|
|
67754
|
-
break;
|
|
67755
67880
|
}
|
|
67756
67881
|
}
|
|
67757
67882
|
if (!isNodeInTypeQuery && capturedByArrowFunction && languageVersion < 2 /* ES2015 */) {
|
|
@@ -77839,6 +77964,9 @@ function createTypeChecker(host) {
|
|
|
77839
77964
|
error(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
|
|
77840
77965
|
}
|
|
77841
77966
|
}
|
|
77967
|
+
function checkJSDocImportTag(node) {
|
|
77968
|
+
checkImportAttributes(node);
|
|
77969
|
+
}
|
|
77842
77970
|
function checkJSDocImplementsTag(node) {
|
|
77843
77971
|
const classLike = getEffectiveJSDocHost(node);
|
|
77844
77972
|
if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
|
|
@@ -81106,7 +81234,8 @@ function createTypeChecker(host) {
|
|
|
81106
81234
|
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
|
|
81107
81235
|
return grammarErrorOnNode(node, message);
|
|
81108
81236
|
}
|
|
81109
|
-
|
|
81237
|
+
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly);
|
|
81238
|
+
if (isTypeOnly) {
|
|
81110
81239
|
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
81111
81240
|
}
|
|
81112
81241
|
if (override) {
|
|
@@ -81557,6 +81686,8 @@ function createTypeChecker(host) {
|
|
|
81557
81686
|
return checkJSDocSatisfiesTag(node);
|
|
81558
81687
|
case 343 /* JSDocThisTag */:
|
|
81559
81688
|
return checkJSDocThisTag(node);
|
|
81689
|
+
case 351 /* JSDocImportTag */:
|
|
81690
|
+
return checkJSDocImportTag(node);
|
|
81560
81691
|
case 199 /* IndexedAccessType */:
|
|
81561
81692
|
return checkIndexedAccessType(node);
|
|
81562
81693
|
case 200 /* MappedType */:
|
|
@@ -82360,7 +82491,7 @@ function createTypeChecker(host) {
|
|
|
82360
82491
|
return void 0;
|
|
82361
82492
|
case 11 /* StringLiteral */:
|
|
82362
82493
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
82363
|
-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
82494
|
+
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
82364
82495
|
node.parent,
|
|
82365
82496
|
/*requireStringLiteralLikeArgument*/
|
|
82366
82497
|
false
|
|
@@ -86501,13 +86632,13 @@ var visitEachChildTable = {
|
|
|
86501
86632
|
);
|
|
86502
86633
|
},
|
|
86503
86634
|
// Transformation nodes
|
|
86504
|
-
[
|
|
86635
|
+
[354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
86505
86636
|
return context.factory.updatePartiallyEmittedExpression(
|
|
86506
86637
|
node,
|
|
86507
86638
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
86508
86639
|
);
|
|
86509
86640
|
},
|
|
86510
|
-
[
|
|
86641
|
+
[355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
86511
86642
|
return context.factory.updateCommaListExpression(
|
|
86512
86643
|
node,
|
|
86513
86644
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -90164,7 +90295,7 @@ function transformClassFields(context) {
|
|
|
90164
90295
|
/*discarded*/
|
|
90165
90296
|
true
|
|
90166
90297
|
);
|
|
90167
|
-
case
|
|
90298
|
+
case 355 /* CommaListExpression */:
|
|
90168
90299
|
return visitCommaListExpression(
|
|
90169
90300
|
node,
|
|
90170
90301
|
/*discarded*/
|
|
@@ -93257,7 +93388,7 @@ function transformESDecorators(context) {
|
|
|
93257
93388
|
return visitForStatement(node);
|
|
93258
93389
|
case 244 /* ExpressionStatement */:
|
|
93259
93390
|
return visitExpressionStatement(node);
|
|
93260
|
-
case
|
|
93391
|
+
case 355 /* CommaListExpression */:
|
|
93261
93392
|
return visitCommaListExpression(
|
|
93262
93393
|
node,
|
|
93263
93394
|
/*discarded*/
|
|
@@ -93269,7 +93400,7 @@ function transformESDecorators(context) {
|
|
|
93269
93400
|
/*discarded*/
|
|
93270
93401
|
false
|
|
93271
93402
|
);
|
|
93272
|
-
case
|
|
93403
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
93273
93404
|
return visitPartiallyEmittedExpression(
|
|
93274
93405
|
node,
|
|
93275
93406
|
/*discarded*/
|
|
@@ -93355,7 +93486,7 @@ function transformESDecorators(context) {
|
|
|
93355
93486
|
/*discarded*/
|
|
93356
93487
|
true
|
|
93357
93488
|
);
|
|
93358
|
-
case
|
|
93489
|
+
case 355 /* CommaListExpression */:
|
|
93359
93490
|
return visitCommaListExpression(
|
|
93360
93491
|
node,
|
|
93361
93492
|
/*discarded*/
|
|
@@ -95946,7 +96077,7 @@ function transformES2018(context) {
|
|
|
95946
96077
|
return visitObjectLiteralExpression(node);
|
|
95947
96078
|
case 226 /* BinaryExpression */:
|
|
95948
96079
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
95949
|
-
case
|
|
96080
|
+
case 355 /* CommaListExpression */:
|
|
95950
96081
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
95951
96082
|
case 299 /* CatchClause */:
|
|
95952
96083
|
return visitCatchClause(node);
|
|
@@ -99169,7 +99300,7 @@ function transformES2015(context) {
|
|
|
99169
99300
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
99170
99301
|
case 226 /* BinaryExpression */:
|
|
99171
99302
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
99172
|
-
case
|
|
99303
|
+
case 355 /* CommaListExpression */:
|
|
99173
99304
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
99174
99305
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
99175
99306
|
case 16 /* TemplateHead */:
|
|
@@ -102464,7 +102595,7 @@ function transformGenerators(context) {
|
|
|
102464
102595
|
switch (node.kind) {
|
|
102465
102596
|
case 226 /* BinaryExpression */:
|
|
102466
102597
|
return visitBinaryExpression(node);
|
|
102467
|
-
case
|
|
102598
|
+
case 355 /* CommaListExpression */:
|
|
102468
102599
|
return visitCommaListExpression(node);
|
|
102469
102600
|
case 227 /* ConditionalExpression */:
|
|
102470
102601
|
return visitConditionalExpression(node);
|
|
@@ -104854,7 +104985,7 @@ function transformModule(context) {
|
|
|
104854
104985
|
return visitExpressionStatement(node);
|
|
104855
104986
|
case 217 /* ParenthesizedExpression */:
|
|
104856
104987
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
104857
|
-
case
|
|
104988
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
104858
104989
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
104859
104990
|
case 213 /* CallExpression */:
|
|
104860
104991
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -107247,7 +107378,7 @@ function transformSystemModule(context) {
|
|
|
107247
107378
|
return visitExpressionStatement(node);
|
|
107248
107379
|
case 217 /* ParenthesizedExpression */:
|
|
107249
107380
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
107250
|
-
case
|
|
107381
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
107251
107382
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
107252
107383
|
case 226 /* BinaryExpression */:
|
|
107253
107384
|
if (isDestructuringAssignment(node)) {
|
|
@@ -109260,6 +109391,8 @@ function transformDeclarations(context) {
|
|
|
109260
109391
|
}
|
|
109261
109392
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
109262
109393
|
return;
|
|
109394
|
+
if (isJSDocImportTag(input))
|
|
109395
|
+
return;
|
|
109263
109396
|
if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
|
|
109264
109397
|
return;
|
|
109265
109398
|
let previousEnclosingDeclaration;
|
|
@@ -109907,7 +110040,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
109907
110040
|
}
|
|
109908
110041
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
109909
110042
|
var _a, _b;
|
|
109910
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
110043
|
+
const enabledSyntaxKindFeatures = new Array(357 /* Count */);
|
|
109911
110044
|
let lexicalEnvironmentVariableDeclarations;
|
|
109912
110045
|
let lexicalEnvironmentFunctionDeclarations;
|
|
109913
110046
|
let lexicalEnvironmentStatements;
|
|
@@ -111475,7 +111608,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111475
111608
|
return emitJSDocTypedefTag(node);
|
|
111476
111609
|
case 347 /* JSDocSeeTag */:
|
|
111477
111610
|
return emitJSDocSeeTag(node);
|
|
111478
|
-
case
|
|
111611
|
+
case 351 /* JSDocImportTag */:
|
|
111612
|
+
return emitJSDocImportTag(node);
|
|
111613
|
+
case 353 /* NotEmittedStatement */:
|
|
111479
111614
|
return;
|
|
111480
111615
|
}
|
|
111481
111616
|
if (isExpression(node)) {
|
|
@@ -111576,15 +111711,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111576
111711
|
return emitJsxSelfClosingElement(node);
|
|
111577
111712
|
case 288 /* JsxFragment */:
|
|
111578
111713
|
return emitJsxFragment(node);
|
|
111579
|
-
case
|
|
111714
|
+
case 352 /* SyntaxList */:
|
|
111580
111715
|
return Debug.fail("SyntaxList should not be printed");
|
|
111581
|
-
case
|
|
111716
|
+
case 353 /* NotEmittedStatement */:
|
|
111582
111717
|
return;
|
|
111583
|
-
case
|
|
111718
|
+
case 354 /* PartiallyEmittedExpression */:
|
|
111584
111719
|
return emitPartiallyEmittedExpression(node);
|
|
111585
|
-
case
|
|
111720
|
+
case 355 /* CommaListExpression */:
|
|
111586
111721
|
return emitCommaList(node);
|
|
111587
|
-
case
|
|
111722
|
+
case 356 /* SyntheticReferenceExpression */:
|
|
111588
111723
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
111589
111724
|
}
|
|
111590
111725
|
}
|
|
@@ -113428,6 +113563,21 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
113428
113563
|
emit(tag.name);
|
|
113429
113564
|
emitJSDocComment(tag.comment);
|
|
113430
113565
|
}
|
|
113566
|
+
function emitJSDocImportTag(tag) {
|
|
113567
|
+
emitJSDocTagName(tag.tagName);
|
|
113568
|
+
writeSpace();
|
|
113569
|
+
if (tag.importClause) {
|
|
113570
|
+
emit(tag.importClause);
|
|
113571
|
+
writeSpace();
|
|
113572
|
+
emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
|
|
113573
|
+
writeSpace();
|
|
113574
|
+
}
|
|
113575
|
+
emitExpression(tag.moduleSpecifier);
|
|
113576
|
+
if (tag.attributes) {
|
|
113577
|
+
emitWithLeadingSpace(tag.attributes);
|
|
113578
|
+
}
|
|
113579
|
+
emitJSDocComment(tag.comment);
|
|
113580
|
+
}
|
|
113431
113581
|
function emitJSDocNameReference(node) {
|
|
113432
113582
|
writeSpace();
|
|
113433
113583
|
writePunctuation("{");
|
|
@@ -114840,7 +114990,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114840
114990
|
emitLeadingComments(
|
|
114841
114991
|
pos,
|
|
114842
114992
|
/*isEmittedNode*/
|
|
114843
|
-
node.kind !==
|
|
114993
|
+
node.kind !== 353 /* NotEmittedStatement */
|
|
114844
114994
|
);
|
|
114845
114995
|
}
|
|
114846
114996
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -114864,7 +115014,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114864
115014
|
containerPos = savedContainerPos;
|
|
114865
115015
|
containerEnd = savedContainerEnd;
|
|
114866
115016
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
114867
|
-
if (!skipTrailingComments && node.kind !==
|
|
115017
|
+
if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) {
|
|
114868
115018
|
emitTrailingComments(end);
|
|
114869
115019
|
}
|
|
114870
115020
|
}
|
|
@@ -115116,7 +115266,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115116
115266
|
const emitFlags = getEmitFlags(node);
|
|
115117
115267
|
const sourceMapRange = getSourceMapRange(node);
|
|
115118
115268
|
const source = sourceMapRange.source || sourceMapSource;
|
|
115119
|
-
if (node.kind !==
|
|
115269
|
+
if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
115120
115270
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
115121
115271
|
}
|
|
115122
115272
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -115129,7 +115279,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115129
115279
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
115130
115280
|
sourceMapsDisabled = false;
|
|
115131
115281
|
}
|
|
115132
|
-
if (node.kind !==
|
|
115282
|
+
if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
115133
115283
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
115134
115284
|
}
|
|
115135
115285
|
}
|
|
@@ -118010,7 +118160,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118010
118160
|
);
|
|
118011
118161
|
}
|
|
118012
118162
|
if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
|
|
118013
|
-
|
|
118163
|
+
collectDynamicImportOrRequireOrJsDocImportCalls(file);
|
|
118014
118164
|
}
|
|
118015
118165
|
file.imports = imports || emptyArray;
|
|
118016
118166
|
file.moduleAugmentations = moduleAugmentations || emptyArray;
|
|
@@ -118054,7 +118204,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118054
118204
|
}
|
|
118055
118205
|
}
|
|
118056
118206
|
}
|
|
118057
|
-
function
|
|
118207
|
+
function collectDynamicImportOrRequireOrJsDocImportCalls(file2) {
|
|
118058
118208
|
const r = /import|require/g;
|
|
118059
118209
|
while (r.exec(file2.text) !== null) {
|
|
118060
118210
|
const node = getNodeAtPosition(file2, r.lastIndex);
|
|
@@ -118083,6 +118233,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118083
118233
|
false
|
|
118084
118234
|
);
|
|
118085
118235
|
imports = append(imports, node.argument.literal);
|
|
118236
|
+
} else if (isJavaScriptFile && isJSDocImportTag(node)) {
|
|
118237
|
+
const moduleNameExpr = getExternalModuleName(node);
|
|
118238
|
+
if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
|
|
118239
|
+
setParentRecursive(
|
|
118240
|
+
node,
|
|
118241
|
+
/*incremental*/
|
|
118242
|
+
false
|
|
118243
|
+
);
|
|
118244
|
+
imports = append(imports, moduleNameExpr);
|
|
118245
|
+
}
|
|
118086
118246
|
}
|
|
118087
118247
|
}
|
|
118088
118248
|
}
|
|
@@ -121714,7 +121874,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121714
121874
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
121715
121875
|
var _a;
|
|
121716
121876
|
const expected = isExternalOrCommonJsModule(newFile) ? ((_a = newFile.packageJsonLocations) == null ? void 0 : _a.length) ?? 0 : 0;
|
|
121717
|
-
const existing = impliedFormatPackageJsons.get(newFile.
|
|
121877
|
+
const existing = impliedFormatPackageJsons.get(newFile.resolvedPath) ?? emptyArray;
|
|
121718
121878
|
for (let i = existing.length; i < expected; i++) {
|
|
121719
121879
|
createFileWatcherOfAffectingLocation(
|
|
121720
121880
|
newFile.packageJsonLocations[i],
|
|
@@ -121728,9 +121888,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121728
121888
|
}
|
|
121729
121889
|
}
|
|
121730
121890
|
if (expected)
|
|
121731
|
-
impliedFormatPackageJsons.set(newFile.
|
|
121891
|
+
impliedFormatPackageJsons.set(newFile.resolvedPath, newFile.packageJsonLocations);
|
|
121732
121892
|
else
|
|
121733
|
-
impliedFormatPackageJsons.delete(newFile.
|
|
121893
|
+
impliedFormatPackageJsons.delete(newFile.resolvedPath);
|
|
121734
121894
|
});
|
|
121735
121895
|
impliedFormatPackageJsons.forEach((existing, path) => {
|
|
121736
121896
|
if (!(newProgram == null ? void 0 : newProgram.getSourceFileByPath(path))) {
|