@typescript-deploys/pr-build 5.0.0-pr-52123-7 → 5.0.0-pr-49218-12
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 +403 -248
- package/lib/tsserver.js +474 -490
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +478 -485
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +463 -447
- package/lib/typingsInstaller.js +86 -110
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230110`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -55,22 +55,21 @@ function firstDefined(array, callback) {
|
|
|
55
55
|
return void 0;
|
|
56
56
|
}
|
|
57
57
|
function firstDefinedIterator(iter, callback) {
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
if (iterResult.done) {
|
|
61
|
-
return void 0;
|
|
62
|
-
}
|
|
63
|
-
const result = callback(iterResult.value);
|
|
58
|
+
for (const value of iter) {
|
|
59
|
+
const result = callback(value);
|
|
64
60
|
if (result !== void 0) {
|
|
65
61
|
return result;
|
|
66
62
|
}
|
|
67
63
|
}
|
|
64
|
+
return void 0;
|
|
68
65
|
}
|
|
69
66
|
function reduceLeftIterator(iterator, f, initial) {
|
|
70
67
|
let result = initial;
|
|
71
68
|
if (iterator) {
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
let pos = 0;
|
|
70
|
+
for (const value of iterator) {
|
|
71
|
+
result = f(result, value, pos);
|
|
72
|
+
pos++;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
return result;
|
|
@@ -212,13 +211,10 @@ function map(array, f) {
|
|
|
212
211
|
}
|
|
213
212
|
return result;
|
|
214
213
|
}
|
|
215
|
-
function mapIterator(iter, mapFn) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false };
|
|
220
|
-
}
|
|
221
|
-
};
|
|
214
|
+
function* mapIterator(iter, mapFn) {
|
|
215
|
+
for (const x of iter) {
|
|
216
|
+
yield mapFn(x);
|
|
217
|
+
}
|
|
222
218
|
}
|
|
223
219
|
function sameMap(array, f) {
|
|
224
220
|
if (array) {
|
|
@@ -314,21 +310,13 @@ function mapDefined(array, mapFn) {
|
|
|
314
310
|
}
|
|
315
311
|
return result;
|
|
316
312
|
}
|
|
317
|
-
function mapDefinedIterator(iter, mapFn) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (res.done) {
|
|
323
|
-
return res;
|
|
324
|
-
}
|
|
325
|
-
const value = mapFn(res.value);
|
|
326
|
-
if (value !== void 0) {
|
|
327
|
-
return { value, done: false };
|
|
328
|
-
}
|
|
329
|
-
}
|
|
313
|
+
function* mapDefinedIterator(iter, mapFn) {
|
|
314
|
+
for (const x of iter) {
|
|
315
|
+
const value = mapFn(x);
|
|
316
|
+
if (value !== void 0) {
|
|
317
|
+
yield value;
|
|
330
318
|
}
|
|
331
|
-
}
|
|
319
|
+
}
|
|
332
320
|
}
|
|
333
321
|
function getOrUpdate(map2, key, callback) {
|
|
334
322
|
if (map2.has(key)) {
|
|
@@ -345,7 +333,6 @@ function tryAddToSet(set, value) {
|
|
|
345
333
|
}
|
|
346
334
|
return false;
|
|
347
335
|
}
|
|
348
|
-
var emptyIterator = { next: () => ({ value: void 0, done: true }) };
|
|
349
336
|
function spanMap(array, keyfn, mapfn) {
|
|
350
337
|
let result;
|
|
351
338
|
if (array) {
|
|
@@ -542,13 +529,6 @@ function relativeComplement(arrayA, arrayB, comparer) {
|
|
|
542
529
|
}
|
|
543
530
|
return result;
|
|
544
531
|
}
|
|
545
|
-
function sum(array, prop) {
|
|
546
|
-
let result = 0;
|
|
547
|
-
for (const v of array) {
|
|
548
|
-
result += v[prop];
|
|
549
|
-
}
|
|
550
|
-
return result;
|
|
551
|
-
}
|
|
552
532
|
function append(to, value) {
|
|
553
533
|
if (value === void 0)
|
|
554
534
|
return to;
|
|
@@ -610,7 +590,7 @@ function rangeEquals(array1, array2, pos, end) {
|
|
|
610
590
|
}
|
|
611
591
|
return true;
|
|
612
592
|
}
|
|
613
|
-
|
|
593
|
+
var elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => {
|
|
614
594
|
if (array) {
|
|
615
595
|
offset = toOffset(array, offset);
|
|
616
596
|
if (offset < array.length) {
|
|
@@ -618,10 +598,18 @@ function elementAt(array, offset) {
|
|
|
618
598
|
}
|
|
619
599
|
}
|
|
620
600
|
return void 0;
|
|
621
|
-
}
|
|
601
|
+
};
|
|
622
602
|
function firstOrUndefined(array) {
|
|
623
603
|
return array === void 0 || array.length === 0 ? void 0 : array[0];
|
|
624
604
|
}
|
|
605
|
+
function firstOrUndefinedIterator(iter) {
|
|
606
|
+
if (iter) {
|
|
607
|
+
for (const value of iter) {
|
|
608
|
+
return value;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return void 0;
|
|
612
|
+
}
|
|
625
613
|
function first(array) {
|
|
626
614
|
Debug.assert(array.length !== 0);
|
|
627
615
|
return array[0];
|
|
@@ -713,17 +701,6 @@ function getOwnValues(collection) {
|
|
|
713
701
|
}
|
|
714
702
|
return values;
|
|
715
703
|
}
|
|
716
|
-
var _entries = Object.entries || ((obj) => {
|
|
717
|
-
const keys = getOwnKeys(obj);
|
|
718
|
-
const result = Array(keys.length);
|
|
719
|
-
for (let i = 0; i < keys.length; i++) {
|
|
720
|
-
result[i] = [keys[i], obj[keys[i]]];
|
|
721
|
-
}
|
|
722
|
-
return result;
|
|
723
|
-
});
|
|
724
|
-
function getEntries(obj) {
|
|
725
|
-
return obj ? _entries(obj) : [];
|
|
726
|
-
}
|
|
727
704
|
function arrayOf(count, f) {
|
|
728
705
|
const result = new Array(count);
|
|
729
706
|
for (let i = 0; i < count; i++) {
|
|
@@ -733,8 +710,8 @@ function arrayOf(count, f) {
|
|
|
733
710
|
}
|
|
734
711
|
function arrayFrom(iterator, map2) {
|
|
735
712
|
const result = [];
|
|
736
|
-
for (
|
|
737
|
-
result.push(map2 ? map2(
|
|
713
|
+
for (const value of iterator) {
|
|
714
|
+
result.push(map2 ? map2(value) : value);
|
|
738
715
|
}
|
|
739
716
|
return result;
|
|
740
717
|
}
|
|
@@ -886,7 +863,7 @@ function createQueue(items) {
|
|
|
886
863
|
};
|
|
887
864
|
}
|
|
888
865
|
function isArray(value) {
|
|
889
|
-
return Array.isArray
|
|
866
|
+
return Array.isArray(value);
|
|
890
867
|
}
|
|
891
868
|
function toArray(value) {
|
|
892
869
|
return isArray(value) ? value : [value];
|
|
@@ -7157,6 +7134,9 @@ var Diagnostics = {
|
|
|
7157
7134
|
Found_1_error_in_1: diag(6259, 3 /* Message */, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
7158
7135
|
Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, 3 /* Message */, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
|
|
7159
7136
|
Found_0_errors_in_1_files: diag(6261, 3 /* Message */, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
7137
|
+
File_name_0_has_a_1_extension_looking_up_2_instead: diag(6262, 3 /* Message */, "File_name_0_has_a_1_extension_looking_up_2_instead_6262", "File name '{0}' has a '{1}' extension - looking up '{2}' instead."),
|
|
7138
|
+
Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set: diag(6263, 1 /* Error */, "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263", "Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),
|
|
7139
|
+
Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present: diag(6264, 3 /* Message */, "Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264", "Enable importing files with any extension, provided a declaration file is present."),
|
|
7160
7140
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, 3 /* Message */, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
7161
7141
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, 3 /* Message */, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
7162
7142
|
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, 3 /* Message */, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
@@ -7888,8 +7868,8 @@ var textToKeywordObj = {
|
|
|
7888
7868
|
await: 133 /* AwaitKeyword */,
|
|
7889
7869
|
of: 162 /* OfKeyword */
|
|
7890
7870
|
};
|
|
7891
|
-
var textToKeyword = new Map(
|
|
7892
|
-
var textToToken = new Map(
|
|
7871
|
+
var textToKeyword = new Map(Object.entries(textToKeywordObj));
|
|
7872
|
+
var textToToken = new Map(Object.entries({
|
|
7893
7873
|
...textToKeywordObj,
|
|
7894
7874
|
"{": 18 /* OpenBraceToken */,
|
|
7895
7875
|
"}": 19 /* CloseBraceToken */,
|
|
@@ -11279,8 +11259,7 @@ function optionsHaveChanges(oldOptions, newOptions, optionDeclarations2) {
|
|
|
11279
11259
|
}
|
|
11280
11260
|
function forEachEntry(map2, callback) {
|
|
11281
11261
|
const iterator = map2.entries();
|
|
11282
|
-
for (
|
|
11283
|
-
const [key, value] = iterResult.value;
|
|
11262
|
+
for (const [key, value] of iterator) {
|
|
11284
11263
|
const result = callback(value, key);
|
|
11285
11264
|
if (result) {
|
|
11286
11265
|
return result;
|
|
@@ -11290,8 +11269,8 @@ function forEachEntry(map2, callback) {
|
|
|
11290
11269
|
}
|
|
11291
11270
|
function forEachKey(map2, callback) {
|
|
11292
11271
|
const iterator = map2.keys();
|
|
11293
|
-
for (
|
|
11294
|
-
const result = callback(
|
|
11272
|
+
for (const key of iterator) {
|
|
11273
|
+
const result = callback(key);
|
|
11295
11274
|
if (result) {
|
|
11296
11275
|
return result;
|
|
11297
11276
|
}
|
|
@@ -13957,7 +13936,7 @@ function hasInvalidEscape(template) {
|
|
|
13957
13936
|
var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
13958
13937
|
var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
13959
13938
|
var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
13960
|
-
var escapedCharsMap = new Map(
|
|
13939
|
+
var escapedCharsMap = new Map(Object.entries({
|
|
13961
13940
|
" ": "\\t",
|
|
13962
13941
|
"\v": "\\v",
|
|
13963
13942
|
"\f": "\\f",
|
|
@@ -14003,7 +13982,7 @@ function escapeNonAsciiString(s, quoteChar) {
|
|
|
14003
13982
|
}
|
|
14004
13983
|
var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
14005
13984
|
var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
14006
|
-
var jsxEscapedCharsMap = new Map(
|
|
13985
|
+
var jsxEscapedCharsMap = new Map(Object.entries({
|
|
14007
13986
|
'"': """,
|
|
14008
13987
|
"'": "'"
|
|
14009
13988
|
}));
|
|
@@ -14277,13 +14256,13 @@ function getDeclarationEmitOutputFilePathWorker(fileName, options, currentDirect
|
|
|
14277
14256
|
return removeFileExtension(path) + declarationExtension;
|
|
14278
14257
|
}
|
|
14279
14258
|
function getDeclarationEmitExtensionForPath(path) {
|
|
14280
|
-
return fileExtensionIsOneOf(path, [".mjs" /* Mjs */, ".mts" /* Mts */]) ? ".d.mts" /* Dmts */ : fileExtensionIsOneOf(path, [".cjs" /* Cjs */, ".cts" /* Cts */]) ? ".d.cts" /* Dcts */ : fileExtensionIsOneOf(path, [".json" /* Json */]) ? `.json.
|
|
14259
|
+
return fileExtensionIsOneOf(path, [".mjs" /* Mjs */, ".mts" /* Mts */]) ? ".d.mts" /* Dmts */ : fileExtensionIsOneOf(path, [".cjs" /* Cjs */, ".cts" /* Cts */]) ? ".d.cts" /* Dcts */ : fileExtensionIsOneOf(path, [".json" /* Json */]) ? `.d.json.ts` : (
|
|
14281
14260
|
// Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well
|
|
14282
14261
|
".d.ts" /* Dts */
|
|
14283
14262
|
);
|
|
14284
14263
|
}
|
|
14285
14264
|
function getPossibleOriginalInputExtensionForExtension(path) {
|
|
14286
|
-
return fileExtensionIsOneOf(path, [".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".mts" /* Mts */]) ? [".mts" /* Mts */, ".mjs" /* Mjs */] : fileExtensionIsOneOf(path, [".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".cts" /* Cts */]) ? [".cts" /* Cts */, ".cjs" /* Cjs */] : fileExtensionIsOneOf(path, [`.json.
|
|
14265
|
+
return fileExtensionIsOneOf(path, [".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".mts" /* Mts */]) ? [".mts" /* Mts */, ".mjs" /* Mjs */] : fileExtensionIsOneOf(path, [".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".cts" /* Cts */]) ? [".cts" /* Cts */, ".cjs" /* Cjs */] : fileExtensionIsOneOf(path, [`.d.json.ts`]) ? [".json" /* Json */] : [".tsx" /* Tsx */, ".ts" /* Ts */, ".jsx" /* Jsx */, ".js" /* Js */];
|
|
14287
14266
|
}
|
|
14288
14267
|
function outFile(options) {
|
|
14289
14268
|
return options.outFile || options.out;
|
|
@@ -16156,7 +16135,7 @@ function positionIsSynthesized(pos) {
|
|
|
16156
16135
|
return !(pos >= 0);
|
|
16157
16136
|
}
|
|
16158
16137
|
function extensionIsTS(ext) {
|
|
16159
|
-
return ext === ".ts" /* Ts */ || ext === ".tsx" /* Tsx */ || ext === ".d.ts" /* Dts */ || ext === ".cts" /* Cts */ || ext === ".mts" /* Mts */ || ext === ".d.mts" /* Dmts */ || ext === ".d.cts" /* Dcts
|
|
16138
|
+
return ext === ".ts" /* Ts */ || ext === ".tsx" /* Tsx */ || ext === ".d.ts" /* Dts */ || ext === ".cts" /* Cts */ || ext === ".mts" /* Mts */ || ext === ".d.mts" /* Dmts */ || ext === ".d.cts" /* Dcts */ || startsWith(ext, ".d.") && endsWith(ext, ".ts");
|
|
16160
16139
|
}
|
|
16161
16140
|
function resolutionExtensionIsTSOrJson(ext) {
|
|
16162
16141
|
return extensionIsTS(ext) || ext === ".json" /* Json */;
|
|
@@ -23236,6 +23215,9 @@ function isTypeOfExpression(node) {
|
|
|
23236
23215
|
function isVoidExpression(node) {
|
|
23237
23216
|
return node.kind === 219 /* VoidExpression */;
|
|
23238
23217
|
}
|
|
23218
|
+
function isAwaitExpression(node) {
|
|
23219
|
+
return node.kind === 220 /* AwaitExpression */;
|
|
23220
|
+
}
|
|
23239
23221
|
function isPrefixUnaryExpression(node) {
|
|
23240
23222
|
return node.kind === 221 /* PrefixUnaryExpression */;
|
|
23241
23223
|
}
|
|
@@ -25257,7 +25239,6 @@ var Parser;
|
|
|
25257
25239
|
let currentToken;
|
|
25258
25240
|
let nodeCount;
|
|
25259
25241
|
let identifiers;
|
|
25260
|
-
let privateIdentifiers;
|
|
25261
25242
|
let identifierCount;
|
|
25262
25243
|
let parsingContext;
|
|
25263
25244
|
let notParenthesizedArrow;
|
|
@@ -25410,7 +25391,6 @@ var Parser;
|
|
|
25410
25391
|
parseDiagnostics = [];
|
|
25411
25392
|
parsingContext = 0;
|
|
25412
25393
|
identifiers = /* @__PURE__ */ new Map();
|
|
25413
|
-
privateIdentifiers = /* @__PURE__ */ new Map();
|
|
25414
25394
|
identifierCount = 0;
|
|
25415
25395
|
nodeCount = 0;
|
|
25416
25396
|
sourceFlags = 0;
|
|
@@ -26151,16 +26131,9 @@ var Parser;
|
|
|
26151
26131
|
parseExpected(23 /* CloseBracketToken */);
|
|
26152
26132
|
return finishNode(factory2.createComputedPropertyName(expression), pos);
|
|
26153
26133
|
}
|
|
26154
|
-
function internPrivateIdentifier(text) {
|
|
26155
|
-
let privateIdentifier = privateIdentifiers.get(text);
|
|
26156
|
-
if (privateIdentifier === void 0) {
|
|
26157
|
-
privateIdentifiers.set(text, privateIdentifier = text);
|
|
26158
|
-
}
|
|
26159
|
-
return privateIdentifier;
|
|
26160
|
-
}
|
|
26161
26134
|
function parsePrivateIdentifier() {
|
|
26162
26135
|
const pos = getNodePos();
|
|
26163
|
-
const node = factory2.createPrivateIdentifier(
|
|
26136
|
+
const node = factory2.createPrivateIdentifier(internIdentifier(scanner.getTokenValue()));
|
|
26164
26137
|
nextToken();
|
|
26165
26138
|
return finishNode(node, pos);
|
|
26166
26139
|
}
|
|
@@ -28393,7 +28366,7 @@ var Parser;
|
|
|
28393
28366
|
const pos = getNodePos();
|
|
28394
28367
|
return finishNode(factory2.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);
|
|
28395
28368
|
}
|
|
28396
|
-
function
|
|
28369
|
+
function isAwaitExpression2() {
|
|
28397
28370
|
if (token() === 133 /* AwaitKeyword */) {
|
|
28398
28371
|
if (inAwaitContext()) {
|
|
28399
28372
|
return true;
|
|
@@ -28441,7 +28414,7 @@ var Parser;
|
|
|
28441
28414
|
case 29 /* LessThanToken */:
|
|
28442
28415
|
return parseTypeAssertion();
|
|
28443
28416
|
case 133 /* AwaitKeyword */:
|
|
28444
|
-
if (
|
|
28417
|
+
if (isAwaitExpression2()) {
|
|
28445
28418
|
return parseAwaitExpression();
|
|
28446
28419
|
}
|
|
28447
28420
|
default:
|
|
@@ -32104,7 +32077,7 @@ var IncrementalParser;
|
|
|
32104
32077
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
32105
32078
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
32106
32079
|
function isDeclarationFileName(fileName) {
|
|
32107
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions);
|
|
32080
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
|
|
32108
32081
|
}
|
|
32109
32082
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
32110
32083
|
if (!mode) {
|
|
@@ -32323,14 +32296,14 @@ var compileOnSaveCommandLineOption = {
|
|
|
32323
32296
|
type: "boolean",
|
|
32324
32297
|
defaultValueDescription: false
|
|
32325
32298
|
};
|
|
32326
|
-
var jsxOptionMap = new Map(
|
|
32299
|
+
var jsxOptionMap = new Map(Object.entries({
|
|
32327
32300
|
"preserve": 1 /* Preserve */,
|
|
32328
32301
|
"react-native": 3 /* ReactNative */,
|
|
32329
32302
|
"react": 2 /* React */,
|
|
32330
32303
|
"react-jsx": 4 /* ReactJSX */,
|
|
32331
32304
|
"react-jsxdev": 5 /* ReactJSXDev */
|
|
32332
32305
|
}));
|
|
32333
|
-
var inverseJsxOptionMap = new Map(
|
|
32306
|
+
var inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key]));
|
|
32334
32307
|
var libEntries = [
|
|
32335
32308
|
// JavaScript only
|
|
32336
32309
|
["es5", "lib.es5.d.ts"],
|
|
@@ -32411,7 +32384,7 @@ var libMap = new Map(libEntries);
|
|
|
32411
32384
|
var optionsForWatch = [
|
|
32412
32385
|
{
|
|
32413
32386
|
name: "watchFile",
|
|
32414
|
-
type: new Map(
|
|
32387
|
+
type: new Map(Object.entries({
|
|
32415
32388
|
fixedpollinginterval: 0 /* FixedPollingInterval */,
|
|
32416
32389
|
prioritypollinginterval: 1 /* PriorityPollingInterval */,
|
|
32417
32390
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -32425,7 +32398,7 @@ var optionsForWatch = [
|
|
|
32425
32398
|
},
|
|
32426
32399
|
{
|
|
32427
32400
|
name: "watchDirectory",
|
|
32428
|
-
type: new Map(
|
|
32401
|
+
type: new Map(Object.entries({
|
|
32429
32402
|
usefsevents: 0 /* UseFsEvents */,
|
|
32430
32403
|
fixedpollinginterval: 1 /* FixedPollingInterval */,
|
|
32431
32404
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -32437,7 +32410,7 @@ var optionsForWatch = [
|
|
|
32437
32410
|
},
|
|
32438
32411
|
{
|
|
32439
32412
|
name: "fallbackPolling",
|
|
32440
|
-
type: new Map(
|
|
32413
|
+
type: new Map(Object.entries({
|
|
32441
32414
|
fixedinterval: 0 /* FixedInterval */,
|
|
32442
32415
|
priorityinterval: 1 /* PriorityInterval */,
|
|
32443
32416
|
dynamicpriority: 2 /* DynamicPriority */,
|
|
@@ -32668,7 +32641,7 @@ var commonOptionsWithBuild = [
|
|
|
32668
32641
|
var targetOptionDeclaration = {
|
|
32669
32642
|
name: "target",
|
|
32670
32643
|
shortName: "t",
|
|
32671
|
-
type: new Map(
|
|
32644
|
+
type: new Map(Object.entries({
|
|
32672
32645
|
es3: 0 /* ES3 */,
|
|
32673
32646
|
es5: 1 /* ES5 */,
|
|
32674
32647
|
es6: 2 /* ES2015 */,
|
|
@@ -32695,7 +32668,7 @@ var targetOptionDeclaration = {
|
|
|
32695
32668
|
var moduleOptionDeclaration = {
|
|
32696
32669
|
name: "module",
|
|
32697
32670
|
shortName: "m",
|
|
32698
|
-
type: new Map(
|
|
32671
|
+
type: new Map(Object.entries({
|
|
32699
32672
|
none: 0 /* None */,
|
|
32700
32673
|
commonjs: 1 /* CommonJS */,
|
|
32701
32674
|
amd: 2 /* AMD */,
|
|
@@ -32918,7 +32891,7 @@ var commandOptionsWithoutBuild = [
|
|
|
32918
32891
|
},
|
|
32919
32892
|
{
|
|
32920
32893
|
name: "importsNotUsedAsValues",
|
|
32921
|
-
type: new Map(
|
|
32894
|
+
type: new Map(Object.entries({
|
|
32922
32895
|
remove: 0 /* Remove */,
|
|
32923
32896
|
preserve: 1 /* Preserve */,
|
|
32924
32897
|
error: 2 /* Error */
|
|
@@ -33120,7 +33093,7 @@ var commandOptionsWithoutBuild = [
|
|
|
33120
33093
|
// Module Resolution
|
|
33121
33094
|
{
|
|
33122
33095
|
name: "moduleResolution",
|
|
33123
|
-
type: new Map(
|
|
33096
|
+
type: new Map(Object.entries({
|
|
33124
33097
|
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
33125
33098
|
node10: 2 /* Node10 */,
|
|
33126
33099
|
node: 2 /* Node10 */,
|
|
@@ -33362,6 +33335,14 @@ var commandOptionsWithoutBuild = [
|
|
|
33362
33335
|
description: Diagnostics.Enable_importing_json_files,
|
|
33363
33336
|
defaultValueDescription: false
|
|
33364
33337
|
},
|
|
33338
|
+
{
|
|
33339
|
+
name: "allowArbitraryExtensions",
|
|
33340
|
+
type: "boolean",
|
|
33341
|
+
affectsModuleResolution: true,
|
|
33342
|
+
category: Diagnostics.Modules,
|
|
33343
|
+
description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,
|
|
33344
|
+
defaultValueDescription: false
|
|
33345
|
+
},
|
|
33365
33346
|
{
|
|
33366
33347
|
name: "out",
|
|
33367
33348
|
type: "string",
|
|
@@ -33412,7 +33393,7 @@ var commandOptionsWithoutBuild = [
|
|
|
33412
33393
|
},
|
|
33413
33394
|
{
|
|
33414
33395
|
name: "newLine",
|
|
33415
|
-
type: new Map(
|
|
33396
|
+
type: new Map(Object.entries({
|
|
33416
33397
|
crlf: 0 /* CarriageReturnLineFeed */,
|
|
33417
33398
|
lf: 1 /* LineFeed */
|
|
33418
33399
|
})),
|
|
@@ -33656,7 +33637,7 @@ var commandOptionsWithoutBuild = [
|
|
|
33656
33637
|
},
|
|
33657
33638
|
{
|
|
33658
33639
|
name: "moduleDetection",
|
|
33659
|
-
type: new Map(
|
|
33640
|
+
type: new Map(Object.entries({
|
|
33660
33641
|
auto: 2 /* Auto */,
|
|
33661
33642
|
legacy: 1 /* Legacy */,
|
|
33662
33643
|
force: 3 /* Force */
|
|
@@ -35513,9 +35494,9 @@ function getDefaultValueForOption(option) {
|
|
|
35513
35494
|
case "object":
|
|
35514
35495
|
return {};
|
|
35515
35496
|
default:
|
|
35516
|
-
const
|
|
35517
|
-
if (
|
|
35518
|
-
return
|
|
35497
|
+
const value = firstOrUndefinedIterator(option.type.keys());
|
|
35498
|
+
if (value !== void 0)
|
|
35499
|
+
return value;
|
|
35519
35500
|
return Debug.fail("Expected 'option.type' to have entries.");
|
|
35520
35501
|
}
|
|
35521
35502
|
}
|
|
@@ -36805,14 +36786,19 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
36805
36786
|
}
|
|
36806
36787
|
}
|
|
36807
36788
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36789
|
+
const filename = getBaseFileName(candidate);
|
|
36790
|
+
if (filename.indexOf(".") === -1) {
|
|
36791
|
+
return void 0;
|
|
36792
|
+
}
|
|
36793
|
+
let extensionless = removeFileExtension(candidate);
|
|
36794
|
+
if (extensionless === candidate) {
|
|
36795
|
+
extensionless = candidate.substring(0, candidate.lastIndexOf("."));
|
|
36796
|
+
}
|
|
36797
|
+
const extension = candidate.substring(extensionless.length);
|
|
36798
|
+
if (state.traceEnabled) {
|
|
36799
|
+
trace(state.host, Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension);
|
|
36815
36800
|
}
|
|
36801
|
+
return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
|
|
36816
36802
|
}
|
|
36817
36803
|
function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
|
|
36818
36804
|
if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
|
|
@@ -36836,38 +36822,23 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
36836
36822
|
case ".mjs" /* Mjs */:
|
|
36837
36823
|
case ".mts" /* Mts */:
|
|
36838
36824
|
case ".d.mts" /* Dmts */:
|
|
36839
|
-
return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0;
|
|
36825
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */, originalExtension === ".mts" /* Mts */ || originalExtension === ".d.mts" /* Dmts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */, originalExtension === ".mts" /* Mts */ || originalExtension === ".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0;
|
|
36840
36826
|
case ".cjs" /* Cjs */:
|
|
36841
36827
|
case ".cts" /* Cts */:
|
|
36842
36828
|
case ".d.cts" /* Dcts */:
|
|
36843
|
-
return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0;
|
|
36829
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */, originalExtension === ".cts" /* Cts */ || originalExtension === ".d.cts" /* Dcts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */, originalExtension === ".cts" /* Cts */ || originalExtension === ".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0;
|
|
36844
36830
|
case ".json" /* Json */:
|
|
36845
|
-
|
|
36846
|
-
if (extensions & 4 /* Declaration */) {
|
|
36847
|
-
candidate += ".json" /* Json */;
|
|
36848
|
-
const result = tryExtension(".d.ts" /* Dts */);
|
|
36849
|
-
if (result)
|
|
36850
|
-
return result;
|
|
36851
|
-
}
|
|
36852
|
-
if (extensions & 8 /* Json */) {
|
|
36853
|
-
candidate = originalCandidate;
|
|
36854
|
-
const result = tryExtension(".json" /* Json */);
|
|
36855
|
-
if (result)
|
|
36856
|
-
return result;
|
|
36857
|
-
}
|
|
36858
|
-
return void 0;
|
|
36859
|
-
case ".ts" /* Ts */:
|
|
36831
|
+
return extensions & 4 /* Declaration */ && tryExtension(".d.json.ts") || extensions & 8 /* Json */ && tryExtension(".json" /* Json */) || void 0;
|
|
36860
36832
|
case ".tsx" /* Tsx */:
|
|
36833
|
+
case ".jsx" /* Jsx */:
|
|
36834
|
+
return extensions & 1 /* TypeScript */ && (tryExtension(".tsx" /* Tsx */, originalExtension === ".tsx" /* Tsx */) || tryExtension(".ts" /* Ts */, originalExtension === ".tsx" /* Tsx */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */, originalExtension === ".tsx" /* Tsx */) || extensions & 2 /* JavaScript */ && (tryExtension(".jsx" /* Jsx */) || tryExtension(".js" /* Js */)) || void 0;
|
|
36835
|
+
case ".ts" /* Ts */:
|
|
36861
36836
|
case ".d.ts" /* Dts */:
|
|
36862
|
-
|
|
36863
|
-
|
|
36864
|
-
|
|
36865
|
-
/*resolvedUsingTsExtension*/
|
|
36866
|
-
true
|
|
36867
|
-
);
|
|
36868
|
-
}
|
|
36837
|
+
case ".js" /* Js */:
|
|
36838
|
+
case "":
|
|
36839
|
+
return extensions & 1 /* TypeScript */ && (tryExtension(".ts" /* Ts */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */) || tryExtension(".tsx" /* Tsx */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */, originalExtension === ".ts" /* Ts */ || originalExtension === ".d.ts" /* Dts */) || extensions & 2 /* JavaScript */ && (tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */)) || state.isConfigLookup && tryExtension(".json" /* Json */) || void 0;
|
|
36869
36840
|
default:
|
|
36870
|
-
return extensions &
|
|
36841
|
+
return extensions & 4 /* Declaration */ && !isDeclarationFileName(candidate + originalExtension) && tryExtension(`.d${originalExtension}.ts`) || void 0;
|
|
36871
36842
|
}
|
|
36872
36843
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
36873
36844
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
@@ -37806,11 +37777,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
37806
37777
|
}
|
|
37807
37778
|
}
|
|
37808
37779
|
}
|
|
37809
|
-
function moduleResolutionSupportsResolvingTsExtensions(compilerOptions) {
|
|
37810
|
-
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
37811
|
-
}
|
|
37812
37780
|
function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
|
|
37813
|
-
return
|
|
37781
|
+
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && (!!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName));
|
|
37814
37782
|
}
|
|
37815
37783
|
function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
|
|
37816
37784
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -41500,6 +41468,8 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
41500
41468
|
}
|
|
41501
41469
|
if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
41502
41470
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
41471
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && stringContains(fileName, ".d.")) {
|
|
41472
|
+
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
41503
41473
|
}
|
|
41504
41474
|
switch (allowedEndings[0]) {
|
|
41505
41475
|
case 0 /* Minimal */:
|
|
@@ -41523,6 +41493,14 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
41523
41493
|
return Debug.assertNever(allowedEndings[0]);
|
|
41524
41494
|
}
|
|
41525
41495
|
}
|
|
41496
|
+
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
41497
|
+
const baseName = getBaseFileName(fileName);
|
|
41498
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !stringContains(baseName, ".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
41499
|
+
return void 0;
|
|
41500
|
+
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
41501
|
+
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
41502
|
+
return noExtension.substring(0, noExtension.indexOf(".d.")) + ext;
|
|
41503
|
+
}
|
|
41526
41504
|
function getJSExtensionForFile(fileName, options) {
|
|
41527
41505
|
var _a2;
|
|
41528
41506
|
return (_a2 = tryGetJSExtensionForFile(fileName, options)) != null ? _a2 : Debug.fail(`Extension ${extensionFromPath(fileName)} is unsupported:: FileName:: ${fileName}`);
|
|
@@ -41652,7 +41630,7 @@ var TypeFacts = /* @__PURE__ */ ((TypeFacts3) => {
|
|
|
41652
41630
|
TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
41653
41631
|
return TypeFacts3;
|
|
41654
41632
|
})(TypeFacts || {});
|
|
41655
|
-
var typeofNEFacts = new Map(
|
|
41633
|
+
var typeofNEFacts = new Map(Object.entries({
|
|
41656
41634
|
string: 256 /* TypeofNEString */,
|
|
41657
41635
|
number: 512 /* TypeofNENumber */,
|
|
41658
41636
|
bigint: 1024 /* TypeofNEBigInt */,
|
|
@@ -41683,7 +41661,7 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
|
41683
41661
|
return SignatureCheckMode3;
|
|
41684
41662
|
})(SignatureCheckMode || {});
|
|
41685
41663
|
var isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor);
|
|
41686
|
-
var intrinsicTypeKinds = new Map(
|
|
41664
|
+
var intrinsicTypeKinds = new Map(Object.entries({
|
|
41687
41665
|
Uppercase: 0 /* Uppercase */,
|
|
41688
41666
|
Lowercase: 1 /* Lowercase */,
|
|
41689
41667
|
Capitalize: 2 /* Capitalize */,
|
|
@@ -41774,9 +41752,9 @@ function createTypeChecker(host) {
|
|
|
41774
41752
|
const requireSymbol = createSymbol(4 /* Property */, "require");
|
|
41775
41753
|
let apparentArgumentCount;
|
|
41776
41754
|
const checker = {
|
|
41777
|
-
getNodeCount: () =>
|
|
41778
|
-
getIdentifierCount: () =>
|
|
41779
|
-
getSymbolCount: () =>
|
|
41755
|
+
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),
|
|
41756
|
+
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),
|
|
41757
|
+
getSymbolCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.symbolCount, symbolCount),
|
|
41780
41758
|
getTypeCount: () => typeCount,
|
|
41781
41759
|
getInstantiationCount: () => totalInstantiationCount,
|
|
41782
41760
|
getRelationCacheSizes: () => ({
|
|
@@ -43948,7 +43926,7 @@ function createTypeChecker(host) {
|
|
|
43948
43926
|
const hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
43949
43927
|
const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
43950
43928
|
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
43951
|
-
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
43929
|
+
if (hasExportAssignmentSymbol(moduleSymbol) && !(getAllowSyntheticDefaultImports(compilerOptions) || getESModuleInterop(compilerOptions))) {
|
|
43952
43930
|
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
43953
43931
|
const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
43954
43932
|
const exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
@@ -44743,7 +44721,7 @@ function createTypeChecker(host) {
|
|
|
44743
44721
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
44744
44722
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
44745
44723
|
const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
44746
|
-
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
44724
|
+
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
44747
44725
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
44748
44726
|
if (sourceFile) {
|
|
44749
44727
|
if (resolutionDiagnostic) {
|
|
@@ -48697,7 +48675,9 @@ function createTypeChecker(host) {
|
|
|
48697
48675
|
case 267 /* NamespaceExportDeclaration */:
|
|
48698
48676
|
addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
|
|
48699
48677
|
break;
|
|
48700
|
-
case 270 /* ImportClause */:
|
|
48678
|
+
case 270 /* ImportClause */: {
|
|
48679
|
+
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
48680
|
+
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
|
|
48701
48681
|
addResult(factory.createImportDeclaration(
|
|
48702
48682
|
/*modifiers*/
|
|
48703
48683
|
void 0,
|
|
@@ -48708,15 +48688,14 @@ function createTypeChecker(host) {
|
|
|
48708
48688
|
/*namedBindings*/
|
|
48709
48689
|
void 0
|
|
48710
48690
|
),
|
|
48711
|
-
|
|
48712
|
-
|
|
48713
|
-
// In such cases, the `target` refers to the module itself already
|
|
48714
|
-
factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)),
|
|
48715
|
-
/*assertClause*/
|
|
48716
|
-
void 0
|
|
48691
|
+
specifier2,
|
|
48692
|
+
node.parent.assertClause
|
|
48717
48693
|
), 0 /* None */);
|
|
48718
48694
|
break;
|
|
48719
|
-
|
|
48695
|
+
}
|
|
48696
|
+
case 271 /* NamespaceImport */: {
|
|
48697
|
+
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
48698
|
+
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
|
|
48720
48699
|
addResult(factory.createImportDeclaration(
|
|
48721
48700
|
/*modifiers*/
|
|
48722
48701
|
void 0,
|
|
@@ -48727,11 +48706,11 @@ function createTypeChecker(host) {
|
|
|
48727
48706
|
void 0,
|
|
48728
48707
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
48729
48708
|
),
|
|
48730
|
-
|
|
48731
|
-
|
|
48732
|
-
void 0
|
|
48709
|
+
specifier2,
|
|
48710
|
+
node.parent.parent.assertClause
|
|
48733
48711
|
), 0 /* None */);
|
|
48734
48712
|
break;
|
|
48713
|
+
}
|
|
48735
48714
|
case 277 /* NamespaceExport */:
|
|
48736
48715
|
addResult(factory.createExportDeclaration(
|
|
48737
48716
|
/*modifiers*/
|
|
@@ -48742,7 +48721,9 @@ function createTypeChecker(host) {
|
|
|
48742
48721
|
factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
|
|
48743
48722
|
), 0 /* None */);
|
|
48744
48723
|
break;
|
|
48745
|
-
case 273 /* ImportSpecifier */:
|
|
48724
|
+
case 273 /* ImportSpecifier */: {
|
|
48725
|
+
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
48726
|
+
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
|
|
48746
48727
|
addResult(factory.createImportDeclaration(
|
|
48747
48728
|
/*modifiers*/
|
|
48748
48729
|
void 0,
|
|
@@ -48760,11 +48741,11 @@ function createTypeChecker(host) {
|
|
|
48760
48741
|
)
|
|
48761
48742
|
])
|
|
48762
48743
|
),
|
|
48763
|
-
|
|
48764
|
-
|
|
48765
|
-
void 0
|
|
48744
|
+
specifier2,
|
|
48745
|
+
node.parent.parent.parent.assertClause
|
|
48766
48746
|
), 0 /* None */);
|
|
48767
48747
|
break;
|
|
48748
|
+
}
|
|
48768
48749
|
case 278 /* ExportSpecifier */:
|
|
48769
48750
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
48770
48751
|
serializeExportSpecifier(
|
|
@@ -52649,7 +52630,7 @@ function createTypeChecker(host) {
|
|
|
52649
52630
|
}
|
|
52650
52631
|
}
|
|
52651
52632
|
}
|
|
52652
|
-
if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */) && !(propSet && getCommonDeclarationsOfSymbols(
|
|
52633
|
+
if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */) && !(propSet && getCommonDeclarationsOfSymbols(propSet.values()))) {
|
|
52653
52634
|
return void 0;
|
|
52654
52635
|
}
|
|
52655
52636
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
@@ -54740,7 +54721,7 @@ function createTypeChecker(host) {
|
|
|
54740
54721
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
54741
54722
|
return namedUnions[0];
|
|
54742
54723
|
}
|
|
54743
|
-
const namedTypesCount = reduceLeft(namedUnions, (
|
|
54724
|
+
const namedTypesCount = reduceLeft(namedUnions, (sum, union) => sum + union.types.length, 0);
|
|
54744
54725
|
if (namedTypesCount + reducedTypes.length === typeSet.length) {
|
|
54745
54726
|
for (const t of namedUnions) {
|
|
54746
54727
|
insertType(reducedTypes, t);
|
|
@@ -55783,14 +55764,11 @@ function createTypeChecker(host) {
|
|
|
55783
55764
|
const constraint = getConstraintOfTypeParameter(p);
|
|
55784
55765
|
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
55785
55766
|
}
|
|
55786
|
-
function
|
|
55787
|
-
return
|
|
55788
|
-
}
|
|
55789
|
-
function isSingletonTupleType(node) {
|
|
55790
|
-
return isTupleTypeNode(node) && length(node.elements) === 1 && !isOptionalTypeNode(node.elements[0]) && !isRestTypeNode(node.elements[0]) && !(isNamedTupleMember(node.elements[0]) && (node.elements[0].questionToken || node.elements[0].dotDotDotToken));
|
|
55767
|
+
function isSimpleTupleType(node) {
|
|
55768
|
+
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
|
|
55791
55769
|
}
|
|
55792
|
-
function
|
|
55793
|
-
return
|
|
55770
|
+
function isDeferredType(type, checkTuples) {
|
|
55771
|
+
return isGenericType(type) || checkTuples && isTupleType(type) && some(getTypeArguments(type), isGenericType);
|
|
55794
55772
|
}
|
|
55795
55773
|
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
55796
55774
|
let result;
|
|
@@ -55802,10 +55780,10 @@ function createTypeChecker(host) {
|
|
|
55802
55780
|
result = errorType;
|
|
55803
55781
|
break;
|
|
55804
55782
|
}
|
|
55805
|
-
const
|
|
55806
|
-
const checkType = instantiateType(
|
|
55807
|
-
const
|
|
55808
|
-
const extendsType = instantiateType(
|
|
55783
|
+
const checkTuples = isSimpleTupleType(root.node.checkType) && isSimpleTupleType(root.node.extendsType) && length(root.node.checkType.elements) === length(root.node.extendsType.elements);
|
|
55784
|
+
const checkType = instantiateType(getActualTypeVariable(root.checkType), mapper);
|
|
55785
|
+
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
55786
|
+
const extendsType = instantiateType(root.extendsType, mapper);
|
|
55809
55787
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
55810
55788
|
return wildcardType;
|
|
55811
55789
|
}
|
|
@@ -55827,16 +55805,16 @@ function createTypeChecker(host) {
|
|
|
55827
55805
|
}
|
|
55828
55806
|
}
|
|
55829
55807
|
}
|
|
55830
|
-
if (!
|
|
55808
|
+
if (!checkTypeDeferred) {
|
|
55831
55809
|
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
55832
55810
|
}
|
|
55833
55811
|
const innerMapper = combineTypeMappers(freshMapper, context.mapper);
|
|
55834
55812
|
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
55835
55813
|
}
|
|
55836
|
-
const inferredExtendsType = combinedMapper ? instantiateType(
|
|
55837
|
-
if (!
|
|
55838
|
-
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */
|
|
55839
|
-
if (checkType.flags & 1 /* Any */
|
|
55814
|
+
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
55815
|
+
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
55816
|
+
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
55817
|
+
if (checkType.flags & 1 /* Any */) {
|
|
55840
55818
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
55841
55819
|
}
|
|
55842
55820
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -57202,8 +57180,8 @@ function createTypeChecker(host) {
|
|
|
57202
57180
|
}
|
|
57203
57181
|
function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
57204
57182
|
let reportedError = false;
|
|
57205
|
-
for (
|
|
57206
|
-
const { errorNode: prop, innerExpression: next, nameType, errorMessage } =
|
|
57183
|
+
for (const value of iterator) {
|
|
57184
|
+
const { errorNode: prop, innerExpression: next, nameType, errorMessage } = value;
|
|
57207
57185
|
let targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType);
|
|
57208
57186
|
if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */)
|
|
57209
57187
|
continue;
|
|
@@ -57279,6 +57257,74 @@ function createTypeChecker(host) {
|
|
|
57279
57257
|
}
|
|
57280
57258
|
return reportedError;
|
|
57281
57259
|
}
|
|
57260
|
+
function elaborateIterableOrArrayLikeTargetElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
57261
|
+
const tupleOrArrayLikeTargetParts = filterType(target, isArrayOrTupleLikeType);
|
|
57262
|
+
const nonTupleOrArrayLikeTargetParts = filterType(target, (t) => !isArrayOrTupleLikeType(t));
|
|
57263
|
+
const iterationType = nonTupleOrArrayLikeTargetParts !== neverType ? getIterationTypeOfIterable(
|
|
57264
|
+
13 /* ForOf */,
|
|
57265
|
+
0 /* Yield */,
|
|
57266
|
+
nonTupleOrArrayLikeTargetParts,
|
|
57267
|
+
/*errorNode*/
|
|
57268
|
+
void 0
|
|
57269
|
+
) : void 0;
|
|
57270
|
+
let reportedError = false;
|
|
57271
|
+
for (let status = iterator.next(); !status.done; status = iterator.next()) {
|
|
57272
|
+
const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value;
|
|
57273
|
+
let targetPropType = iterationType;
|
|
57274
|
+
const targetIndexedPropType = tupleOrArrayLikeTargetParts !== neverType ? getBestMatchIndexedAccessTypeOrUndefined(source, tupleOrArrayLikeTargetParts, nameType) : void 0;
|
|
57275
|
+
if (targetIndexedPropType && !(targetIndexedPropType.flags & 8388608 /* IndexedAccess */)) {
|
|
57276
|
+
targetPropType = iterationType ? getUnionType([iterationType, targetIndexedPropType]) : targetIndexedPropType;
|
|
57277
|
+
}
|
|
57278
|
+
if (!targetPropType)
|
|
57279
|
+
continue;
|
|
57280
|
+
let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType);
|
|
57281
|
+
if (!sourcePropType)
|
|
57282
|
+
continue;
|
|
57283
|
+
const propName = getPropertyNameFromIndex(
|
|
57284
|
+
nameType,
|
|
57285
|
+
/*accessNode*/
|
|
57286
|
+
void 0
|
|
57287
|
+
);
|
|
57288
|
+
if (!checkTypeRelatedTo(
|
|
57289
|
+
sourcePropType,
|
|
57290
|
+
targetPropType,
|
|
57291
|
+
relation,
|
|
57292
|
+
/*errorNode*/
|
|
57293
|
+
void 0
|
|
57294
|
+
)) {
|
|
57295
|
+
const elaborated = next && elaborateError(
|
|
57296
|
+
next,
|
|
57297
|
+
sourcePropType,
|
|
57298
|
+
targetPropType,
|
|
57299
|
+
relation,
|
|
57300
|
+
/*headMessage*/
|
|
57301
|
+
void 0,
|
|
57302
|
+
containingMessageChain,
|
|
57303
|
+
errorOutputContainer
|
|
57304
|
+
);
|
|
57305
|
+
reportedError = true;
|
|
57306
|
+
if (!elaborated) {
|
|
57307
|
+
const resultObj = errorOutputContainer || {};
|
|
57308
|
+
const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;
|
|
57309
|
+
if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
|
|
57310
|
+
const diag2 = createDiagnosticForNode(prop, Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType));
|
|
57311
|
+
diagnostics.add(diag2);
|
|
57312
|
+
resultObj.errors = [diag2];
|
|
57313
|
+
} else {
|
|
57314
|
+
const targetIsOptional = !!(propName && (getPropertyOfType(tupleOrArrayLikeTargetParts, propName) || unknownSymbol).flags & 16777216 /* Optional */);
|
|
57315
|
+
const sourceIsOptional = !!(propName && (getPropertyOfType(source, propName) || unknownSymbol).flags & 16777216 /* Optional */);
|
|
57316
|
+
targetPropType = removeMissingType(targetPropType, targetIsOptional);
|
|
57317
|
+
sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional);
|
|
57318
|
+
const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
|
|
57319
|
+
if (result && specificSource !== sourcePropType) {
|
|
57320
|
+
checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
|
|
57321
|
+
}
|
|
57322
|
+
}
|
|
57323
|
+
}
|
|
57324
|
+
}
|
|
57325
|
+
}
|
|
57326
|
+
return reportedError;
|
|
57327
|
+
}
|
|
57282
57328
|
function* generateJsxAttributes(node) {
|
|
57283
57329
|
if (!length(node.properties))
|
|
57284
57330
|
return;
|
|
@@ -57334,13 +57380,25 @@ function createTypeChecker(host) {
|
|
|
57334
57380
|
return result;
|
|
57335
57381
|
}
|
|
57336
57382
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
57337
|
-
|
|
57338
|
-
|
|
57383
|
+
let arrayLikeTargetParts;
|
|
57384
|
+
let nonArrayLikeTargetParts;
|
|
57385
|
+
const iterableType = getGlobalIterableType(
|
|
57386
|
+
/*reportErrors*/
|
|
57387
|
+
false
|
|
57388
|
+
);
|
|
57389
|
+
if (iterableType !== emptyGenericType) {
|
|
57390
|
+
const anyIterable = createIterableType(anyType);
|
|
57391
|
+
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
57392
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
57393
|
+
} else {
|
|
57394
|
+
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
57395
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
57396
|
+
}
|
|
57339
57397
|
if (moreThanOneRealChildren) {
|
|
57340
57398
|
if (arrayLikeTargetParts !== neverType) {
|
|
57341
57399
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
57342
57400
|
const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic);
|
|
57343
|
-
result =
|
|
57401
|
+
result = elaborateIterableOrArrayLikeTargetElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result;
|
|
57344
57402
|
} else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) {
|
|
57345
57403
|
result = true;
|
|
57346
57404
|
const diag2 = error(
|
|
@@ -57542,7 +57600,21 @@ function createTypeChecker(host) {
|
|
|
57542
57600
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
57543
57601
|
for (let i = 0; i < paramCount; i++) {
|
|
57544
57602
|
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
57545
|
-
|
|
57603
|
+
let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
57604
|
+
if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
|
|
57605
|
+
targetType = mapType(targetType, (t) => {
|
|
57606
|
+
if (!isTupleType(t) || isTypeIdenticalTo(sourceType, t)) {
|
|
57607
|
+
return t;
|
|
57608
|
+
}
|
|
57609
|
+
const elementTypes = [];
|
|
57610
|
+
const elementFlags = [];
|
|
57611
|
+
for (let i2 = 0; i2 < getTypeReferenceArity(sourceType); i2++) {
|
|
57612
|
+
elementTypes.push(getTupleElementType(t, i2));
|
|
57613
|
+
elementFlags.push(sourceType.target.elementFlags[i2]);
|
|
57614
|
+
}
|
|
57615
|
+
return createTupleType(elementTypes, elementFlags);
|
|
57616
|
+
});
|
|
57617
|
+
}
|
|
57546
57618
|
if (sourceType && targetType) {
|
|
57547
57619
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
57548
57620
|
const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
@@ -61221,9 +61293,7 @@ function createTypeChecker(host) {
|
|
|
61221
61293
|
}
|
|
61222
61294
|
}
|
|
61223
61295
|
function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) {
|
|
61224
|
-
|
|
61225
|
-
if (!result.done)
|
|
61226
|
-
return result.value;
|
|
61296
|
+
return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties));
|
|
61227
61297
|
}
|
|
61228
61298
|
function tupleTypesDefinitelyUnrelated(source, target) {
|
|
61229
61299
|
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength);
|
|
@@ -71343,7 +71413,7 @@ function createTypeChecker(host) {
|
|
|
71343
71413
|
return getRegularTypeOfObjectLiteral(rightType);
|
|
71344
71414
|
}
|
|
71345
71415
|
case 27 /* CommaToken */:
|
|
71346
|
-
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !
|
|
71416
|
+
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
71347
71417
|
const sf = getSourceFileOfNode(left);
|
|
71348
71418
|
const sourceText = sf.text;
|
|
71349
71419
|
const start = skipTrivia(sourceText, left.pos);
|
|
@@ -71385,8 +71455,8 @@ function createTypeChecker(host) {
|
|
|
71385
71455
|
}
|
|
71386
71456
|
}
|
|
71387
71457
|
}
|
|
71388
|
-
function
|
|
71389
|
-
return node.kind ===
|
|
71458
|
+
function isIndirectCall(node) {
|
|
71459
|
+
return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
|
|
71390
71460
|
}
|
|
71391
71461
|
function checkForDisallowedESSymbolOperand(operator2) {
|
|
71392
71462
|
const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0;
|
|
@@ -71950,15 +72020,16 @@ function createTypeChecker(host) {
|
|
|
71950
72020
|
}
|
|
71951
72021
|
}
|
|
71952
72022
|
expr = skipParentheses(node);
|
|
72023
|
+
if (isAwaitExpression(expr)) {
|
|
72024
|
+
const type = getQuickTypeOfExpression(expr.expression);
|
|
72025
|
+
return type ? getAwaitedType(type) : void 0;
|
|
72026
|
+
}
|
|
71953
72027
|
if (isCallExpression(expr) && expr.expression.kind !== 106 /* SuperKeyword */ && !isRequireCall(
|
|
71954
72028
|
expr,
|
|
71955
72029
|
/*checkArgumentIsStringLiteralLike*/
|
|
71956
72030
|
true
|
|
71957
72031
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
71958
|
-
|
|
71959
|
-
if (type) {
|
|
71960
|
-
return type;
|
|
71961
|
-
}
|
|
72032
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
71962
72033
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
71963
72034
|
return getTypeFromTypeNode(expr.type);
|
|
71964
72035
|
} else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) {
|
|
@@ -77125,12 +77196,12 @@ function createTypeChecker(host) {
|
|
|
77125
77196
|
if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) {
|
|
77126
77197
|
grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
77127
77198
|
}
|
|
77128
|
-
if (node.isExportEquals
|
|
77129
|
-
if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */) {
|
|
77199
|
+
if (node.isExportEquals) {
|
|
77200
|
+
if (moduleKind >= 5 /* ES2015 */ && (node.flags & 16777216 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 16777216 /* Ambient */) && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */)) {
|
|
77130
77201
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
77131
|
-
} else if (moduleKind === 4 /* System */) {
|
|
77202
|
+
} else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
77132
77203
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
|
77133
|
-
} else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
|
|
77204
|
+
} else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
77134
77205
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead);
|
|
77135
77206
|
}
|
|
77136
77207
|
}
|
|
@@ -82263,8 +82334,7 @@ function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath,
|
|
|
82263
82334
|
const sourceIndexToNewSourceIndexMap = [];
|
|
82264
82335
|
let nameIndexToNewNameIndexMap;
|
|
82265
82336
|
const mappingIterator = decodeMappings(map2.mappings);
|
|
82266
|
-
for (
|
|
82267
|
-
const raw = iterResult.value;
|
|
82337
|
+
for (const raw of mappingIterator) {
|
|
82268
82338
|
if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) {
|
|
82269
82339
|
break;
|
|
82270
82340
|
}
|
|
@@ -82482,6 +82552,9 @@ function decodeMappings(mappings) {
|
|
|
82482
82552
|
return { value: captureMapping(hasSource, hasName), done };
|
|
82483
82553
|
}
|
|
82484
82554
|
return stopIterating();
|
|
82555
|
+
},
|
|
82556
|
+
[Symbol.iterator]() {
|
|
82557
|
+
return this;
|
|
82485
82558
|
}
|
|
82486
82559
|
};
|
|
82487
82560
|
function captureMapping(hasSource, hasName) {
|
|
@@ -85184,10 +85257,10 @@ function transformClassFields(context) {
|
|
|
85184
85257
|
const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */;
|
|
85185
85258
|
const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine;
|
|
85186
85259
|
const shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* ES2022 */;
|
|
85187
|
-
const shouldTransformAutoAccessors = languageVersion < 99 /* ESNext */;
|
|
85260
|
+
const shouldTransformAutoAccessors = languageVersion < 99 /* ESNext */ ? -1 /* True */ : !useDefineForClassFields ? 3 /* Maybe */ : 0 /* False */;
|
|
85188
85261
|
const shouldTransformThisInStaticInitializers = languageVersion < 9 /* ES2022 */;
|
|
85189
85262
|
const shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2 /* ES2015 */;
|
|
85190
|
-
const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors
|
|
85263
|
+
const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors === -1 /* True */;
|
|
85191
85264
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
85192
85265
|
context.onSubstituteNode = onSubstituteNode;
|
|
85193
85266
|
const previousOnEmitNode = context.onEmitNode;
|
|
@@ -85217,7 +85290,7 @@ function transformClassFields(context) {
|
|
|
85217
85290
|
}
|
|
85218
85291
|
switch (node.kind) {
|
|
85219
85292
|
case 127 /* AccessorKeyword */:
|
|
85220
|
-
return
|
|
85293
|
+
return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node;
|
|
85221
85294
|
case 260 /* ClassDeclaration */:
|
|
85222
85295
|
return visitClassDeclaration(node);
|
|
85223
85296
|
case 228 /* ClassExpression */:
|
|
@@ -85492,7 +85565,7 @@ function transformClassFields(context) {
|
|
|
85492
85565
|
Debug.assert(info, "Undeclared private name for property declaration.");
|
|
85493
85566
|
return info.isValid ? void 0 : node;
|
|
85494
85567
|
}
|
|
85495
|
-
if (shouldTransformInitializersUsingSet && !isStatic(node)) {
|
|
85568
|
+
if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) {
|
|
85496
85569
|
return factory2.updatePropertyDeclaration(
|
|
85497
85570
|
node,
|
|
85498
85571
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
@@ -85508,7 +85581,7 @@ function transformClassFields(context) {
|
|
|
85508
85581
|
return visitEachChild(node, visitor, context);
|
|
85509
85582
|
}
|
|
85510
85583
|
function transformPublicFieldInitializer(node) {
|
|
85511
|
-
if (shouldTransformInitializers) {
|
|
85584
|
+
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
85512
85585
|
const expr = getPropertyNameExpressionIfNeeded(
|
|
85513
85586
|
node.name,
|
|
85514
85587
|
/*shouldHoist*/
|
|
@@ -85539,8 +85612,11 @@ function transformClassFields(context) {
|
|
|
85539
85612
|
Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided.");
|
|
85540
85613
|
return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node);
|
|
85541
85614
|
}
|
|
85615
|
+
function shouldTransformAutoAccessorsInCurrentClass() {
|
|
85616
|
+
return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */);
|
|
85617
|
+
}
|
|
85542
85618
|
function visitPropertyDeclaration(node) {
|
|
85543
|
-
if (
|
|
85619
|
+
if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) {
|
|
85544
85620
|
return transformAutoAccessor(node);
|
|
85545
85621
|
}
|
|
85546
85622
|
return transformFieldInitializer(node);
|
|
@@ -85941,26 +86017,44 @@ function transformClassFields(context) {
|
|
|
85941
86017
|
if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) {
|
|
85942
86018
|
facts |= 1 /* ClassWasDecorated */;
|
|
85943
86019
|
}
|
|
86020
|
+
let containsPublicInstanceFields = false;
|
|
86021
|
+
let containsInitializedPublicInstanceFields = false;
|
|
86022
|
+
let containsInstancePrivateElements = false;
|
|
86023
|
+
let containsInstanceAutoAccessors = false;
|
|
85944
86024
|
for (const member of node.members) {
|
|
85945
|
-
if (
|
|
85946
|
-
|
|
85947
|
-
|
|
85948
|
-
|
|
85949
|
-
|
|
85950
|
-
|
|
85951
|
-
|
|
85952
|
-
|
|
85953
|
-
|
|
85954
|
-
|
|
86025
|
+
if (isStatic(member)) {
|
|
86026
|
+
if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
86027
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
86028
|
+
}
|
|
86029
|
+
if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
|
|
86030
|
+
if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
|
|
86031
|
+
facts |= 8 /* NeedsSubstitutionForThisInClassStaticField */;
|
|
86032
|
+
if (!(facts & 1 /* ClassWasDecorated */)) {
|
|
86033
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
86034
|
+
}
|
|
85955
86035
|
}
|
|
85956
|
-
|
|
85957
|
-
|
|
85958
|
-
|
|
85959
|
-
|
|
86036
|
+
if (shouldTransformSuperInStaticInitializers && member.transformFlags & 134217728 /* ContainsLexicalSuper */) {
|
|
86037
|
+
if (!(facts & 1 /* ClassWasDecorated */)) {
|
|
86038
|
+
facts |= 2 /* NeedsClassConstructorReference */ | 4 /* NeedsClassSuperReference */;
|
|
86039
|
+
}
|
|
85960
86040
|
}
|
|
85961
86041
|
}
|
|
86042
|
+
} else if (!hasAbstractModifier(getOriginalNode(member))) {
|
|
86043
|
+
if (isAutoAccessorPropertyDeclaration(member)) {
|
|
86044
|
+
containsInstanceAutoAccessors = true;
|
|
86045
|
+
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
86046
|
+
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
86047
|
+
containsInstancePrivateElements = true;
|
|
86048
|
+
} else if (isPropertyDeclaration(member)) {
|
|
86049
|
+
containsPublicInstanceFields = true;
|
|
86050
|
+
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
|
|
86051
|
+
}
|
|
85962
86052
|
}
|
|
85963
86053
|
}
|
|
86054
|
+
const willHoistInitializersToConstructor = shouldTransformInitializersUsingDefine && containsPublicInstanceFields || shouldTransformInitializersUsingSet && containsInitializedPublicInstanceFields || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstancePrivateElements || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstanceAutoAccessors && shouldTransformAutoAccessors === -1 /* True */;
|
|
86055
|
+
if (willHoistInitializersToConstructor) {
|
|
86056
|
+
facts |= 16 /* WillHoistInitializersToConstructor */;
|
|
86057
|
+
}
|
|
85964
86058
|
return facts;
|
|
85965
86059
|
}
|
|
85966
86060
|
function visitExpressionWithTypeArgumentsInHeritageClause(node) {
|
|
@@ -86236,15 +86330,9 @@ function transformClassFields(context) {
|
|
|
86236
86330
|
)
|
|
86237
86331
|
);
|
|
86238
86332
|
}
|
|
86239
|
-
function isClassElementThatRequiresConstructorStatement(member) {
|
|
86240
|
-
if (isStatic(member) || hasAbstractModifier(getOriginalNode(member))) {
|
|
86241
|
-
return false;
|
|
86242
|
-
}
|
|
86243
|
-
return shouldTransformInitializersUsingDefine && isPropertyDeclaration(member) || shouldTransformInitializersUsingSet && isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierClassElementDeclaration(member) || shouldTransformPrivateElementsOrClassStaticBlocks && shouldTransformAutoAccessors && isAutoAccessorPropertyDeclaration(member);
|
|
86244
|
-
}
|
|
86245
86333
|
function transformConstructor(constructor, container) {
|
|
86246
86334
|
constructor = visitNode(constructor, visitor, isConstructorDeclaration);
|
|
86247
|
-
if (!
|
|
86335
|
+
if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) {
|
|
86248
86336
|
return constructor;
|
|
86249
86337
|
}
|
|
86250
86338
|
const extendsClauseElement = getEffectiveBaseTypeNode(container);
|
|
@@ -90313,7 +90401,7 @@ function transformJsx(context) {
|
|
|
90313
90401
|
void 0,
|
|
90314
90402
|
factory2.createVariableDeclarationList([
|
|
90315
90403
|
factory2.createVariableDeclaration(
|
|
90316
|
-
factory2.createObjectBindingPattern(
|
|
90404
|
+
factory2.createObjectBindingPattern(arrayFrom(importSpecifiersMap.values(), (s) => factory2.createBindingElement(
|
|
90317
90405
|
/*dotdotdot*/
|
|
90318
90406
|
void 0,
|
|
90319
90407
|
s.propertyName,
|
|
@@ -90724,7 +90812,7 @@ function transformJsx(context) {
|
|
|
90724
90812
|
return node.dotDotDotToken ? factory2.createSpreadElement(expression) : expression;
|
|
90725
90813
|
}
|
|
90726
90814
|
}
|
|
90727
|
-
var entities = new Map(
|
|
90815
|
+
var entities = new Map(Object.entries({
|
|
90728
90816
|
quot: 34,
|
|
90729
90817
|
amp: 38,
|
|
90730
90818
|
apos: 39,
|
|
@@ -100328,7 +100416,7 @@ function transformDeclarations(context) {
|
|
|
100328
100416
|
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
|
|
100329
100417
|
return updated;
|
|
100330
100418
|
function getLibReferences() {
|
|
100331
|
-
return
|
|
100419
|
+
return arrayFrom(libs2.keys(), (lib) => ({ fileName: lib, pos: -1, end: -1 }));
|
|
100332
100420
|
}
|
|
100333
100421
|
function getFileReferencesForUsedTypeReferences() {
|
|
100334
100422
|
return necessaryTypeReferences ? mapDefined(arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : [];
|
|
@@ -102886,6 +102974,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
102886
102974
|
let tempFlags;
|
|
102887
102975
|
let reservedNamesStack;
|
|
102888
102976
|
let reservedNames;
|
|
102977
|
+
let reservedPrivateNamesStack;
|
|
102978
|
+
let reservedPrivateNames;
|
|
102889
102979
|
let preserveSourceNewlines = printerOptions.preserveSourceNewlines;
|
|
102890
102980
|
let nextListElementPos;
|
|
102891
102981
|
let writer;
|
|
@@ -103179,6 +103269,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103179
103269
|
tempFlagsStack = [];
|
|
103180
103270
|
tempFlags = TempFlags.Auto;
|
|
103181
103271
|
reservedNamesStack = [];
|
|
103272
|
+
reservedNames = void 0;
|
|
103273
|
+
reservedPrivateNamesStack = [];
|
|
103274
|
+
reservedPrivateNames = void 0;
|
|
103182
103275
|
currentSourceFile = void 0;
|
|
103183
103276
|
currentLineMap = void 0;
|
|
103184
103277
|
detachedCommentsInfo = void 0;
|
|
@@ -103922,9 +104015,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103922
104015
|
}
|
|
103923
104016
|
}
|
|
103924
104017
|
function emitComputedPropertyName(node) {
|
|
104018
|
+
const savedPrivateNameTempFlags = privateNameTempFlags;
|
|
104019
|
+
const savedReservedMemberNames = reservedPrivateNames;
|
|
104020
|
+
popPrivateNameGenerationScope();
|
|
103925
104021
|
writePunctuation("[");
|
|
103926
104022
|
emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName);
|
|
103927
104023
|
writePunctuation("]");
|
|
104024
|
+
pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames);
|
|
103928
104025
|
}
|
|
103929
104026
|
function emitTypeParameter(node) {
|
|
103930
104027
|
emitModifiers(node, node.modifiers);
|
|
@@ -104104,10 +104201,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
104104
104201
|
emitTypeArguments(node, node.typeArguments);
|
|
104105
104202
|
}
|
|
104106
104203
|
function emitTypeLiteral(node) {
|
|
104204
|
+
pushPrivateNameGenerationScope(
|
|
104205
|
+
TempFlags.Auto,
|
|
104206
|
+
/*newReservedMemberNames*/
|
|
104207
|
+
void 0
|
|
104208
|
+
);
|
|
104107
104209
|
writePunctuation("{");
|
|
104108
104210
|
const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */;
|
|
104109
104211
|
emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */);
|
|
104110
104212
|
writePunctuation("}");
|
|
104213
|
+
popPrivateNameGenerationScope();
|
|
104111
104214
|
}
|
|
104112
104215
|
function emitArrayType(node) {
|
|
104113
104216
|
emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
@@ -104287,6 +104390,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
104287
104390
|
emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma);
|
|
104288
104391
|
}
|
|
104289
104392
|
function emitObjectLiteralExpression(node) {
|
|
104393
|
+
pushPrivateNameGenerationScope(
|
|
104394
|
+
TempFlags.Auto,
|
|
104395
|
+
/*newReservedMemberNames*/
|
|
104396
|
+
void 0
|
|
104397
|
+
);
|
|
104290
104398
|
forEach(node.properties, generateMemberNames);
|
|
104291
104399
|
const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
|
|
104292
104400
|
if (indentedFlag) {
|
|
@@ -104298,6 +104406,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
104298
104406
|
if (indentedFlag) {
|
|
104299
104407
|
decreaseIndent();
|
|
104300
104408
|
}
|
|
104409
|
+
popPrivateNameGenerationScope();
|
|
104301
104410
|
}
|
|
104302
104411
|
function emitPropertyAccessExpression(node) {
|
|
104303
104412
|
emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
|
|
@@ -105037,6 +105146,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
105037
105146
|
emitClassDeclarationOrExpression(node);
|
|
105038
105147
|
}
|
|
105039
105148
|
function emitClassDeclarationOrExpression(node) {
|
|
105149
|
+
pushPrivateNameGenerationScope(
|
|
105150
|
+
TempFlags.Auto,
|
|
105151
|
+
/*newReservedMemberNames*/
|
|
105152
|
+
void 0
|
|
105153
|
+
);
|
|
105040
105154
|
forEach(node.members, generateMemberNames);
|
|
105041
105155
|
emitDecoratorsAndModifiers(node, node.modifiers);
|
|
105042
105156
|
writeKeyword("class");
|
|
@@ -105057,8 +105171,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
105057
105171
|
if (indentedFlag) {
|
|
105058
105172
|
decreaseIndent();
|
|
105059
105173
|
}
|
|
105174
|
+
popPrivateNameGenerationScope();
|
|
105060
105175
|
}
|
|
105061
105176
|
function emitInterfaceDeclaration(node) {
|
|
105177
|
+
pushPrivateNameGenerationScope(
|
|
105178
|
+
TempFlags.Auto,
|
|
105179
|
+
/*newReservedMemberNames*/
|
|
105180
|
+
void 0
|
|
105181
|
+
);
|
|
105062
105182
|
emitModifiers(node, node.modifiers);
|
|
105063
105183
|
writeKeyword("interface");
|
|
105064
105184
|
writeSpace();
|
|
@@ -105069,6 +105189,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
105069
105189
|
writePunctuation("{");
|
|
105070
105190
|
emitList(node, node.members, 129 /* InterfaceMembers */);
|
|
105071
105191
|
writePunctuation("}");
|
|
105192
|
+
popPrivateNameGenerationScope();
|
|
105072
105193
|
}
|
|
105073
105194
|
function emitTypeAliasDeclaration(node) {
|
|
105074
105195
|
emitModifiers(node, node.modifiers);
|
|
@@ -106446,8 +106567,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106446
106567
|
}
|
|
106447
106568
|
tempFlagsStack.push(tempFlags);
|
|
106448
106569
|
tempFlags = TempFlags.Auto;
|
|
106449
|
-
privateNameTempFlagsStack.push(privateNameTempFlags);
|
|
106450
|
-
privateNameTempFlags = TempFlags.Auto;
|
|
106451
106570
|
formattedNameTempFlagsStack.push(formattedNameTempFlags);
|
|
106452
106571
|
formattedNameTempFlags = void 0;
|
|
106453
106572
|
reservedNamesStack.push(reservedNames);
|
|
@@ -106457,7 +106576,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106457
106576
|
return;
|
|
106458
106577
|
}
|
|
106459
106578
|
tempFlags = tempFlagsStack.pop();
|
|
106460
|
-
privateNameTempFlags = privateNameTempFlagsStack.pop();
|
|
106461
106579
|
formattedNameTempFlags = formattedNameTempFlagsStack.pop();
|
|
106462
106580
|
reservedNames = reservedNamesStack.pop();
|
|
106463
106581
|
}
|
|
@@ -106467,6 +106585,22 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106467
106585
|
}
|
|
106468
106586
|
reservedNames.add(name);
|
|
106469
106587
|
}
|
|
106588
|
+
function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) {
|
|
106589
|
+
privateNameTempFlagsStack.push(privateNameTempFlags);
|
|
106590
|
+
privateNameTempFlags = newPrivateNameTempFlags;
|
|
106591
|
+
reservedPrivateNamesStack.push(reservedNames);
|
|
106592
|
+
reservedPrivateNames = newReservedMemberNames;
|
|
106593
|
+
}
|
|
106594
|
+
function popPrivateNameGenerationScope() {
|
|
106595
|
+
privateNameTempFlags = privateNameTempFlagsStack.pop();
|
|
106596
|
+
reservedPrivateNames = reservedPrivateNamesStack.pop();
|
|
106597
|
+
}
|
|
106598
|
+
function reservePrivateNameInNestedScopes(name) {
|
|
106599
|
+
if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) {
|
|
106600
|
+
reservedPrivateNames = /* @__PURE__ */ new Set();
|
|
106601
|
+
}
|
|
106602
|
+
reservedPrivateNames.add(name);
|
|
106603
|
+
}
|
|
106470
106604
|
function generateNames(node) {
|
|
106471
106605
|
if (!node)
|
|
106472
106606
|
return;
|
|
@@ -106588,10 +106722,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106588
106722
|
const nodeId = getNodeId(node);
|
|
106589
106723
|
return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix)));
|
|
106590
106724
|
}
|
|
106591
|
-
function isUniqueName(name) {
|
|
106592
|
-
return isFileLevelUniqueName2(name) && !
|
|
106725
|
+
function isUniqueName(name, privateName) {
|
|
106726
|
+
return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name);
|
|
106593
106727
|
}
|
|
106594
|
-
function
|
|
106728
|
+
function isReservedName(name, privateName) {
|
|
106729
|
+
return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name));
|
|
106730
|
+
}
|
|
106731
|
+
function isFileLevelUniqueName2(name, _isPrivate) {
|
|
106595
106732
|
return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true;
|
|
106596
106733
|
}
|
|
106597
106734
|
function isUniqueLocalName(name, container) {
|
|
@@ -106639,9 +106776,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106639
106776
|
if (flags && !(tempFlags2 & flags)) {
|
|
106640
106777
|
const name = flags === TempFlags._i ? "_i" : "_n";
|
|
106641
106778
|
const fullName = formatGeneratedName(privateName, prefix, name, suffix);
|
|
106642
|
-
if (isUniqueName(fullName)) {
|
|
106779
|
+
if (isUniqueName(fullName, privateName)) {
|
|
106643
106780
|
tempFlags2 |= flags;
|
|
106644
|
-
if (
|
|
106781
|
+
if (privateName) {
|
|
106782
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
106783
|
+
} else if (reservedInNestedScopes) {
|
|
106645
106784
|
reserveNameInNestedScopes(fullName);
|
|
106646
106785
|
}
|
|
106647
106786
|
setTempFlags(key, tempFlags2);
|
|
@@ -106654,8 +106793,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106654
106793
|
if (count !== 8 && count !== 13) {
|
|
106655
106794
|
const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
|
|
106656
106795
|
const fullName = formatGeneratedName(privateName, prefix, name, suffix);
|
|
106657
|
-
if (isUniqueName(fullName)) {
|
|
106658
|
-
if (
|
|
106796
|
+
if (isUniqueName(fullName, privateName)) {
|
|
106797
|
+
if (privateName) {
|
|
106798
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
106799
|
+
} else if (reservedInNestedScopes) {
|
|
106659
106800
|
reserveNameInNestedScopes(fullName);
|
|
106660
106801
|
}
|
|
106661
106802
|
setTempFlags(key, tempFlags2);
|
|
@@ -106673,8 +106814,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106673
106814
|
}
|
|
106674
106815
|
if (optimistic) {
|
|
106675
106816
|
const fullName = formatGeneratedName(privateName, prefix, baseName, suffix);
|
|
106676
|
-
if (checkFn(fullName)) {
|
|
106677
|
-
if (
|
|
106817
|
+
if (checkFn(fullName, privateName)) {
|
|
106818
|
+
if (privateName) {
|
|
106819
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
106820
|
+
} else if (scoped) {
|
|
106678
106821
|
reserveNameInNestedScopes(fullName);
|
|
106679
106822
|
} else {
|
|
106680
106823
|
generatedNames.add(fullName);
|
|
@@ -106688,8 +106831,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
106688
106831
|
let i = 1;
|
|
106689
106832
|
while (true) {
|
|
106690
106833
|
const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix);
|
|
106691
|
-
if (checkFn(fullName)) {
|
|
106692
|
-
if (
|
|
106834
|
+
if (checkFn(fullName, privateName)) {
|
|
106835
|
+
if (privateName) {
|
|
106836
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
106837
|
+
} else if (scoped) {
|
|
106693
106838
|
reserveNameInNestedScopes(fullName);
|
|
106694
106839
|
} else {
|
|
106695
106840
|
generatedNames.add(fullName);
|
|
@@ -110574,7 +110719,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
110574
110719
|
currentNodeModulesDepth++;
|
|
110575
110720
|
}
|
|
110576
110721
|
const elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth;
|
|
110577
|
-
const shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution) && !optionsForFile.noResolve && index < file.imports.length && !elideImport && !(isJsFile && !getAllowJSCompilerOption(optionsForFile)) && (isInJSFile(file.imports[index]) || !(file.imports[index].flags & 8388608 /* JSDoc */));
|
|
110722
|
+
const shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution, file) && !optionsForFile.noResolve && index < file.imports.length && !elideImport && !(isJsFile && !getAllowJSCompilerOption(optionsForFile)) && (isInJSFile(file.imports[index]) || !(file.imports[index].flags & 8388608 /* JSDoc */));
|
|
110578
110723
|
if (elideImport) {
|
|
110579
110724
|
modulesWithElidedImports.set(file.path, true);
|
|
110580
110725
|
} else if (shouldAddFile) {
|
|
@@ -110917,7 +111062,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
110917
111062
|
if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) {
|
|
110918
111063
|
createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later);
|
|
110919
111064
|
}
|
|
110920
|
-
if (options.allowImportingTsExtensions && !(
|
|
111065
|
+
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
|
|
110921
111066
|
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set);
|
|
110922
111067
|
}
|
|
110923
111068
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
@@ -111569,19 +111714,27 @@ function resolveProjectReferencePath(hostOrRef, ref) {
|
|
|
111569
111714
|
const passedInRef = ref ? ref : hostOrRef;
|
|
111570
111715
|
return resolveConfigFileProjectName(passedInRef.path);
|
|
111571
111716
|
}
|
|
111572
|
-
function getResolutionDiagnostic(options, { extension }) {
|
|
111717
|
+
function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) {
|
|
111573
111718
|
switch (extension) {
|
|
111574
111719
|
case ".ts" /* Ts */:
|
|
111575
111720
|
case ".d.ts" /* Dts */:
|
|
111721
|
+
case ".mts" /* Mts */:
|
|
111722
|
+
case ".d.mts" /* Dmts */:
|
|
111723
|
+
case ".cts" /* Cts */:
|
|
111724
|
+
case ".d.cts" /* Dcts */:
|
|
111576
111725
|
return void 0;
|
|
111577
111726
|
case ".tsx" /* Tsx */:
|
|
111578
111727
|
return needJsx();
|
|
111579
111728
|
case ".jsx" /* Jsx */:
|
|
111580
111729
|
return needJsx() || needAllowJs();
|
|
111581
111730
|
case ".js" /* Js */:
|
|
111731
|
+
case ".mjs" /* Mjs */:
|
|
111732
|
+
case ".cjs" /* Cjs */:
|
|
111582
111733
|
return needAllowJs();
|
|
111583
111734
|
case ".json" /* Json */:
|
|
111584
111735
|
return needResolveJsonModule();
|
|
111736
|
+
default:
|
|
111737
|
+
return needAllowArbitraryExtensions();
|
|
111585
111738
|
}
|
|
111586
111739
|
function needJsx() {
|
|
111587
111740
|
return options.jsx ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set;
|
|
@@ -111592,6 +111745,9 @@ function getResolutionDiagnostic(options, { extension }) {
|
|
|
111592
111745
|
function needResolveJsonModule() {
|
|
111593
111746
|
return getResolveJsonModule(options) ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;
|
|
111594
111747
|
}
|
|
111748
|
+
function needAllowArbitraryExtensions() {
|
|
111749
|
+
return isDeclarationFile || options.allowArbitraryExtensions ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set;
|
|
111750
|
+
}
|
|
111595
111751
|
}
|
|
111596
111752
|
function getModuleNames({ imports, moduleAugmentations }) {
|
|
111597
111753
|
const res = imports.map((i) => i);
|
|
@@ -111926,9 +112082,8 @@ var BuilderState;
|
|
|
111926
112082
|
seenMap.add(path);
|
|
111927
112083
|
const references = state.referencedMap.getValues(path);
|
|
111928
112084
|
if (references) {
|
|
111929
|
-
const
|
|
111930
|
-
|
|
111931
|
-
queue.push(iterResult.value);
|
|
112085
|
+
for (const key of references.keys()) {
|
|
112086
|
+
queue.push(key);
|
|
111932
112087
|
}
|
|
111933
112088
|
}
|
|
111934
112089
|
}
|
|
@@ -113994,7 +114149,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
113994
114149
|
return (_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
|
|
113995
114150
|
}
|
|
113996
114151
|
function isInvalidatedFailedLookup(locationPath) {
|
|
113997
|
-
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) ||
|
|
114152
|
+
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (fileOrDirectoryPath) => isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : void 0);
|
|
113998
114153
|
}
|
|
113999
114154
|
function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) {
|
|
114000
114155
|
var _a2;
|
|
@@ -115252,7 +115407,7 @@ function createWatchProgram(host) {
|
|
|
115252
115407
|
if (wildcardDirectories) {
|
|
115253
115408
|
updateWatchingWildcardDirectories(
|
|
115254
115409
|
watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()),
|
|
115255
|
-
new Map(
|
|
115410
|
+
new Map(Object.entries(wildcardDirectories)),
|
|
115256
115411
|
watchWildcardDirectory
|
|
115257
115412
|
);
|
|
115258
115413
|
} else if (watchedWildcardDirectories) {
|
|
@@ -115346,7 +115501,7 @@ function createWatchProgram(host) {
|
|
|
115346
115501
|
if ((_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories) {
|
|
115347
115502
|
updateWatchingWildcardDirectories(
|
|
115348
115503
|
commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()),
|
|
115349
|
-
new Map(
|
|
115504
|
+
new Map(Object.entries((_c = commandLine.parsedCommandLine) == null ? void 0 : _c.wildcardDirectories)),
|
|
115350
115505
|
(directory, flags) => {
|
|
115351
115506
|
var _a3;
|
|
115352
115507
|
return watchDirectory(
|
|
@@ -117042,7 +117197,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
117042
117197
|
return;
|
|
117043
117198
|
updateWatchingWildcardDirectories(
|
|
117044
117199
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath),
|
|
117045
|
-
new Map(
|
|
117200
|
+
new Map(Object.entries(parsed.wildcardDirectories)),
|
|
117046
117201
|
(dir, flags) => state.watchDirectory(
|
|
117047
117202
|
dir,
|
|
117048
117203
|
(fileOrDirectory) => {
|
|
@@ -117609,7 +117764,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
117609
117764
|
option3.type.forEach((value, name2) => {
|
|
117610
117765
|
(inverted[value] || (inverted[value] = [])).push(name2);
|
|
117611
117766
|
});
|
|
117612
|
-
return
|
|
117767
|
+
return Object.entries(inverted).map(([, synonyms]) => synonyms.join("/")).join(", ");
|
|
117613
117768
|
}
|
|
117614
117769
|
return possibleValues;
|
|
117615
117770
|
}
|
|
@@ -118338,11 +118493,11 @@ function reportStatistics(sys2, programOrConfig, solutionPerformance) {
|
|
|
118338
118493
|
reportCountStatistic("Files", program.getSourceFiles().length);
|
|
118339
118494
|
const lineCounts = countLines(program);
|
|
118340
118495
|
if (compilerOptions.extendedDiagnostics) {
|
|
118341
|
-
for (const key of
|
|
118342
|
-
reportCountStatistic("Lines of " + key,
|
|
118496
|
+
for (const [key, value] of lineCounts.entries()) {
|
|
118497
|
+
reportCountStatistic("Lines of " + key, value);
|
|
118343
118498
|
}
|
|
118344
118499
|
} else {
|
|
118345
|
-
reportCountStatistic("Lines", reduceLeftIterator(lineCounts.values(), (
|
|
118500
|
+
reportCountStatistic("Lines", reduceLeftIterator(lineCounts.values(), (sum, count) => sum + count, 0));
|
|
118346
118501
|
}
|
|
118347
118502
|
reportCountStatistic("Identifiers", program.getIdentifierCount());
|
|
118348
118503
|
reportCountStatistic("Symbols", program.getSymbolCount());
|