typescript 5.0.0-dev.20230105 → 5.0.0-dev.20230107
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/README.md +0 -2
- package/lib/tsc.js +293 -176
- package/lib/tsserver.js +370 -416
- package/lib/tsserverlibrary.d.ts +2 -17
- package/lib/tsserverlibrary.js +374 -412
- package/lib/typescript.d.ts +2 -17
- package/lib/typescript.js +359 -375
- package/lib/typingsInstaller.js +49 -71
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20230107`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -53,17 +53,6 @@ var ts = (() => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
// src/compiler/core.ts
|
|
56
|
-
function getIterator(iterable) {
|
|
57
|
-
if (iterable) {
|
|
58
|
-
if (isArray(iterable))
|
|
59
|
-
return arrayIterator(iterable);
|
|
60
|
-
if (iterable instanceof Map)
|
|
61
|
-
return iterable.entries();
|
|
62
|
-
if (iterable instanceof Set)
|
|
63
|
-
return iterable.values();
|
|
64
|
-
throw new Error("Iteration not supported.");
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
56
|
function length(array) {
|
|
68
57
|
return array ? array.length : 0;
|
|
69
58
|
}
|
|
@@ -102,22 +91,21 @@ var ts = (() => {
|
|
|
102
91
|
return void 0;
|
|
103
92
|
}
|
|
104
93
|
function firstDefinedIterator(iter, callback) {
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
if (iterResult.done) {
|
|
108
|
-
return void 0;
|
|
109
|
-
}
|
|
110
|
-
const result = callback(iterResult.value);
|
|
94
|
+
for (const value of iter) {
|
|
95
|
+
const result = callback(value);
|
|
111
96
|
if (result !== void 0) {
|
|
112
97
|
return result;
|
|
113
98
|
}
|
|
114
99
|
}
|
|
100
|
+
return void 0;
|
|
115
101
|
}
|
|
116
102
|
function reduceLeftIterator(iterator, f, initial) {
|
|
117
103
|
let result = initial;
|
|
118
104
|
if (iterator) {
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
let pos = 0;
|
|
106
|
+
for (const value of iterator) {
|
|
107
|
+
result = f(result, value, pos);
|
|
108
|
+
pos++;
|
|
121
109
|
}
|
|
122
110
|
}
|
|
123
111
|
return result;
|
|
@@ -130,27 +118,6 @@ var ts = (() => {
|
|
|
130
118
|
}
|
|
131
119
|
return result;
|
|
132
120
|
}
|
|
133
|
-
function zipToIterator(arrayA, arrayB) {
|
|
134
|
-
Debug.assertEqual(arrayA.length, arrayB.length);
|
|
135
|
-
let i = 0;
|
|
136
|
-
return {
|
|
137
|
-
next() {
|
|
138
|
-
if (i === arrayA.length) {
|
|
139
|
-
return { value: void 0, done: true };
|
|
140
|
-
}
|
|
141
|
-
i++;
|
|
142
|
-
return { value: [arrayA[i - 1], arrayB[i - 1]], done: false };
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function zipToMap(keys, values) {
|
|
147
|
-
Debug.assert(keys.length === values.length);
|
|
148
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
149
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
150
|
-
map2.set(keys[i], values[i]);
|
|
151
|
-
}
|
|
152
|
-
return map2;
|
|
153
|
-
}
|
|
154
121
|
function intersperse(input, element) {
|
|
155
122
|
if (input.length <= 1) {
|
|
156
123
|
return input;
|
|
@@ -301,13 +268,10 @@ var ts = (() => {
|
|
|
301
268
|
}
|
|
302
269
|
return result;
|
|
303
270
|
}
|
|
304
|
-
function mapIterator(iter, mapFn) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false };
|
|
309
|
-
}
|
|
310
|
-
};
|
|
271
|
+
function* mapIterator(iter, mapFn) {
|
|
272
|
+
for (const x of iter) {
|
|
273
|
+
yield mapFn(x);
|
|
274
|
+
}
|
|
311
275
|
}
|
|
312
276
|
function sameMap(array, f) {
|
|
313
277
|
if (array) {
|
|
@@ -371,30 +335,12 @@ var ts = (() => {
|
|
|
371
335
|
}
|
|
372
336
|
return result;
|
|
373
337
|
}
|
|
374
|
-
function flatMapIterator(iter, mapfn) {
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return {
|
|
381
|
-
next() {
|
|
382
|
-
while (true) {
|
|
383
|
-
const currentRes = currentIter.next();
|
|
384
|
-
if (!currentRes.done) {
|
|
385
|
-
return currentRes;
|
|
386
|
-
}
|
|
387
|
-
const iterRes = iter.next();
|
|
388
|
-
if (iterRes.done) {
|
|
389
|
-
return iterRes;
|
|
390
|
-
}
|
|
391
|
-
currentIter = getIterator2(iterRes.value);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
function getIterator2(x) {
|
|
396
|
-
const res = mapfn(x);
|
|
397
|
-
return res === void 0 ? emptyIterator : isArray(res) ? arrayIterator(res) : res;
|
|
338
|
+
function* flatMapIterator(iter, mapfn) {
|
|
339
|
+
for (const x of iter) {
|
|
340
|
+
const iter2 = mapfn(x);
|
|
341
|
+
if (!iter2)
|
|
342
|
+
continue;
|
|
343
|
+
yield* iter2;
|
|
398
344
|
}
|
|
399
345
|
}
|
|
400
346
|
function sameFlatMap(array, mapfn) {
|
|
@@ -440,21 +386,13 @@ var ts = (() => {
|
|
|
440
386
|
}
|
|
441
387
|
return result;
|
|
442
388
|
}
|
|
443
|
-
function mapDefinedIterator(iter, mapFn) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if (res.done) {
|
|
449
|
-
return res;
|
|
450
|
-
}
|
|
451
|
-
const value = mapFn(res.value);
|
|
452
|
-
if (value !== void 0) {
|
|
453
|
-
return { value, done: false };
|
|
454
|
-
}
|
|
455
|
-
}
|
|
389
|
+
function* mapDefinedIterator(iter, mapFn) {
|
|
390
|
+
for (const x of iter) {
|
|
391
|
+
const value = mapFn(x);
|
|
392
|
+
if (value !== void 0) {
|
|
393
|
+
yield value;
|
|
456
394
|
}
|
|
457
|
-
}
|
|
395
|
+
}
|
|
458
396
|
}
|
|
459
397
|
function mapDefinedEntries(map2, f) {
|
|
460
398
|
if (!map2) {
|
|
@@ -472,18 +410,6 @@ var ts = (() => {
|
|
|
472
410
|
});
|
|
473
411
|
return result;
|
|
474
412
|
}
|
|
475
|
-
function mapDefinedValues(set, f) {
|
|
476
|
-
if (set) {
|
|
477
|
-
const result = /* @__PURE__ */ new Set();
|
|
478
|
-
set.forEach((value) => {
|
|
479
|
-
const newValue = f(value);
|
|
480
|
-
if (newValue !== void 0) {
|
|
481
|
-
result.add(newValue);
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
return result;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
413
|
function getOrUpdate(map2, key, callback) {
|
|
488
414
|
if (map2.has(key)) {
|
|
489
415
|
return map2.get(key);
|
|
@@ -499,15 +425,8 @@ var ts = (() => {
|
|
|
499
425
|
}
|
|
500
426
|
return false;
|
|
501
427
|
}
|
|
502
|
-
function singleIterator(value) {
|
|
503
|
-
|
|
504
|
-
return {
|
|
505
|
-
next() {
|
|
506
|
-
const wasDone = done;
|
|
507
|
-
done = true;
|
|
508
|
-
return wasDone ? { value: void 0, done: true } : { value, done: false };
|
|
509
|
-
}
|
|
510
|
-
};
|
|
428
|
+
function* singleIterator(value) {
|
|
429
|
+
yield value;
|
|
511
430
|
}
|
|
512
431
|
function spanMap(array, keyfn, mapfn) {
|
|
513
432
|
let result;
|
|
@@ -751,13 +670,6 @@ var ts = (() => {
|
|
|
751
670
|
}
|
|
752
671
|
return result;
|
|
753
672
|
}
|
|
754
|
-
function sum(array, prop) {
|
|
755
|
-
let result = 0;
|
|
756
|
-
for (const v of array) {
|
|
757
|
-
result += v[prop];
|
|
758
|
-
}
|
|
759
|
-
return result;
|
|
760
|
-
}
|
|
761
673
|
function append(to, value) {
|
|
762
674
|
if (value === void 0)
|
|
763
675
|
return to;
|
|
@@ -816,29 +728,10 @@ var ts = (() => {
|
|
|
816
728
|
function sort(array, comparer) {
|
|
817
729
|
return array.length === 0 ? array : array.slice().sort(comparer);
|
|
818
730
|
}
|
|
819
|
-
function
|
|
820
|
-
let i = 0;
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
return { value: void 0, done: true };
|
|
824
|
-
} else {
|
|
825
|
-
i++;
|
|
826
|
-
return { value: array[i - 1], done: false };
|
|
827
|
-
}
|
|
828
|
-
} };
|
|
829
|
-
}
|
|
830
|
-
function arrayReverseIterator(array) {
|
|
831
|
-
let i = array.length;
|
|
832
|
-
return {
|
|
833
|
-
next: () => {
|
|
834
|
-
if (i === 0) {
|
|
835
|
-
return { value: void 0, done: true };
|
|
836
|
-
} else {
|
|
837
|
-
i--;
|
|
838
|
-
return { value: array[i], done: false };
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
};
|
|
731
|
+
function* arrayReverseIterator(array) {
|
|
732
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
733
|
+
yield array[i];
|
|
734
|
+
}
|
|
842
735
|
}
|
|
843
736
|
function stableSort(array, comparer) {
|
|
844
737
|
const indices = indicesOf(array);
|
|
@@ -854,22 +747,27 @@ var ts = (() => {
|
|
|
854
747
|
}
|
|
855
748
|
return true;
|
|
856
749
|
}
|
|
857
|
-
function
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
750
|
+
function firstOrUndefined(array) {
|
|
751
|
+
return array === void 0 || array.length === 0 ? void 0 : array[0];
|
|
752
|
+
}
|
|
753
|
+
function firstOrUndefinedIterator(iter) {
|
|
754
|
+
if (iter) {
|
|
755
|
+
for (const value of iter) {
|
|
756
|
+
return value;
|
|
862
757
|
}
|
|
863
758
|
}
|
|
864
759
|
return void 0;
|
|
865
760
|
}
|
|
866
|
-
function firstOrUndefined(array) {
|
|
867
|
-
return array === void 0 || array.length === 0 ? void 0 : array[0];
|
|
868
|
-
}
|
|
869
761
|
function first(array) {
|
|
870
762
|
Debug.assert(array.length !== 0);
|
|
871
763
|
return array[0];
|
|
872
764
|
}
|
|
765
|
+
function firstIterator(iter) {
|
|
766
|
+
for (const value of iter) {
|
|
767
|
+
return value;
|
|
768
|
+
}
|
|
769
|
+
Debug.fail("iterator is empty");
|
|
770
|
+
}
|
|
873
771
|
function lastOrUndefined(array) {
|
|
874
772
|
return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1];
|
|
875
773
|
}
|
|
@@ -972,9 +870,6 @@ var ts = (() => {
|
|
|
972
870
|
}
|
|
973
871
|
return values;
|
|
974
872
|
}
|
|
975
|
-
function getEntries(obj) {
|
|
976
|
-
return obj ? _entries(obj) : [];
|
|
977
|
-
}
|
|
978
873
|
function arrayOf(count, f) {
|
|
979
874
|
const result = new Array(count);
|
|
980
875
|
for (let i = 0; i < count; i++) {
|
|
@@ -984,8 +879,8 @@ var ts = (() => {
|
|
|
984
879
|
}
|
|
985
880
|
function arrayFrom(iterator, map2) {
|
|
986
881
|
const result = [];
|
|
987
|
-
for (
|
|
988
|
-
result.push(map2 ? map2(
|
|
882
|
+
for (const value of iterator) {
|
|
883
|
+
result.push(map2 ? map2(value) : value);
|
|
989
884
|
}
|
|
990
885
|
return result;
|
|
991
886
|
}
|
|
@@ -1146,35 +1041,14 @@ var ts = (() => {
|
|
|
1146
1041
|
function createSet(getHashCode, equals) {
|
|
1147
1042
|
const multiMap = /* @__PURE__ */ new Map();
|
|
1148
1043
|
let size = 0;
|
|
1149
|
-
function getElementIterator() {
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
if (arrayIt) {
|
|
1156
|
-
const n = arrayIt.next();
|
|
1157
|
-
if (!n.done) {
|
|
1158
|
-
return { value: n.value };
|
|
1159
|
-
}
|
|
1160
|
-
arrayIt = void 0;
|
|
1161
|
-
} else {
|
|
1162
|
-
const n = valueIt.next();
|
|
1163
|
-
if (n.done) {
|
|
1164
|
-
return { value: void 0, done: true };
|
|
1165
|
-
}
|
|
1166
|
-
if (!isArray(n.value)) {
|
|
1167
|
-
return { value: n.value };
|
|
1168
|
-
}
|
|
1169
|
-
arrayIt = arrayIterator(n.value);
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
},
|
|
1173
|
-
[Symbol.iterator]: () => {
|
|
1174
|
-
return it;
|
|
1044
|
+
function* getElementIterator() {
|
|
1045
|
+
for (const value of multiMap.values()) {
|
|
1046
|
+
if (isArray(value)) {
|
|
1047
|
+
yield* value;
|
|
1048
|
+
} else {
|
|
1049
|
+
yield value;
|
|
1175
1050
|
}
|
|
1176
|
-
}
|
|
1177
|
-
return it;
|
|
1051
|
+
}
|
|
1178
1052
|
}
|
|
1179
1053
|
const set = {
|
|
1180
1054
|
has(element) {
|
|
@@ -1267,16 +1141,10 @@ var ts = (() => {
|
|
|
1267
1141
|
values() {
|
|
1268
1142
|
return getElementIterator();
|
|
1269
1143
|
},
|
|
1270
|
-
entries() {
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
const n = it.next();
|
|
1275
|
-
return n.done ? n : { value: [n.value, n.value] };
|
|
1276
|
-
},
|
|
1277
|
-
[Symbol.iterator]: () => it2
|
|
1278
|
-
};
|
|
1279
|
-
return it2;
|
|
1144
|
+
*entries() {
|
|
1145
|
+
for (const value of getElementIterator()) {
|
|
1146
|
+
yield [value, value];
|
|
1147
|
+
}
|
|
1280
1148
|
},
|
|
1281
1149
|
[Symbol.iterator]: () => {
|
|
1282
1150
|
return getElementIterator();
|
|
@@ -1286,7 +1154,7 @@ var ts = (() => {
|
|
|
1286
1154
|
return set;
|
|
1287
1155
|
}
|
|
1288
1156
|
function isArray(value) {
|
|
1289
|
-
return Array.isArray
|
|
1157
|
+
return Array.isArray(value);
|
|
1290
1158
|
}
|
|
1291
1159
|
function toArray(value) {
|
|
1292
1160
|
return isArray(value) ? value : [value];
|
|
@@ -1361,25 +1229,6 @@ var ts = (() => {
|
|
|
1361
1229
|
return value;
|
|
1362
1230
|
};
|
|
1363
1231
|
}
|
|
1364
|
-
function compose(a, b, c, d, e) {
|
|
1365
|
-
if (!!e) {
|
|
1366
|
-
const args = [];
|
|
1367
|
-
for (let i = 0; i < arguments.length; i++) {
|
|
1368
|
-
args[i] = arguments[i];
|
|
1369
|
-
}
|
|
1370
|
-
return (t) => reduceLeft(args, (u, f) => f(u), t);
|
|
1371
|
-
} else if (d) {
|
|
1372
|
-
return (t) => d(c(b(a(t))));
|
|
1373
|
-
} else if (c) {
|
|
1374
|
-
return (t) => c(b(a(t)));
|
|
1375
|
-
} else if (b) {
|
|
1376
|
-
return (t) => b(a(t));
|
|
1377
|
-
} else if (a) {
|
|
1378
|
-
return (t) => a(t);
|
|
1379
|
-
} else {
|
|
1380
|
-
return (t) => t;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
1232
|
function equateValues(a, b) {
|
|
1384
1233
|
return a === b;
|
|
1385
1234
|
}
|
|
@@ -1682,13 +1531,6 @@ var ts = (() => {
|
|
|
1682
1531
|
}
|
|
1683
1532
|
return hasChanges;
|
|
1684
1533
|
}
|
|
1685
|
-
function fill(length2, cb) {
|
|
1686
|
-
const result = Array(length2);
|
|
1687
|
-
for (let i = 0; i < length2; i++) {
|
|
1688
|
-
result[i] = cb(i);
|
|
1689
|
-
}
|
|
1690
|
-
return result;
|
|
1691
|
-
}
|
|
1692
1534
|
function cartesianProduct(arrays) {
|
|
1693
1535
|
const result = [];
|
|
1694
1536
|
cartesianProductWorker(
|
|
@@ -1742,7 +1584,7 @@ var ts = (() => {
|
|
|
1742
1584
|
function isNodeLikeSystem() {
|
|
1743
1585
|
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
1744
1586
|
}
|
|
1745
|
-
var emptyArray, emptyMap, emptySet,
|
|
1587
|
+
var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, noopPush, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart;
|
|
1746
1588
|
var init_core = __esm({
|
|
1747
1589
|
"src/compiler/core.ts"() {
|
|
1748
1590
|
"use strict";
|
|
@@ -1750,7 +1592,6 @@ var ts = (() => {
|
|
|
1750
1592
|
emptyArray = [];
|
|
1751
1593
|
emptyMap = /* @__PURE__ */ new Map();
|
|
1752
1594
|
emptySet = /* @__PURE__ */ new Set();
|
|
1753
|
-
emptyIterator = { next: () => ({ value: void 0, done: true }) };
|
|
1754
1595
|
SortKind = /* @__PURE__ */ ((SortKind2) => {
|
|
1755
1596
|
SortKind2[SortKind2["None"] = 0] = "None";
|
|
1756
1597
|
SortKind2[SortKind2["CaseSensitive"] = 1] = "CaseSensitive";
|
|
@@ -1758,15 +1599,16 @@ var ts = (() => {
|
|
|
1758
1599
|
SortKind2[SortKind2["Both"] = 3] = "Both";
|
|
1759
1600
|
return SortKind2;
|
|
1760
1601
|
})(SortKind || {});
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1602
|
+
elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => {
|
|
1603
|
+
if (array) {
|
|
1604
|
+
offset = toOffset(array, offset);
|
|
1605
|
+
if (offset < array.length) {
|
|
1606
|
+
return array[offset];
|
|
1607
|
+
}
|
|
1767
1608
|
}
|
|
1768
|
-
return
|
|
1769
|
-
}
|
|
1609
|
+
return void 0;
|
|
1610
|
+
};
|
|
1611
|
+
hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1770
1612
|
noopPush = {
|
|
1771
1613
|
push: noop,
|
|
1772
1614
|
length: 0
|
|
@@ -2643,7 +2485,7 @@ m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;
|
|
|
2643
2485
|
return height2 + 1;
|
|
2644
2486
|
}
|
|
2645
2487
|
function computeColumnWidths(height2) {
|
|
2646
|
-
const columns =
|
|
2488
|
+
const columns = fill(Array(height2), 0);
|
|
2647
2489
|
for (const node of nodes) {
|
|
2648
2490
|
columns[node.level] = Math.max(columns[node.level], node.text.length);
|
|
2649
2491
|
}
|
|
@@ -2726,9 +2568,9 @@ m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;
|
|
|
2726
2568
|
function renderGraph() {
|
|
2727
2569
|
const columnCount = columnWidths.length;
|
|
2728
2570
|
const laneCount = nodes.reduce((x, n) => Math.max(x, n.lane), 0) + 1;
|
|
2729
|
-
const lanes =
|
|
2571
|
+
const lanes = fill(Array(laneCount), "");
|
|
2730
2572
|
const grid = columnWidths.map(() => Array(laneCount));
|
|
2731
|
-
const connectors = columnWidths.map(() =>
|
|
2573
|
+
const connectors = columnWidths.map(() => fill(Array(laneCount), 0));
|
|
2732
2574
|
for (const node of nodes) {
|
|
2733
2575
|
grid[node.level][node.lane] = node;
|
|
2734
2576
|
const children = getChildren(node);
|
|
@@ -2774,17 +2616,17 @@ m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;
|
|
|
2774
2616
|
for (let column = 0; column < columnCount; column++) {
|
|
2775
2617
|
for (let lane = 0; lane < lanes.length; lane++) {
|
|
2776
2618
|
const connector = connectors[column][lane];
|
|
2777
|
-
const
|
|
2619
|
+
const fill2 = connector & 4 /* Left */ ? "\u2500" /* lr */ : " ";
|
|
2778
2620
|
const node = grid[column][lane];
|
|
2779
2621
|
if (!node) {
|
|
2780
2622
|
if (column < columnCount - 1) {
|
|
2781
|
-
writeLane(lane, repeat(
|
|
2623
|
+
writeLane(lane, repeat(fill2, columnWidths[column] + 1));
|
|
2782
2624
|
}
|
|
2783
2625
|
} else {
|
|
2784
2626
|
writeLane(lane, node.text);
|
|
2785
2627
|
if (column < columnCount - 1) {
|
|
2786
2628
|
writeLane(lane, " ");
|
|
2787
|
-
writeLane(lane, repeat(
|
|
2629
|
+
writeLane(lane, repeat(fill2, columnWidths[column] - node.text.length));
|
|
2788
2630
|
}
|
|
2789
2631
|
}
|
|
2790
2632
|
writeLane(lane, getBoxCharacter(connector));
|
|
@@ -2825,7 +2667,7 @@ ${lanes.join("\n")}
|
|
|
2825
2667
|
}
|
|
2826
2668
|
return " ";
|
|
2827
2669
|
}
|
|
2828
|
-
function
|
|
2670
|
+
function fill(array, value) {
|
|
2829
2671
|
if (array.fill) {
|
|
2830
2672
|
array.fill(value);
|
|
2831
2673
|
} else {
|
|
@@ -11259,8 +11101,8 @@ ${lanes.join("\n")}
|
|
|
11259
11101
|
await: 133 /* AwaitKeyword */,
|
|
11260
11102
|
of: 162 /* OfKeyword */
|
|
11261
11103
|
};
|
|
11262
|
-
textToKeyword = new Map(
|
|
11263
|
-
textToToken = new Map(
|
|
11104
|
+
textToKeyword = new Map(Object.entries(textToKeywordObj));
|
|
11105
|
+
textToToken = new Map(Object.entries({
|
|
11264
11106
|
...textToKeywordObj,
|
|
11265
11107
|
"{": 18 /* OpenBraceToken */,
|
|
11266
11108
|
"}": 19 /* CloseBraceToken */,
|
|
@@ -12885,8 +12727,7 @@ ${lanes.join("\n")}
|
|
|
12885
12727
|
}
|
|
12886
12728
|
function forEachEntry(map2, callback) {
|
|
12887
12729
|
const iterator = map2.entries();
|
|
12888
|
-
for (
|
|
12889
|
-
const [key, value] = iterResult.value;
|
|
12730
|
+
for (const [key, value] of iterator) {
|
|
12890
12731
|
const result = callback(value, key);
|
|
12891
12732
|
if (result) {
|
|
12892
12733
|
return result;
|
|
@@ -12896,8 +12737,8 @@ ${lanes.join("\n")}
|
|
|
12896
12737
|
}
|
|
12897
12738
|
function forEachKey(map2, callback) {
|
|
12898
12739
|
const iterator = map2.keys();
|
|
12899
|
-
for (
|
|
12900
|
-
const result = callback(
|
|
12740
|
+
for (const key of iterator) {
|
|
12741
|
+
const result = callback(key);
|
|
12901
12742
|
if (result) {
|
|
12902
12743
|
return result;
|
|
12903
12744
|
}
|
|
@@ -18626,7 +18467,7 @@ ${lanes.join("\n")}
|
|
|
18626
18467
|
doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18627
18468
|
singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
18628
18469
|
backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
|
|
18629
|
-
escapedCharsMap = new Map(
|
|
18470
|
+
escapedCharsMap = new Map(Object.entries({
|
|
18630
18471
|
" ": "\\t",
|
|
18631
18472
|
"\v": "\\v",
|
|
18632
18473
|
"\f": "\\f",
|
|
@@ -18649,7 +18490,7 @@ ${lanes.join("\n")}
|
|
|
18649
18490
|
nonAsciiCharacters = /[^\u0000-\u007F]/g;
|
|
18650
18491
|
jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18651
18492
|
jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g;
|
|
18652
|
-
jsxEscapedCharsMap = new Map(
|
|
18493
|
+
jsxEscapedCharsMap = new Map(Object.entries({
|
|
18653
18494
|
'"': """,
|
|
18654
18495
|
"'": "'"
|
|
18655
18496
|
}));
|
|
@@ -27797,7 +27638,6 @@ ${lanes.join("\n")}
|
|
|
27797
27638
|
let currentToken;
|
|
27798
27639
|
let nodeCount;
|
|
27799
27640
|
let identifiers;
|
|
27800
|
-
let privateIdentifiers;
|
|
27801
27641
|
let identifierCount;
|
|
27802
27642
|
let parsingContext;
|
|
27803
27643
|
let notParenthesizedArrow;
|
|
@@ -27950,7 +27790,6 @@ ${lanes.join("\n")}
|
|
|
27950
27790
|
parseDiagnostics = [];
|
|
27951
27791
|
parsingContext = 0;
|
|
27952
27792
|
identifiers = /* @__PURE__ */ new Map();
|
|
27953
|
-
privateIdentifiers = /* @__PURE__ */ new Map();
|
|
27954
27793
|
identifierCount = 0;
|
|
27955
27794
|
nodeCount = 0;
|
|
27956
27795
|
sourceFlags = 0;
|
|
@@ -28691,16 +28530,9 @@ ${lanes.join("\n")}
|
|
|
28691
28530
|
parseExpected(23 /* CloseBracketToken */);
|
|
28692
28531
|
return finishNode(factory2.createComputedPropertyName(expression), pos);
|
|
28693
28532
|
}
|
|
28694
|
-
function internPrivateIdentifier(text) {
|
|
28695
|
-
let privateIdentifier = privateIdentifiers.get(text);
|
|
28696
|
-
if (privateIdentifier === void 0) {
|
|
28697
|
-
privateIdentifiers.set(text, privateIdentifier = text);
|
|
28698
|
-
}
|
|
28699
|
-
return privateIdentifier;
|
|
28700
|
-
}
|
|
28701
28533
|
function parsePrivateIdentifier() {
|
|
28702
28534
|
const pos = getNodePos();
|
|
28703
|
-
const node = factory2.createPrivateIdentifier(
|
|
28535
|
+
const node = factory2.createPrivateIdentifier(internIdentifier(scanner2.getTokenValue()));
|
|
28704
28536
|
nextToken();
|
|
28705
28537
|
return finishNode(node, pos);
|
|
28706
28538
|
}
|
|
@@ -36411,9 +36243,9 @@ ${lanes.join("\n")}
|
|
|
36411
36243
|
case "object":
|
|
36412
36244
|
return {};
|
|
36413
36245
|
default:
|
|
36414
|
-
const
|
|
36415
|
-
if (
|
|
36416
|
-
return
|
|
36246
|
+
const value = firstOrUndefinedIterator(option.type.keys());
|
|
36247
|
+
if (value !== void 0)
|
|
36248
|
+
return value;
|
|
36417
36249
|
return Debug.fail("Expected 'option.type' to have entries.");
|
|
36418
36250
|
}
|
|
36419
36251
|
}
|
|
@@ -36427,14 +36259,14 @@ ${lanes.join("\n")}
|
|
|
36427
36259
|
type: "boolean",
|
|
36428
36260
|
defaultValueDescription: false
|
|
36429
36261
|
};
|
|
36430
|
-
jsxOptionMap = new Map(
|
|
36262
|
+
jsxOptionMap = new Map(Object.entries({
|
|
36431
36263
|
"preserve": 1 /* Preserve */,
|
|
36432
36264
|
"react-native": 3 /* ReactNative */,
|
|
36433
36265
|
"react": 2 /* React */,
|
|
36434
36266
|
"react-jsx": 4 /* ReactJSX */,
|
|
36435
36267
|
"react-jsxdev": 5 /* ReactJSXDev */
|
|
36436
36268
|
}));
|
|
36437
|
-
inverseJsxOptionMap = new Map(
|
|
36269
|
+
inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key]));
|
|
36438
36270
|
libEntries = [
|
|
36439
36271
|
// JavaScript only
|
|
36440
36272
|
["es5", "lib.es5.d.ts"],
|
|
@@ -36515,7 +36347,7 @@ ${lanes.join("\n")}
|
|
|
36515
36347
|
optionsForWatch = [
|
|
36516
36348
|
{
|
|
36517
36349
|
name: "watchFile",
|
|
36518
|
-
type: new Map(
|
|
36350
|
+
type: new Map(Object.entries({
|
|
36519
36351
|
fixedpollinginterval: 0 /* FixedPollingInterval */,
|
|
36520
36352
|
prioritypollinginterval: 1 /* PriorityPollingInterval */,
|
|
36521
36353
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -36529,7 +36361,7 @@ ${lanes.join("\n")}
|
|
|
36529
36361
|
},
|
|
36530
36362
|
{
|
|
36531
36363
|
name: "watchDirectory",
|
|
36532
|
-
type: new Map(
|
|
36364
|
+
type: new Map(Object.entries({
|
|
36533
36365
|
usefsevents: 0 /* UseFsEvents */,
|
|
36534
36366
|
fixedpollinginterval: 1 /* FixedPollingInterval */,
|
|
36535
36367
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -36541,7 +36373,7 @@ ${lanes.join("\n")}
|
|
|
36541
36373
|
},
|
|
36542
36374
|
{
|
|
36543
36375
|
name: "fallbackPolling",
|
|
36544
|
-
type: new Map(
|
|
36376
|
+
type: new Map(Object.entries({
|
|
36545
36377
|
fixedinterval: 0 /* FixedInterval */,
|
|
36546
36378
|
priorityinterval: 1 /* PriorityInterval */,
|
|
36547
36379
|
dynamicpriority: 2 /* DynamicPriority */,
|
|
@@ -36772,7 +36604,7 @@ ${lanes.join("\n")}
|
|
|
36772
36604
|
targetOptionDeclaration = {
|
|
36773
36605
|
name: "target",
|
|
36774
36606
|
shortName: "t",
|
|
36775
|
-
type: new Map(
|
|
36607
|
+
type: new Map(Object.entries({
|
|
36776
36608
|
es3: 0 /* ES3 */,
|
|
36777
36609
|
es5: 1 /* ES5 */,
|
|
36778
36610
|
es6: 2 /* ES2015 */,
|
|
@@ -36799,7 +36631,7 @@ ${lanes.join("\n")}
|
|
|
36799
36631
|
moduleOptionDeclaration = {
|
|
36800
36632
|
name: "module",
|
|
36801
36633
|
shortName: "m",
|
|
36802
|
-
type: new Map(
|
|
36634
|
+
type: new Map(Object.entries({
|
|
36803
36635
|
none: 0 /* None */,
|
|
36804
36636
|
commonjs: 1 /* CommonJS */,
|
|
36805
36637
|
amd: 2 /* AMD */,
|
|
@@ -37022,7 +36854,7 @@ ${lanes.join("\n")}
|
|
|
37022
36854
|
},
|
|
37023
36855
|
{
|
|
37024
36856
|
name: "importsNotUsedAsValues",
|
|
37025
|
-
type: new Map(
|
|
36857
|
+
type: new Map(Object.entries({
|
|
37026
36858
|
remove: 0 /* Remove */,
|
|
37027
36859
|
preserve: 1 /* Preserve */,
|
|
37028
36860
|
error: 2 /* Error */
|
|
@@ -37224,7 +37056,7 @@ ${lanes.join("\n")}
|
|
|
37224
37056
|
// Module Resolution
|
|
37225
37057
|
{
|
|
37226
37058
|
name: "moduleResolution",
|
|
37227
|
-
type: new Map(
|
|
37059
|
+
type: new Map(Object.entries({
|
|
37228
37060
|
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
37229
37061
|
node10: 2 /* Node10 */,
|
|
37230
37062
|
node: 2 /* Node10 */,
|
|
@@ -37516,7 +37348,7 @@ ${lanes.join("\n")}
|
|
|
37516
37348
|
},
|
|
37517
37349
|
{
|
|
37518
37350
|
name: "newLine",
|
|
37519
|
-
type: new Map(
|
|
37351
|
+
type: new Map(Object.entries({
|
|
37520
37352
|
crlf: 0 /* CarriageReturnLineFeed */,
|
|
37521
37353
|
lf: 1 /* LineFeed */
|
|
37522
37354
|
})),
|
|
@@ -37760,7 +37592,7 @@ ${lanes.join("\n")}
|
|
|
37760
37592
|
},
|
|
37761
37593
|
{
|
|
37762
37594
|
name: "moduleDetection",
|
|
37763
|
-
type: new Map(
|
|
37595
|
+
type: new Map(Object.entries({
|
|
37764
37596
|
auto: 2 /* Auto */,
|
|
37765
37597
|
legacy: 1 /* Legacy */,
|
|
37766
37598
|
force: 3 /* Force */
|
|
@@ -44260,9 +44092,9 @@ ${lanes.join("\n")}
|
|
|
44260
44092
|
const requireSymbol = createSymbol(4 /* Property */, "require");
|
|
44261
44093
|
let apparentArgumentCount;
|
|
44262
44094
|
const checker = {
|
|
44263
|
-
getNodeCount: () =>
|
|
44264
|
-
getIdentifierCount: () =>
|
|
44265
|
-
getSymbolCount: () =>
|
|
44095
|
+
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),
|
|
44096
|
+
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),
|
|
44097
|
+
getSymbolCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.symbolCount, symbolCount),
|
|
44266
44098
|
getTypeCount: () => typeCount,
|
|
44267
44099
|
getInstantiationCount: () => totalInstantiationCount,
|
|
44268
44100
|
getRelationCacheSizes: () => ({
|
|
@@ -55135,7 +54967,7 @@ ${lanes.join("\n")}
|
|
|
55135
54967
|
}
|
|
55136
54968
|
}
|
|
55137
54969
|
}
|
|
55138
|
-
if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */) && !(propSet && getCommonDeclarationsOfSymbols(
|
|
54970
|
+
if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */) && !(propSet && getCommonDeclarationsOfSymbols(propSet.values()))) {
|
|
55139
54971
|
return void 0;
|
|
55140
54972
|
}
|
|
55141
54973
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
@@ -57226,7 +57058,7 @@ ${lanes.join("\n")}
|
|
|
57226
57058
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
57227
57059
|
return namedUnions[0];
|
|
57228
57060
|
}
|
|
57229
|
-
const namedTypesCount = reduceLeft(namedUnions, (
|
|
57061
|
+
const namedTypesCount = reduceLeft(namedUnions, (sum, union) => sum + union.types.length, 0);
|
|
57230
57062
|
if (namedTypesCount + reducedTypes.length === typeSet.length) {
|
|
57231
57063
|
for (const t of namedUnions) {
|
|
57232
57064
|
insertType(reducedTypes, t);
|
|
@@ -58269,14 +58101,11 @@ ${lanes.join("\n")}
|
|
|
58269
58101
|
const constraint = getConstraintOfTypeParameter(p);
|
|
58270
58102
|
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
58271
58103
|
}
|
|
58272
|
-
function
|
|
58273
|
-
return
|
|
58104
|
+
function isSimpleTupleType(node) {
|
|
58105
|
+
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
|
|
58274
58106
|
}
|
|
58275
|
-
function
|
|
58276
|
-
return
|
|
58277
|
-
}
|
|
58278
|
-
function unwrapNondistributiveConditionalTuple(root, type) {
|
|
58279
|
-
return isTypicalNondistributiveConditional(root) && isTupleType(type) ? getTypeArguments(type)[0] : type;
|
|
58107
|
+
function isDeferredType(type, checkTuples) {
|
|
58108
|
+
return isGenericType(type) || checkTuples && isTupleType(type) && some(getTypeArguments(type), isGenericType);
|
|
58280
58109
|
}
|
|
58281
58110
|
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
58282
58111
|
let result;
|
|
@@ -58288,10 +58117,10 @@ ${lanes.join("\n")}
|
|
|
58288
58117
|
result = errorType;
|
|
58289
58118
|
break;
|
|
58290
58119
|
}
|
|
58291
|
-
const
|
|
58292
|
-
const checkType = instantiateType(
|
|
58293
|
-
const
|
|
58294
|
-
const extendsType = instantiateType(
|
|
58120
|
+
const checkTuples = isSimpleTupleType(root.node.checkType) && isSimpleTupleType(root.node.extendsType) && length(root.node.checkType.elements) === length(root.node.extendsType.elements);
|
|
58121
|
+
const checkType = instantiateType(getActualTypeVariable(root.checkType), mapper);
|
|
58122
|
+
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
58123
|
+
const extendsType = instantiateType(root.extendsType, mapper);
|
|
58295
58124
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
58296
58125
|
return wildcardType;
|
|
58297
58126
|
}
|
|
@@ -58313,16 +58142,16 @@ ${lanes.join("\n")}
|
|
|
58313
58142
|
}
|
|
58314
58143
|
}
|
|
58315
58144
|
}
|
|
58316
|
-
if (!
|
|
58145
|
+
if (!checkTypeDeferred) {
|
|
58317
58146
|
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
58318
58147
|
}
|
|
58319
58148
|
const innerMapper = combineTypeMappers(freshMapper, context.mapper);
|
|
58320
58149
|
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
58321
58150
|
}
|
|
58322
|
-
const inferredExtendsType = combinedMapper ? instantiateType(
|
|
58323
|
-
if (!
|
|
58324
|
-
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */
|
|
58325
|
-
if (checkType.flags & 1 /* Any */
|
|
58151
|
+
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
58152
|
+
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
58153
|
+
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
58154
|
+
if (checkType.flags & 1 /* Any */) {
|
|
58326
58155
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
58327
58156
|
}
|
|
58328
58157
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -59688,8 +59517,8 @@ ${lanes.join("\n")}
|
|
|
59688
59517
|
}
|
|
59689
59518
|
function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
59690
59519
|
let reportedError = false;
|
|
59691
|
-
for (
|
|
59692
|
-
const { errorNode: prop, innerExpression: next, nameType, errorMessage } =
|
|
59520
|
+
for (const value of iterator) {
|
|
59521
|
+
const { errorNode: prop, innerExpression: next, nameType, errorMessage } = value;
|
|
59693
59522
|
let targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType);
|
|
59694
59523
|
if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */)
|
|
59695
59524
|
continue;
|
|
@@ -59765,6 +59594,74 @@ ${lanes.join("\n")}
|
|
|
59765
59594
|
}
|
|
59766
59595
|
return reportedError;
|
|
59767
59596
|
}
|
|
59597
|
+
function elaborateIterableOrArrayLikeTargetElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
59598
|
+
const tupleOrArrayLikeTargetParts = filterType(target, isArrayOrTupleLikeType);
|
|
59599
|
+
const nonTupleOrArrayLikeTargetParts = filterType(target, (t) => !isArrayOrTupleLikeType(t));
|
|
59600
|
+
const iterationType = nonTupleOrArrayLikeTargetParts !== neverType ? getIterationTypeOfIterable(
|
|
59601
|
+
13 /* ForOf */,
|
|
59602
|
+
0 /* Yield */,
|
|
59603
|
+
nonTupleOrArrayLikeTargetParts,
|
|
59604
|
+
/*errorNode*/
|
|
59605
|
+
void 0
|
|
59606
|
+
) : void 0;
|
|
59607
|
+
let reportedError = false;
|
|
59608
|
+
for (let status = iterator.next(); !status.done; status = iterator.next()) {
|
|
59609
|
+
const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value;
|
|
59610
|
+
let targetPropType = iterationType;
|
|
59611
|
+
const targetIndexedPropType = tupleOrArrayLikeTargetParts !== neverType ? getBestMatchIndexedAccessTypeOrUndefined(source, tupleOrArrayLikeTargetParts, nameType) : void 0;
|
|
59612
|
+
if (targetIndexedPropType && !(targetIndexedPropType.flags & 8388608 /* IndexedAccess */)) {
|
|
59613
|
+
targetPropType = iterationType ? getUnionType([iterationType, targetIndexedPropType]) : targetIndexedPropType;
|
|
59614
|
+
}
|
|
59615
|
+
if (!targetPropType)
|
|
59616
|
+
continue;
|
|
59617
|
+
let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType);
|
|
59618
|
+
if (!sourcePropType)
|
|
59619
|
+
continue;
|
|
59620
|
+
const propName = getPropertyNameFromIndex(
|
|
59621
|
+
nameType,
|
|
59622
|
+
/*accessNode*/
|
|
59623
|
+
void 0
|
|
59624
|
+
);
|
|
59625
|
+
if (!checkTypeRelatedTo(
|
|
59626
|
+
sourcePropType,
|
|
59627
|
+
targetPropType,
|
|
59628
|
+
relation,
|
|
59629
|
+
/*errorNode*/
|
|
59630
|
+
void 0
|
|
59631
|
+
)) {
|
|
59632
|
+
const elaborated = next && elaborateError(
|
|
59633
|
+
next,
|
|
59634
|
+
sourcePropType,
|
|
59635
|
+
targetPropType,
|
|
59636
|
+
relation,
|
|
59637
|
+
/*headMessage*/
|
|
59638
|
+
void 0,
|
|
59639
|
+
containingMessageChain,
|
|
59640
|
+
errorOutputContainer
|
|
59641
|
+
);
|
|
59642
|
+
reportedError = true;
|
|
59643
|
+
if (!elaborated) {
|
|
59644
|
+
const resultObj = errorOutputContainer || {};
|
|
59645
|
+
const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;
|
|
59646
|
+
if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
|
|
59647
|
+
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));
|
|
59648
|
+
diagnostics.add(diag2);
|
|
59649
|
+
resultObj.errors = [diag2];
|
|
59650
|
+
} else {
|
|
59651
|
+
const targetIsOptional = !!(propName && (getPropertyOfType(tupleOrArrayLikeTargetParts, propName) || unknownSymbol).flags & 16777216 /* Optional */);
|
|
59652
|
+
const sourceIsOptional = !!(propName && (getPropertyOfType(source, propName) || unknownSymbol).flags & 16777216 /* Optional */);
|
|
59653
|
+
targetPropType = removeMissingType(targetPropType, targetIsOptional);
|
|
59654
|
+
sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional);
|
|
59655
|
+
const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
|
|
59656
|
+
if (result && specificSource !== sourcePropType) {
|
|
59657
|
+
checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);
|
|
59658
|
+
}
|
|
59659
|
+
}
|
|
59660
|
+
}
|
|
59661
|
+
}
|
|
59662
|
+
}
|
|
59663
|
+
return reportedError;
|
|
59664
|
+
}
|
|
59768
59665
|
function* generateJsxAttributes(node) {
|
|
59769
59666
|
if (!length(node.properties))
|
|
59770
59667
|
return;
|
|
@@ -59820,13 +59717,25 @@ ${lanes.join("\n")}
|
|
|
59820
59717
|
return result;
|
|
59821
59718
|
}
|
|
59822
59719
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
59823
|
-
|
|
59824
|
-
|
|
59720
|
+
let arrayLikeTargetParts;
|
|
59721
|
+
let nonArrayLikeTargetParts;
|
|
59722
|
+
const iterableType = getGlobalIterableType(
|
|
59723
|
+
/*reportErrors*/
|
|
59724
|
+
false
|
|
59725
|
+
);
|
|
59726
|
+
if (iterableType !== emptyGenericType) {
|
|
59727
|
+
const anyIterable = createIterableType(anyType);
|
|
59728
|
+
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
59729
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
59730
|
+
} else {
|
|
59731
|
+
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
59732
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
59733
|
+
}
|
|
59825
59734
|
if (moreThanOneRealChildren) {
|
|
59826
59735
|
if (arrayLikeTargetParts !== neverType) {
|
|
59827
59736
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
59828
59737
|
const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic);
|
|
59829
|
-
result =
|
|
59738
|
+
result = elaborateIterableOrArrayLikeTargetElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result;
|
|
59830
59739
|
} else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) {
|
|
59831
59740
|
result = true;
|
|
59832
59741
|
const diag2 = error(
|
|
@@ -63707,9 +63616,7 @@ ${lanes.join("\n")}
|
|
|
63707
63616
|
}
|
|
63708
63617
|
}
|
|
63709
63618
|
function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) {
|
|
63710
|
-
|
|
63711
|
-
if (!result.done)
|
|
63712
|
-
return result.value;
|
|
63619
|
+
return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties));
|
|
63713
63620
|
}
|
|
63714
63621
|
function tupleTypesDefinitelyUnrelated(source, target) {
|
|
63715
63622
|
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength);
|
|
@@ -64490,7 +64397,8 @@ ${lanes.join("\n")}
|
|
|
64490
64397
|
if (signature) {
|
|
64491
64398
|
const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
|
|
64492
64399
|
if (inference.contraCandidates) {
|
|
64493
|
-
|
|
64400
|
+
const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
|
|
64401
|
+
inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
|
|
64494
64402
|
} else if (inferredCovariantType) {
|
|
64495
64403
|
inferredType = inferredCovariantType;
|
|
64496
64404
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
@@ -66626,6 +66534,7 @@ ${lanes.join("\n")}
|
|
|
66626
66534
|
}
|
|
66627
66535
|
}
|
|
66628
66536
|
function getNarrowedTypeOfSymbol(symbol, location) {
|
|
66537
|
+
const type = getTypeOfSymbol(symbol);
|
|
66629
66538
|
const declaration = symbol.valueDeclaration;
|
|
66630
66539
|
if (declaration) {
|
|
66631
66540
|
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
@@ -66677,7 +66586,7 @@ ${lanes.join("\n")}
|
|
|
66677
66586
|
}
|
|
66678
66587
|
}
|
|
66679
66588
|
}
|
|
66680
|
-
return
|
|
66589
|
+
return type;
|
|
66681
66590
|
}
|
|
66682
66591
|
function checkIdentifier(node, checkMode) {
|
|
66683
66592
|
if (isThisInTypeQuery(node)) {
|
|
@@ -83319,7 +83228,7 @@ ${lanes.join("\n")}
|
|
|
83319
83228
|
TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
83320
83229
|
return TypeFacts3;
|
|
83321
83230
|
})(TypeFacts || {});
|
|
83322
|
-
typeofNEFacts = new Map(
|
|
83231
|
+
typeofNEFacts = new Map(Object.entries({
|
|
83323
83232
|
string: 256 /* TypeofNEString */,
|
|
83324
83233
|
number: 512 /* TypeofNENumber */,
|
|
83325
83234
|
bigint: 1024 /* TypeofNEBigInt */,
|
|
@@ -83350,7 +83259,7 @@ ${lanes.join("\n")}
|
|
|
83350
83259
|
return SignatureCheckMode3;
|
|
83351
83260
|
})(SignatureCheckMode || {});
|
|
83352
83261
|
isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor);
|
|
83353
|
-
intrinsicTypeKinds = new Map(
|
|
83262
|
+
intrinsicTypeKinds = new Map(Object.entries({
|
|
83354
83263
|
Uppercase: 0 /* Uppercase */,
|
|
83355
83264
|
Lowercase: 1 /* Lowercase */,
|
|
83356
83265
|
Capitalize: 2 /* Capitalize */,
|
|
@@ -84887,8 +84796,7 @@ ${lanes.join("\n")}
|
|
|
84887
84796
|
const sourceIndexToNewSourceIndexMap = [];
|
|
84888
84797
|
let nameIndexToNewNameIndexMap;
|
|
84889
84798
|
const mappingIterator = decodeMappings(map2.mappings);
|
|
84890
|
-
for (
|
|
84891
|
-
const raw = iterResult.value;
|
|
84799
|
+
for (const raw of mappingIterator) {
|
|
84892
84800
|
if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) {
|
|
84893
84801
|
break;
|
|
84894
84802
|
}
|
|
@@ -85120,6 +85028,9 @@ ${lanes.join("\n")}
|
|
|
85120
85028
|
return { value: captureMapping(hasSource, hasName), done };
|
|
85121
85029
|
}
|
|
85122
85030
|
return stopIterating();
|
|
85031
|
+
},
|
|
85032
|
+
[Symbol.iterator]() {
|
|
85033
|
+
return this;
|
|
85123
85034
|
}
|
|
85124
85035
|
};
|
|
85125
85036
|
function captureMapping(hasSource, hasName) {
|
|
@@ -88014,10 +87925,10 @@ ${lanes.join("\n")}
|
|
|
88014
87925
|
const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9 /* ES2022 */;
|
|
88015
87926
|
const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine;
|
|
88016
87927
|
const shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* ES2022 */;
|
|
88017
|
-
const shouldTransformAutoAccessors = languageVersion < 99 /* ESNext */;
|
|
87928
|
+
const shouldTransformAutoAccessors = languageVersion < 99 /* ESNext */ ? -1 /* True */ : !useDefineForClassFields ? 3 /* Maybe */ : 0 /* False */;
|
|
88018
87929
|
const shouldTransformThisInStaticInitializers = languageVersion < 9 /* ES2022 */;
|
|
88019
87930
|
const shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2 /* ES2015 */;
|
|
88020
|
-
const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors
|
|
87931
|
+
const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors === -1 /* True */;
|
|
88021
87932
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
88022
87933
|
context.onSubstituteNode = onSubstituteNode;
|
|
88023
87934
|
const previousOnEmitNode = context.onEmitNode;
|
|
@@ -88047,7 +87958,7 @@ ${lanes.join("\n")}
|
|
|
88047
87958
|
}
|
|
88048
87959
|
switch (node.kind) {
|
|
88049
87960
|
case 127 /* AccessorKeyword */:
|
|
88050
|
-
return
|
|
87961
|
+
return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node;
|
|
88051
87962
|
case 260 /* ClassDeclaration */:
|
|
88052
87963
|
return visitClassDeclaration(node);
|
|
88053
87964
|
case 228 /* ClassExpression */:
|
|
@@ -88322,7 +88233,7 @@ ${lanes.join("\n")}
|
|
|
88322
88233
|
Debug.assert(info, "Undeclared private name for property declaration.");
|
|
88323
88234
|
return info.isValid ? void 0 : node;
|
|
88324
88235
|
}
|
|
88325
|
-
if (shouldTransformInitializersUsingSet && !isStatic(node)) {
|
|
88236
|
+
if (shouldTransformInitializersUsingSet && !isStatic(node) && currentClassLexicalEnvironment && currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */) {
|
|
88326
88237
|
return factory2.updatePropertyDeclaration(
|
|
88327
88238
|
node,
|
|
88328
88239
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
@@ -88338,7 +88249,7 @@ ${lanes.join("\n")}
|
|
|
88338
88249
|
return visitEachChild(node, visitor, context);
|
|
88339
88250
|
}
|
|
88340
88251
|
function transformPublicFieldInitializer(node) {
|
|
88341
|
-
if (shouldTransformInitializers) {
|
|
88252
|
+
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
88342
88253
|
const expr = getPropertyNameExpressionIfNeeded(
|
|
88343
88254
|
node.name,
|
|
88344
88255
|
/*shouldHoist*/
|
|
@@ -88369,8 +88280,11 @@ ${lanes.join("\n")}
|
|
|
88369
88280
|
Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided.");
|
|
88370
88281
|
return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node);
|
|
88371
88282
|
}
|
|
88283
|
+
function shouldTransformAutoAccessorsInCurrentClass() {
|
|
88284
|
+
return shouldTransformAutoAccessors === -1 /* True */ || shouldTransformAutoAccessors === 3 /* Maybe */ && !!currentClassLexicalEnvironment && !!(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */);
|
|
88285
|
+
}
|
|
88372
88286
|
function visitPropertyDeclaration(node) {
|
|
88373
|
-
if (
|
|
88287
|
+
if (shouldTransformAutoAccessorsInCurrentClass() && isAutoAccessorPropertyDeclaration(node)) {
|
|
88374
88288
|
return transformAutoAccessor(node);
|
|
88375
88289
|
}
|
|
88376
88290
|
return transformFieldInitializer(node);
|
|
@@ -88771,26 +88685,44 @@ ${lanes.join("\n")}
|
|
|
88771
88685
|
if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(original)) {
|
|
88772
88686
|
facts |= 1 /* ClassWasDecorated */;
|
|
88773
88687
|
}
|
|
88688
|
+
let containsPublicInstanceFields = false;
|
|
88689
|
+
let containsInitializedPublicInstanceFields = false;
|
|
88690
|
+
let containsInstancePrivateElements = false;
|
|
88691
|
+
let containsInstanceAutoAccessors = false;
|
|
88774
88692
|
for (const member of node.members) {
|
|
88775
|
-
if (
|
|
88776
|
-
|
|
88777
|
-
|
|
88778
|
-
facts |= 2 /* NeedsClassConstructorReference */;
|
|
88779
|
-
}
|
|
88780
|
-
if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
|
|
88781
|
-
if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
|
|
88782
|
-
facts |= 8 /* NeedsSubstitutionForThisInClassStaticField */;
|
|
88783
|
-
if (!(facts & 1 /* ClassWasDecorated */)) {
|
|
88784
|
-
facts |= 2 /* NeedsClassConstructorReference */;
|
|
88785
|
-
}
|
|
88693
|
+
if (isStatic(member)) {
|
|
88694
|
+
if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
88695
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
88786
88696
|
}
|
|
88787
|
-
if (
|
|
88788
|
-
if (
|
|
88789
|
-
facts |=
|
|
88697
|
+
if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
|
|
88698
|
+
if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
|
|
88699
|
+
facts |= 8 /* NeedsSubstitutionForThisInClassStaticField */;
|
|
88700
|
+
if (!(facts & 1 /* ClassWasDecorated */)) {
|
|
88701
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
88702
|
+
}
|
|
88790
88703
|
}
|
|
88704
|
+
if (shouldTransformSuperInStaticInitializers && member.transformFlags & 134217728 /* ContainsLexicalSuper */) {
|
|
88705
|
+
if (!(facts & 1 /* ClassWasDecorated */)) {
|
|
88706
|
+
facts |= 2 /* NeedsClassConstructorReference */ | 4 /* NeedsClassSuperReference */;
|
|
88707
|
+
}
|
|
88708
|
+
}
|
|
88709
|
+
}
|
|
88710
|
+
} else if (!hasAbstractModifier(getOriginalNode(member))) {
|
|
88711
|
+
if (isAutoAccessorPropertyDeclaration(member)) {
|
|
88712
|
+
containsInstanceAutoAccessors = true;
|
|
88713
|
+
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
88714
|
+
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
88715
|
+
containsInstancePrivateElements = true;
|
|
88716
|
+
} else if (isPropertyDeclaration(member)) {
|
|
88717
|
+
containsPublicInstanceFields = true;
|
|
88718
|
+
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
|
|
88791
88719
|
}
|
|
88792
88720
|
}
|
|
88793
88721
|
}
|
|
88722
|
+
const willHoistInitializersToConstructor = shouldTransformInitializersUsingDefine && containsPublicInstanceFields || shouldTransformInitializersUsingSet && containsInitializedPublicInstanceFields || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstancePrivateElements || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstanceAutoAccessors && shouldTransformAutoAccessors === -1 /* True */;
|
|
88723
|
+
if (willHoistInitializersToConstructor) {
|
|
88724
|
+
facts |= 16 /* WillHoistInitializersToConstructor */;
|
|
88725
|
+
}
|
|
88794
88726
|
return facts;
|
|
88795
88727
|
}
|
|
88796
88728
|
function visitExpressionWithTypeArgumentsInHeritageClause(node) {
|
|
@@ -89066,15 +88998,9 @@ ${lanes.join("\n")}
|
|
|
89066
88998
|
)
|
|
89067
88999
|
);
|
|
89068
89000
|
}
|
|
89069
|
-
function isClassElementThatRequiresConstructorStatement(member) {
|
|
89070
|
-
if (isStatic(member) || hasAbstractModifier(getOriginalNode(member))) {
|
|
89071
|
-
return false;
|
|
89072
|
-
}
|
|
89073
|
-
return shouldTransformInitializersUsingDefine && isPropertyDeclaration(member) || shouldTransformInitializersUsingSet && isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierClassElementDeclaration(member) || shouldTransformPrivateElementsOrClassStaticBlocks && shouldTransformAutoAccessors && isAutoAccessorPropertyDeclaration(member);
|
|
89074
|
-
}
|
|
89075
89001
|
function transformConstructor(constructor, container) {
|
|
89076
89002
|
constructor = visitNode(constructor, visitor, isConstructorDeclaration);
|
|
89077
|
-
if (!
|
|
89003
|
+
if (!currentClassLexicalEnvironment || !(currentClassLexicalEnvironment.facts & 16 /* WillHoistInitializersToConstructor */)) {
|
|
89078
89004
|
return constructor;
|
|
89079
89005
|
}
|
|
89080
89006
|
const extendsClauseElement = getEffectiveBaseTypeNode(container);
|
|
@@ -93204,7 +93130,7 @@ ${lanes.join("\n")}
|
|
|
93204
93130
|
void 0,
|
|
93205
93131
|
factory2.createVariableDeclarationList([
|
|
93206
93132
|
factory2.createVariableDeclaration(
|
|
93207
|
-
factory2.createObjectBindingPattern(
|
|
93133
|
+
factory2.createObjectBindingPattern(arrayFrom(importSpecifiersMap.values(), (s) => factory2.createBindingElement(
|
|
93208
93134
|
/*dotdotdot*/
|
|
93209
93135
|
void 0,
|
|
93210
93136
|
s.propertyName,
|
|
@@ -93620,7 +93546,7 @@ ${lanes.join("\n")}
|
|
|
93620
93546
|
"src/compiler/transformers/jsx.ts"() {
|
|
93621
93547
|
"use strict";
|
|
93622
93548
|
init_ts2();
|
|
93623
|
-
entities = new Map(
|
|
93549
|
+
entities = new Map(Object.entries({
|
|
93624
93550
|
quot: 34,
|
|
93625
93551
|
amp: 38,
|
|
93626
93552
|
apos: 39,
|
|
@@ -103280,7 +103206,7 @@ ${lanes.join("\n")}
|
|
|
103280
103206
|
updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;
|
|
103281
103207
|
return updated;
|
|
103282
103208
|
function getLibReferences() {
|
|
103283
|
-
return
|
|
103209
|
+
return arrayFrom(libs2.keys(), (lib) => ({ fileName: lib, pos: -1, end: -1 }));
|
|
103284
103210
|
}
|
|
103285
103211
|
function getFileReferencesForUsedTypeReferences() {
|
|
103286
103212
|
return necessaryTypeReferences ? mapDefined(arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : [];
|
|
@@ -105822,6 +105748,8 @@ ${lanes.join("\n")}
|
|
|
105822
105748
|
let tempFlags;
|
|
105823
105749
|
let reservedNamesStack;
|
|
105824
105750
|
let reservedNames;
|
|
105751
|
+
let reservedPrivateNamesStack;
|
|
105752
|
+
let reservedPrivateNames;
|
|
105825
105753
|
let preserveSourceNewlines = printerOptions.preserveSourceNewlines;
|
|
105826
105754
|
let nextListElementPos;
|
|
105827
105755
|
let writer;
|
|
@@ -106115,6 +106043,9 @@ ${lanes.join("\n")}
|
|
|
106115
106043
|
tempFlagsStack = [];
|
|
106116
106044
|
tempFlags = TempFlags.Auto;
|
|
106117
106045
|
reservedNamesStack = [];
|
|
106046
|
+
reservedNames = void 0;
|
|
106047
|
+
reservedPrivateNamesStack = [];
|
|
106048
|
+
reservedPrivateNames = void 0;
|
|
106118
106049
|
currentSourceFile = void 0;
|
|
106119
106050
|
currentLineMap = void 0;
|
|
106120
106051
|
detachedCommentsInfo = void 0;
|
|
@@ -106858,9 +106789,13 @@ ${lanes.join("\n")}
|
|
|
106858
106789
|
}
|
|
106859
106790
|
}
|
|
106860
106791
|
function emitComputedPropertyName(node) {
|
|
106792
|
+
const savedPrivateNameTempFlags = privateNameTempFlags;
|
|
106793
|
+
const savedReservedMemberNames = reservedPrivateNames;
|
|
106794
|
+
popPrivateNameGenerationScope();
|
|
106861
106795
|
writePunctuation("[");
|
|
106862
106796
|
emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName);
|
|
106863
106797
|
writePunctuation("]");
|
|
106798
|
+
pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames);
|
|
106864
106799
|
}
|
|
106865
106800
|
function emitTypeParameter(node) {
|
|
106866
106801
|
emitModifiers(node, node.modifiers);
|
|
@@ -107040,10 +106975,16 @@ ${lanes.join("\n")}
|
|
|
107040
106975
|
emitTypeArguments(node, node.typeArguments);
|
|
107041
106976
|
}
|
|
107042
106977
|
function emitTypeLiteral(node) {
|
|
106978
|
+
pushPrivateNameGenerationScope(
|
|
106979
|
+
TempFlags.Auto,
|
|
106980
|
+
/*newReservedMemberNames*/
|
|
106981
|
+
void 0
|
|
106982
|
+
);
|
|
107043
106983
|
writePunctuation("{");
|
|
107044
106984
|
const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */;
|
|
107045
106985
|
emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */);
|
|
107046
106986
|
writePunctuation("}");
|
|
106987
|
+
popPrivateNameGenerationScope();
|
|
107047
106988
|
}
|
|
107048
106989
|
function emitArrayType(node) {
|
|
107049
106990
|
emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
|
|
@@ -107223,6 +107164,11 @@ ${lanes.join("\n")}
|
|
|
107223
107164
|
emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma);
|
|
107224
107165
|
}
|
|
107225
107166
|
function emitObjectLiteralExpression(node) {
|
|
107167
|
+
pushPrivateNameGenerationScope(
|
|
107168
|
+
TempFlags.Auto,
|
|
107169
|
+
/*newReservedMemberNames*/
|
|
107170
|
+
void 0
|
|
107171
|
+
);
|
|
107226
107172
|
forEach(node.properties, generateMemberNames);
|
|
107227
107173
|
const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
|
|
107228
107174
|
if (indentedFlag) {
|
|
@@ -107234,6 +107180,7 @@ ${lanes.join("\n")}
|
|
|
107234
107180
|
if (indentedFlag) {
|
|
107235
107181
|
decreaseIndent();
|
|
107236
107182
|
}
|
|
107183
|
+
popPrivateNameGenerationScope();
|
|
107237
107184
|
}
|
|
107238
107185
|
function emitPropertyAccessExpression(node) {
|
|
107239
107186
|
emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
|
|
@@ -107973,6 +107920,11 @@ ${lanes.join("\n")}
|
|
|
107973
107920
|
emitClassDeclarationOrExpression(node);
|
|
107974
107921
|
}
|
|
107975
107922
|
function emitClassDeclarationOrExpression(node) {
|
|
107923
|
+
pushPrivateNameGenerationScope(
|
|
107924
|
+
TempFlags.Auto,
|
|
107925
|
+
/*newReservedMemberNames*/
|
|
107926
|
+
void 0
|
|
107927
|
+
);
|
|
107976
107928
|
forEach(node.members, generateMemberNames);
|
|
107977
107929
|
emitDecoratorsAndModifiers(node, node.modifiers);
|
|
107978
107930
|
writeKeyword("class");
|
|
@@ -107993,8 +107945,14 @@ ${lanes.join("\n")}
|
|
|
107993
107945
|
if (indentedFlag) {
|
|
107994
107946
|
decreaseIndent();
|
|
107995
107947
|
}
|
|
107948
|
+
popPrivateNameGenerationScope();
|
|
107996
107949
|
}
|
|
107997
107950
|
function emitInterfaceDeclaration(node) {
|
|
107951
|
+
pushPrivateNameGenerationScope(
|
|
107952
|
+
TempFlags.Auto,
|
|
107953
|
+
/*newReservedMemberNames*/
|
|
107954
|
+
void 0
|
|
107955
|
+
);
|
|
107998
107956
|
emitModifiers(node, node.modifiers);
|
|
107999
107957
|
writeKeyword("interface");
|
|
108000
107958
|
writeSpace();
|
|
@@ -108005,6 +107963,7 @@ ${lanes.join("\n")}
|
|
|
108005
107963
|
writePunctuation("{");
|
|
108006
107964
|
emitList(node, node.members, 129 /* InterfaceMembers */);
|
|
108007
107965
|
writePunctuation("}");
|
|
107966
|
+
popPrivateNameGenerationScope();
|
|
108008
107967
|
}
|
|
108009
107968
|
function emitTypeAliasDeclaration(node) {
|
|
108010
107969
|
emitModifiers(node, node.modifiers);
|
|
@@ -109382,8 +109341,6 @@ ${lanes.join("\n")}
|
|
|
109382
109341
|
}
|
|
109383
109342
|
tempFlagsStack.push(tempFlags);
|
|
109384
109343
|
tempFlags = TempFlags.Auto;
|
|
109385
|
-
privateNameTempFlagsStack.push(privateNameTempFlags);
|
|
109386
|
-
privateNameTempFlags = TempFlags.Auto;
|
|
109387
109344
|
formattedNameTempFlagsStack.push(formattedNameTempFlags);
|
|
109388
109345
|
formattedNameTempFlags = void 0;
|
|
109389
109346
|
reservedNamesStack.push(reservedNames);
|
|
@@ -109393,7 +109350,6 @@ ${lanes.join("\n")}
|
|
|
109393
109350
|
return;
|
|
109394
109351
|
}
|
|
109395
109352
|
tempFlags = tempFlagsStack.pop();
|
|
109396
|
-
privateNameTempFlags = privateNameTempFlagsStack.pop();
|
|
109397
109353
|
formattedNameTempFlags = formattedNameTempFlagsStack.pop();
|
|
109398
109354
|
reservedNames = reservedNamesStack.pop();
|
|
109399
109355
|
}
|
|
@@ -109403,6 +109359,22 @@ ${lanes.join("\n")}
|
|
|
109403
109359
|
}
|
|
109404
109360
|
reservedNames.add(name);
|
|
109405
109361
|
}
|
|
109362
|
+
function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) {
|
|
109363
|
+
privateNameTempFlagsStack.push(privateNameTempFlags);
|
|
109364
|
+
privateNameTempFlags = newPrivateNameTempFlags;
|
|
109365
|
+
reservedPrivateNamesStack.push(reservedNames);
|
|
109366
|
+
reservedPrivateNames = newReservedMemberNames;
|
|
109367
|
+
}
|
|
109368
|
+
function popPrivateNameGenerationScope() {
|
|
109369
|
+
privateNameTempFlags = privateNameTempFlagsStack.pop();
|
|
109370
|
+
reservedPrivateNames = reservedPrivateNamesStack.pop();
|
|
109371
|
+
}
|
|
109372
|
+
function reservePrivateNameInNestedScopes(name) {
|
|
109373
|
+
if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) {
|
|
109374
|
+
reservedPrivateNames = /* @__PURE__ */ new Set();
|
|
109375
|
+
}
|
|
109376
|
+
reservedPrivateNames.add(name);
|
|
109377
|
+
}
|
|
109406
109378
|
function generateNames(node) {
|
|
109407
109379
|
if (!node)
|
|
109408
109380
|
return;
|
|
@@ -109524,10 +109496,13 @@ ${lanes.join("\n")}
|
|
|
109524
109496
|
const nodeId = getNodeId(node);
|
|
109525
109497
|
return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix)));
|
|
109526
109498
|
}
|
|
109527
|
-
function isUniqueName(name) {
|
|
109528
|
-
return isFileLevelUniqueName2(name) && !
|
|
109499
|
+
function isUniqueName(name, privateName) {
|
|
109500
|
+
return isFileLevelUniqueName2(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name);
|
|
109529
109501
|
}
|
|
109530
|
-
function
|
|
109502
|
+
function isReservedName(name, privateName) {
|
|
109503
|
+
return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name));
|
|
109504
|
+
}
|
|
109505
|
+
function isFileLevelUniqueName2(name, _isPrivate) {
|
|
109531
109506
|
return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true;
|
|
109532
109507
|
}
|
|
109533
109508
|
function isUniqueLocalName(name, container) {
|
|
@@ -109575,9 +109550,11 @@ ${lanes.join("\n")}
|
|
|
109575
109550
|
if (flags && !(tempFlags2 & flags)) {
|
|
109576
109551
|
const name = flags === TempFlags._i ? "_i" : "_n";
|
|
109577
109552
|
const fullName = formatGeneratedName(privateName, prefix, name, suffix);
|
|
109578
|
-
if (isUniqueName(fullName)) {
|
|
109553
|
+
if (isUniqueName(fullName, privateName)) {
|
|
109579
109554
|
tempFlags2 |= flags;
|
|
109580
|
-
if (
|
|
109555
|
+
if (privateName) {
|
|
109556
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
109557
|
+
} else if (reservedInNestedScopes) {
|
|
109581
109558
|
reserveNameInNestedScopes(fullName);
|
|
109582
109559
|
}
|
|
109583
109560
|
setTempFlags(key, tempFlags2);
|
|
@@ -109590,8 +109567,10 @@ ${lanes.join("\n")}
|
|
|
109590
109567
|
if (count !== 8 && count !== 13) {
|
|
109591
109568
|
const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
|
|
109592
109569
|
const fullName = formatGeneratedName(privateName, prefix, name, suffix);
|
|
109593
|
-
if (isUniqueName(fullName)) {
|
|
109594
|
-
if (
|
|
109570
|
+
if (isUniqueName(fullName, privateName)) {
|
|
109571
|
+
if (privateName) {
|
|
109572
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
109573
|
+
} else if (reservedInNestedScopes) {
|
|
109595
109574
|
reserveNameInNestedScopes(fullName);
|
|
109596
109575
|
}
|
|
109597
109576
|
setTempFlags(key, tempFlags2);
|
|
@@ -109609,8 +109588,10 @@ ${lanes.join("\n")}
|
|
|
109609
109588
|
}
|
|
109610
109589
|
if (optimistic) {
|
|
109611
109590
|
const fullName = formatGeneratedName(privateName, prefix, baseName, suffix);
|
|
109612
|
-
if (checkFn(fullName)) {
|
|
109613
|
-
if (
|
|
109591
|
+
if (checkFn(fullName, privateName)) {
|
|
109592
|
+
if (privateName) {
|
|
109593
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
109594
|
+
} else if (scoped) {
|
|
109614
109595
|
reserveNameInNestedScopes(fullName);
|
|
109615
109596
|
} else {
|
|
109616
109597
|
generatedNames.add(fullName);
|
|
@@ -109624,8 +109605,10 @@ ${lanes.join("\n")}
|
|
|
109624
109605
|
let i = 1;
|
|
109625
109606
|
while (true) {
|
|
109626
109607
|
const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix);
|
|
109627
|
-
if (checkFn(fullName)) {
|
|
109628
|
-
if (
|
|
109608
|
+
if (checkFn(fullName, privateName)) {
|
|
109609
|
+
if (privateName) {
|
|
109610
|
+
reservePrivateNameInNestedScopes(fullName);
|
|
109611
|
+
} else if (scoped) {
|
|
109629
109612
|
reserveNameInNestedScopes(fullName);
|
|
109630
109613
|
} else {
|
|
109631
109614
|
generatedNames.add(fullName);
|
|
@@ -115005,9 +114988,8 @@ ${lanes.join("\n")}
|
|
|
115005
114988
|
seenMap.add(path);
|
|
115006
114989
|
const references = state.referencedMap.getValues(path);
|
|
115007
114990
|
if (references) {
|
|
115008
|
-
const
|
|
115009
|
-
|
|
115010
|
-
queue.push(iterResult.value);
|
|
114991
|
+
for (const key of references.keys()) {
|
|
114992
|
+
queue.push(key);
|
|
115011
114993
|
}
|
|
115012
114994
|
}
|
|
115013
114995
|
}
|
|
@@ -117113,7 +117095,7 @@ ${lanes.join("\n")}
|
|
|
117113
117095
|
return (_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
|
|
117114
117096
|
}
|
|
117115
117097
|
function isInvalidatedFailedLookup(locationPath) {
|
|
117116
|
-
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) ||
|
|
117098
|
+
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);
|
|
117117
117099
|
}
|
|
117118
117100
|
function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) {
|
|
117119
117101
|
var _a2;
|
|
@@ -118410,7 +118392,7 @@ ${lanes.join("\n")}
|
|
|
118410
118392
|
if (wildcardDirectories) {
|
|
118411
118393
|
updateWatchingWildcardDirectories(
|
|
118412
118394
|
watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()),
|
|
118413
|
-
new Map(
|
|
118395
|
+
new Map(Object.entries(wildcardDirectories)),
|
|
118414
118396
|
watchWildcardDirectory
|
|
118415
118397
|
);
|
|
118416
118398
|
} else if (watchedWildcardDirectories) {
|
|
@@ -118504,7 +118486,7 @@ ${lanes.join("\n")}
|
|
|
118504
118486
|
if ((_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories) {
|
|
118505
118487
|
updateWatchingWildcardDirectories(
|
|
118506
118488
|
commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()),
|
|
118507
|
-
new Map(
|
|
118489
|
+
new Map(Object.entries((_c = commandLine.parsedCommandLine) == null ? void 0 : _c.wildcardDirectories)),
|
|
118508
118490
|
(directory, flags) => {
|
|
118509
118491
|
var _a3;
|
|
118510
118492
|
return watchDirectory(
|
|
@@ -120232,7 +120214,7 @@ ${lanes.join("\n")}
|
|
|
120232
120214
|
return;
|
|
120233
120215
|
updateWatchingWildcardDirectories(
|
|
120234
120216
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath),
|
|
120235
|
-
new Map(
|
|
120217
|
+
new Map(Object.entries(parsed.wildcardDirectories)),
|
|
120236
120218
|
(dir, flags) => state.watchDirectory(
|
|
120237
120219
|
dir,
|
|
120238
120220
|
(fileOrDirectory) => {
|
|
@@ -120653,12 +120635,13 @@ ${lanes.join("\n")}
|
|
|
120653
120635
|
}
|
|
120654
120636
|
function loadSafeList(host, safeListPath) {
|
|
120655
120637
|
const result = readConfigFile(safeListPath, (path) => host.readFile(path));
|
|
120656
|
-
return new Map(
|
|
120638
|
+
return new Map(Object.entries(result.config));
|
|
120657
120639
|
}
|
|
120658
120640
|
function loadTypesMap(host, typesMapPath) {
|
|
120641
|
+
var _a2;
|
|
120659
120642
|
const result = readConfigFile(typesMapPath, (path) => host.readFile(path));
|
|
120660
|
-
if (result.config) {
|
|
120661
|
-
return new Map(
|
|
120643
|
+
if ((_a2 = result.config) == null ? void 0 : _a2.simpleMap) {
|
|
120644
|
+
return new Map(Object.entries(result.config.simpleMap));
|
|
120662
120645
|
}
|
|
120663
120646
|
return void 0;
|
|
120664
120647
|
}
|
|
@@ -125336,7 +125319,7 @@ ${lanes.join("\n")}
|
|
|
125336
125319
|
return void 0;
|
|
125337
125320
|
const map2 = arrayToMultiMap(referenceEntries.map(ts_FindAllReferences_exports.toHighlightSpan), (e) => e.fileName, (e) => e.span);
|
|
125338
125321
|
const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames());
|
|
125339
|
-
return
|
|
125322
|
+
return arrayFrom(mapDefinedIterator(map2.entries(), ([fileName, highlightSpans]) => {
|
|
125340
125323
|
if (!sourceFilesSet.has(fileName)) {
|
|
125341
125324
|
if (!program.redirectTargetsMap.has(toPath(fileName, program.getCurrentDirectory(), getCanonicalFileName))) {
|
|
125342
125325
|
return void 0;
|
|
@@ -125347,7 +125330,7 @@ ${lanes.join("\n")}
|
|
|
125347
125330
|
Debug.assert(sourceFilesSet.has(fileName));
|
|
125348
125331
|
}
|
|
125349
125332
|
return { fileName, highlightSpans };
|
|
125350
|
-
});
|
|
125333
|
+
}));
|
|
125351
125334
|
}
|
|
125352
125335
|
function getSyntacticDocumentHighlights(node, sourceFile) {
|
|
125353
125336
|
const highlightSpans = getHighlightSpans(node, sourceFile);
|
|
@@ -127263,7 +127246,7 @@ ${lanes.join("\n")}
|
|
|
127263
127246
|
sourceFile.moduleName = transpileOptions.moduleName;
|
|
127264
127247
|
}
|
|
127265
127248
|
if (transpileOptions.renamedDependencies) {
|
|
127266
|
-
sourceFile.renamedDependencies = new Map(
|
|
127249
|
+
sourceFile.renamedDependencies = new Map(Object.entries(transpileOptions.renamedDependencies));
|
|
127267
127250
|
}
|
|
127268
127251
|
let outputText;
|
|
127269
127252
|
let sourceMapText;
|
|
@@ -129006,7 +128989,7 @@ ${lanes.join("\n")}
|
|
|
129006
128989
|
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
|
129007
128990
|
return ts_OutliningElementsCollector_exports.collectElements(sourceFile, cancellationToken);
|
|
129008
128991
|
}
|
|
129009
|
-
const braceMatching = new Map(
|
|
128992
|
+
const braceMatching = new Map(Object.entries({
|
|
129010
128993
|
[18 /* OpenBraceToken */]: 19 /* CloseBraceToken */,
|
|
129011
128994
|
[20 /* OpenParenToken */]: 21 /* CloseParenToken */,
|
|
129012
128995
|
[22 /* OpenBracketToken */]: 23 /* CloseBracketToken */,
|
|
@@ -136073,8 +136056,10 @@ ${lanes.join("\n")}
|
|
|
136073
136056
|
const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(symbolToken);
|
|
136074
136057
|
const useRequire = shouldUseRequire(sourceFile, program);
|
|
136075
136058
|
const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
|
|
136076
|
-
|
|
136077
|
-
|
|
136059
|
+
return arrayFrom(
|
|
136060
|
+
flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, { symbolName: symbolName2, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes),
|
|
136061
|
+
(fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text })
|
|
136062
|
+
);
|
|
136078
136063
|
});
|
|
136079
136064
|
}
|
|
136080
136065
|
function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program) {
|
|
@@ -137988,7 +137973,7 @@ ${lanes.join("\n")}
|
|
|
137988
137973
|
return factory.createFalse();
|
|
137989
137974
|
}
|
|
137990
137975
|
if (type.flags & 1056 /* EnumLike */) {
|
|
137991
|
-
const enumMember = type.symbol.exports ?
|
|
137976
|
+
const enumMember = type.symbol.exports ? firstOrUndefinedIterator(type.symbol.exports.values()) : type.symbol;
|
|
137992
137977
|
const name = checker.symbolToExpression(
|
|
137993
137978
|
type.symbol.parent ? type.symbol.parent : type.symbol,
|
|
137994
137979
|
111551 /* Value */,
|
|
@@ -141235,8 +141220,8 @@ ${lanes.join("\n")}
|
|
|
141235
141220
|
usedNames.add(createTypeParameterName(i));
|
|
141236
141221
|
}
|
|
141237
141222
|
}
|
|
141238
|
-
return
|
|
141239
|
-
|
|
141223
|
+
return arrayFrom(
|
|
141224
|
+
usedNames.values(),
|
|
141240
141225
|
(usedName) => {
|
|
141241
141226
|
var _a2;
|
|
141242
141227
|
return factory.createTypeParameterDeclaration(
|
|
@@ -152120,7 +152105,7 @@ ${lanes.join("\n")}
|
|
|
152120
152105
|
}
|
|
152121
152106
|
changes.replaceNode(sourceFile, toConvert, shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)));
|
|
152122
152107
|
if (neededNamedImports.size) {
|
|
152123
|
-
const newNamedImports = arrayFrom(neededNamedImports.values()
|
|
152108
|
+
const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.createIdentifier(element.propertyName.text), factory.createIdentifier(element.name.text)));
|
|
152124
152109
|
changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport(
|
|
152125
152110
|
importDecl,
|
|
152126
152111
|
/*defaultImportName*/
|
|
@@ -155555,7 +155540,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155555
155540
|
}
|
|
155556
155541
|
callArguments.push(factory.createIdentifier(name));
|
|
155557
155542
|
});
|
|
155558
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values()
|
|
155543
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclaration(type) }));
|
|
155559
155544
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
155560
155545
|
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations.map((t) => t.declaration);
|
|
155561
155546
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
@@ -160139,7 +160124,14 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
160139
160124
|
const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]);
|
|
160140
160125
|
const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 162 /* LastKeyword */);
|
|
160141
160126
|
const binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 78 /* LastBinaryOperator */);
|
|
160142
|
-
const binaryKeywordOperators = [
|
|
160127
|
+
const binaryKeywordOperators = [
|
|
160128
|
+
101 /* InKeyword */,
|
|
160129
|
+
102 /* InstanceOfKeyword */,
|
|
160130
|
+
162 /* OfKeyword */,
|
|
160131
|
+
128 /* AsKeyword */,
|
|
160132
|
+
140 /* IsKeyword */,
|
|
160133
|
+
150 /* SatisfiesKeyword */
|
|
160134
|
+
];
|
|
160143
160135
|
const unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */];
|
|
160144
160136
|
const unaryPrefixExpressions = [
|
|
160145
160137
|
8 /* NumericLiteral */,
|
|
@@ -167550,7 +167542,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167550
167542
|
ensureProjectForOpenFileSchedule = "*ensureProjectForOpenFiles*";
|
|
167551
167543
|
compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(optionDeclarations);
|
|
167552
167544
|
watchOptionsConverters = prepareConvertersForEnumLikeCompilerOptions(optionsForWatch);
|
|
167553
|
-
indentStyle = new Map(
|
|
167545
|
+
indentStyle = new Map(Object.entries({
|
|
167554
167546
|
none: 0 /* None */,
|
|
167555
167547
|
block: 1 /* Block */,
|
|
167556
167548
|
smart: 2 /* Smart */
|
|
@@ -168917,7 +168909,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
168917
168909
|
config.watchedDirectoriesStale = false;
|
|
168918
168910
|
updateWatchingWildcardDirectories(
|
|
168919
168911
|
config.watchedDirectories || (config.watchedDirectories = /* @__PURE__ */ new Map()),
|
|
168920
|
-
new Map(
|
|
168912
|
+
new Map(Object.entries(config.parsedCommandLine.wildcardDirectories)),
|
|
168921
168913
|
// Create new directory watcher
|
|
168922
168914
|
(directory, flags) => this.watchWildcardDirectory(directory, flags, configFileName, config)
|
|
168923
168915
|
);
|
|
@@ -169190,7 +169182,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169190
169182
|
}
|
|
169191
169183
|
/** @internal */
|
|
169192
169184
|
logErrorForScriptInfoNotFound(fileName) {
|
|
169193
|
-
const names = arrayFrom(this.filenameToScriptInfo.entries()
|
|
169185
|
+
const names = arrayFrom(this.filenameToScriptInfo.entries(), ([path, scriptInfo]) => ({ path, fileName: scriptInfo.fileName }));
|
|
169194
169186
|
this.logger.msg(`Could not find file ${JSON.stringify(fileName)}.
|
|
169195
169187
|
All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
169196
169188
|
}
|
|
@@ -170103,7 +170095,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
170103
170095
|
synchronizeProjectList(knownProjects, includeProjectReferenceRedirectInfo) {
|
|
170104
170096
|
const files = [];
|
|
170105
170097
|
this.collectChanges(knownProjects, this.externalProjects, includeProjectReferenceRedirectInfo, files);
|
|
170106
|
-
this.collectChanges(knownProjects,
|
|
170098
|
+
this.collectChanges(knownProjects, this.configuredProjects.values(), includeProjectReferenceRedirectInfo, files);
|
|
170107
170099
|
this.collectChanges(knownProjects, this.inferredProjects, includeProjectReferenceRedirectInfo, files);
|
|
170108
170100
|
return files;
|
|
170109
170101
|
}
|
|
@@ -170112,11 +170104,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
170112
170104
|
let openScriptInfos;
|
|
170113
170105
|
let assignOrphanScriptInfosToInferredProject = false;
|
|
170114
170106
|
if (openFiles) {
|
|
170115
|
-
|
|
170116
|
-
const iterResult = openFiles.next();
|
|
170117
|
-
if (iterResult.done)
|
|
170118
|
-
break;
|
|
170119
|
-
const file = iterResult.value;
|
|
170107
|
+
for (const file of openFiles) {
|
|
170120
170108
|
const info = this.getOrCreateOpenScriptInfo(
|
|
170121
170109
|
toNormalizedPath(file.fileName),
|
|
170122
170110
|
file.content,
|
|
@@ -170128,11 +170116,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
170128
170116
|
}
|
|
170129
170117
|
}
|
|
170130
170118
|
if (changedFiles) {
|
|
170131
|
-
|
|
170132
|
-
const iterResult = changedFiles.next();
|
|
170133
|
-
if (iterResult.done)
|
|
170134
|
-
break;
|
|
170135
|
-
const file = iterResult.value;
|
|
170119
|
+
for (const file of changedFiles) {
|
|
170136
170120
|
const scriptInfo = this.getScriptInfo(file.fileName);
|
|
170137
170121
|
Debug.assert(!!scriptInfo);
|
|
170138
170122
|
this.applyChangesToFile(scriptInfo, file.changes);
|
|
@@ -170164,11 +170148,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
170164
170148
|
}
|
|
170165
170149
|
/** @internal */
|
|
170166
170150
|
applyChangesToFile(scriptInfo, changes) {
|
|
170167
|
-
|
|
170168
|
-
const iterResult = changes.next();
|
|
170169
|
-
if (iterResult.done)
|
|
170170
|
-
break;
|
|
170171
|
-
const change = iterResult.value;
|
|
170151
|
+
for (const change of changes) {
|
|
170172
170152
|
scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText);
|
|
170173
170153
|
}
|
|
170174
170154
|
}
|
|
@@ -171026,9 +171006,7 @@ ${json}${newLine}`;
|
|
|
171026
171006
|
}
|
|
171027
171007
|
}
|
|
171028
171008
|
if (resultsMap.size === 1) {
|
|
171029
|
-
|
|
171030
|
-
Debug.assert(!it.done);
|
|
171031
|
-
return it.value;
|
|
171009
|
+
return firstIterator(resultsMap.values());
|
|
171032
171010
|
}
|
|
171033
171011
|
return resultsMap;
|
|
171034
171012
|
function searchPosition(project, location) {
|
|
@@ -171308,7 +171286,7 @@ ${json}${newLine}`;
|
|
|
171308
171286
|
Session3 = class {
|
|
171309
171287
|
constructor(opts) {
|
|
171310
171288
|
this.changeSeq = 0;
|
|
171311
|
-
this.handlers = new Map(
|
|
171289
|
+
this.handlers = new Map(Object.entries({
|
|
171312
171290
|
[CommandNames.Status]: () => {
|
|
171313
171291
|
const response = { version };
|
|
171314
171292
|
return this.requiredResponse(response);
|
|
@@ -171359,13 +171337,13 @@ ${json}${newLine}`;
|
|
|
171359
171337
|
[CommandNames.UpdateOpen]: (request) => {
|
|
171360
171338
|
this.changeSeq++;
|
|
171361
171339
|
this.projectService.applyChangesInOpenFiles(
|
|
171362
|
-
request.arguments.openFiles && mapIterator(
|
|
171340
|
+
request.arguments.openFiles && mapIterator(request.arguments.openFiles, (file) => ({
|
|
171363
171341
|
fileName: file.file,
|
|
171364
171342
|
content: file.fileContent,
|
|
171365
171343
|
scriptKind: file.scriptKindName,
|
|
171366
171344
|
projectRootPath: file.projectRootPath
|
|
171367
171345
|
})),
|
|
171368
|
-
request.arguments.changedFiles && mapIterator(
|
|
171346
|
+
request.arguments.changedFiles && mapIterator(request.arguments.changedFiles, (file) => ({
|
|
171369
171347
|
fileName: file.fileName,
|
|
171370
171348
|
changes: mapDefinedIterator(arrayReverseIterator(file.textChanges), (change) => {
|
|
171371
171349
|
const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file.fileName));
|
|
@@ -171384,8 +171362,8 @@ ${json}${newLine}`;
|
|
|
171384
171362
|
[CommandNames.ApplyChangedToOpenFiles]: (request) => {
|
|
171385
171363
|
this.changeSeq++;
|
|
171386
171364
|
this.projectService.applyChangesInOpenFiles(
|
|
171387
|
-
request.arguments.openFiles
|
|
171388
|
-
request.arguments.changedFiles && mapIterator(
|
|
171365
|
+
request.arguments.openFiles,
|
|
171366
|
+
request.arguments.changedFiles && mapIterator(request.arguments.changedFiles, (file) => ({
|
|
171389
171367
|
fileName: file.fileName,
|
|
171390
171368
|
// apply changes in reverse order
|
|
171391
171369
|
changes: arrayReverseIterator(file.changes)
|
|
@@ -175054,7 +175032,6 @@ ${e.message}`;
|
|
|
175054
175032
|
arrayIsEqualTo: () => arrayIsEqualTo,
|
|
175055
175033
|
arrayIsHomogeneous: () => arrayIsHomogeneous,
|
|
175056
175034
|
arrayIsSorted: () => arrayIsSorted,
|
|
175057
|
-
arrayIterator: () => arrayIterator,
|
|
175058
175035
|
arrayOf: () => arrayOf,
|
|
175059
175036
|
arrayReverseIterator: () => arrayReverseIterator,
|
|
175060
175037
|
arrayToMap: () => arrayToMap,
|
|
@@ -175156,7 +175133,6 @@ ${e.message}`;
|
|
|
175156
175133
|
compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics,
|
|
175157
175134
|
compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics,
|
|
175158
175135
|
compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules,
|
|
175159
|
-
compose: () => compose,
|
|
175160
175136
|
computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames,
|
|
175161
175137
|
computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition,
|
|
175162
175138
|
computeLineOfPosition: () => computeLineOfPosition,
|
|
@@ -175557,7 +175533,6 @@ ${e.message}`;
|
|
|
175557
175533
|
emitUsingBuildInfo: () => emitUsingBuildInfo,
|
|
175558
175534
|
emptyArray: () => emptyArray,
|
|
175559
175535
|
emptyFileSystemEntries: () => emptyFileSystemEntries,
|
|
175560
|
-
emptyIterator: () => emptyIterator,
|
|
175561
175536
|
emptyMap: () => emptyMap,
|
|
175562
175537
|
emptyOptions: () => emptyOptions,
|
|
175563
175538
|
emptySet: () => emptySet,
|
|
@@ -175592,7 +175567,6 @@ ${e.message}`;
|
|
|
175592
175567
|
fileExtensionIs: () => fileExtensionIs,
|
|
175593
175568
|
fileExtensionIsOneOf: () => fileExtensionIsOneOf,
|
|
175594
175569
|
fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics,
|
|
175595
|
-
fill: () => fill,
|
|
175596
175570
|
filter: () => filter,
|
|
175597
175571
|
filterMutate: () => filterMutate,
|
|
175598
175572
|
filterSemanticDiagnostics: () => filterSemanticDiagnostics,
|
|
@@ -175621,8 +175595,10 @@ ${e.message}`;
|
|
|
175621
175595
|
first: () => first,
|
|
175622
175596
|
firstDefined: () => firstDefined,
|
|
175623
175597
|
firstDefinedIterator: () => firstDefinedIterator,
|
|
175598
|
+
firstIterator: () => firstIterator,
|
|
175624
175599
|
firstOrOnly: () => firstOrOnly,
|
|
175625
175600
|
firstOrUndefined: () => firstOrUndefined,
|
|
175601
|
+
firstOrUndefinedIterator: () => firstOrUndefinedIterator,
|
|
175626
175602
|
fixupCompilerOptions: () => fixupCompilerOptions,
|
|
175627
175603
|
flatMap: () => flatMap,
|
|
175628
175604
|
flatMapIterator: () => flatMapIterator,
|
|
@@ -175772,7 +175748,6 @@ ${e.message}`;
|
|
|
175772
175748
|
getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications,
|
|
175773
175749
|
getEndLinePosition: () => getEndLinePosition,
|
|
175774
175750
|
getEntityNameFromTypeNode: () => getEntityNameFromTypeNode,
|
|
175775
|
-
getEntries: () => getEntries,
|
|
175776
175751
|
getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo,
|
|
175777
175752
|
getErrorCountForSummary: () => getErrorCountForSummary,
|
|
175778
175753
|
getErrorSpanForNode: () => getErrorSpanForNode,
|
|
@@ -175820,7 +175795,6 @@ ${e.message}`;
|
|
|
175820
175795
|
getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement,
|
|
175821
175796
|
getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes,
|
|
175822
175797
|
getInvokedExpression: () => getInvokedExpression,
|
|
175823
|
-
getIterator: () => getIterator,
|
|
175824
175798
|
getJSDocAugmentsTag: () => getJSDocAugmentsTag,
|
|
175825
175799
|
getJSDocClassTag: () => getJSDocClassTag,
|
|
175826
175800
|
getJSDocCommentRanges: () => getJSDocCommentRanges,
|
|
@@ -176833,7 +176807,6 @@ ${e.message}`;
|
|
|
176833
176807
|
mapDefined: () => mapDefined,
|
|
176834
176808
|
mapDefinedEntries: () => mapDefinedEntries,
|
|
176835
176809
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
176836
|
-
mapDefinedValues: () => mapDefinedValues,
|
|
176837
176810
|
mapEntries: () => mapEntries,
|
|
176838
176811
|
mapIterator: () => mapIterator,
|
|
176839
176812
|
mapOneOrMany: () => mapOneOrMany,
|
|
@@ -177116,7 +177089,6 @@ ${e.message}`;
|
|
|
177116
177089
|
stringContainsAt: () => stringContainsAt,
|
|
177117
177090
|
stringToToken: () => stringToToken,
|
|
177118
177091
|
stripQuotes: () => stripQuotes,
|
|
177119
|
-
sum: () => sum,
|
|
177120
177092
|
supportedDeclarationExtensions: () => supportedDeclarationExtensions,
|
|
177121
177093
|
supportedJSExtensions: () => supportedJSExtensions,
|
|
177122
177094
|
supportedJSExtensionsFlat: () => supportedJSExtensionsFlat,
|
|
@@ -177411,8 +177383,6 @@ ${e.message}`;
|
|
|
177411
177383
|
writeCommentRange: () => writeCommentRange,
|
|
177412
177384
|
writeFile: () => writeFile,
|
|
177413
177385
|
writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
|
|
177414
|
-
zipToIterator: () => zipToIterator,
|
|
177415
|
-
zipToMap: () => zipToMap,
|
|
177416
177386
|
zipToModeAwareCache: () => zipToModeAwareCache,
|
|
177417
177387
|
zipWith: () => zipWith
|
|
177418
177388
|
});
|
|
@@ -177703,7 +177673,6 @@ ${e.message}`;
|
|
|
177703
177673
|
arrayIsEqualTo: () => arrayIsEqualTo,
|
|
177704
177674
|
arrayIsHomogeneous: () => arrayIsHomogeneous,
|
|
177705
177675
|
arrayIsSorted: () => arrayIsSorted,
|
|
177706
|
-
arrayIterator: () => arrayIterator,
|
|
177707
177676
|
arrayOf: () => arrayOf,
|
|
177708
177677
|
arrayReverseIterator: () => arrayReverseIterator,
|
|
177709
177678
|
arrayToMap: () => arrayToMap,
|
|
@@ -177805,7 +177774,6 @@ ${e.message}`;
|
|
|
177805
177774
|
compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics,
|
|
177806
177775
|
compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics,
|
|
177807
177776
|
compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules,
|
|
177808
|
-
compose: () => compose,
|
|
177809
177777
|
computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames,
|
|
177810
177778
|
computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition,
|
|
177811
177779
|
computeLineOfPosition: () => computeLineOfPosition,
|
|
@@ -178206,7 +178174,6 @@ ${e.message}`;
|
|
|
178206
178174
|
emitUsingBuildInfo: () => emitUsingBuildInfo,
|
|
178207
178175
|
emptyArray: () => emptyArray,
|
|
178208
178176
|
emptyFileSystemEntries: () => emptyFileSystemEntries,
|
|
178209
|
-
emptyIterator: () => emptyIterator,
|
|
178210
178177
|
emptyMap: () => emptyMap,
|
|
178211
178178
|
emptyOptions: () => emptyOptions,
|
|
178212
178179
|
emptySet: () => emptySet,
|
|
@@ -178241,7 +178208,6 @@ ${e.message}`;
|
|
|
178241
178208
|
fileExtensionIs: () => fileExtensionIs,
|
|
178242
178209
|
fileExtensionIsOneOf: () => fileExtensionIsOneOf,
|
|
178243
178210
|
fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics,
|
|
178244
|
-
fill: () => fill,
|
|
178245
178211
|
filter: () => filter,
|
|
178246
178212
|
filterMutate: () => filterMutate,
|
|
178247
178213
|
filterSemanticDiagnostics: () => filterSemanticDiagnostics,
|
|
@@ -178270,8 +178236,10 @@ ${e.message}`;
|
|
|
178270
178236
|
first: () => first,
|
|
178271
178237
|
firstDefined: () => firstDefined,
|
|
178272
178238
|
firstDefinedIterator: () => firstDefinedIterator,
|
|
178239
|
+
firstIterator: () => firstIterator,
|
|
178273
178240
|
firstOrOnly: () => firstOrOnly,
|
|
178274
178241
|
firstOrUndefined: () => firstOrUndefined,
|
|
178242
|
+
firstOrUndefinedIterator: () => firstOrUndefinedIterator,
|
|
178275
178243
|
fixupCompilerOptions: () => fixupCompilerOptions,
|
|
178276
178244
|
flatMap: () => flatMap,
|
|
178277
178245
|
flatMapIterator: () => flatMapIterator,
|
|
@@ -178421,7 +178389,6 @@ ${e.message}`;
|
|
|
178421
178389
|
getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications,
|
|
178422
178390
|
getEndLinePosition: () => getEndLinePosition,
|
|
178423
178391
|
getEntityNameFromTypeNode: () => getEntityNameFromTypeNode,
|
|
178424
|
-
getEntries: () => getEntries,
|
|
178425
178392
|
getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo,
|
|
178426
178393
|
getErrorCountForSummary: () => getErrorCountForSummary,
|
|
178427
178394
|
getErrorSpanForNode: () => getErrorSpanForNode,
|
|
@@ -178469,7 +178436,6 @@ ${e.message}`;
|
|
|
178469
178436
|
getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement,
|
|
178470
178437
|
getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes,
|
|
178471
178438
|
getInvokedExpression: () => getInvokedExpression,
|
|
178472
|
-
getIterator: () => getIterator,
|
|
178473
178439
|
getJSDocAugmentsTag: () => getJSDocAugmentsTag,
|
|
178474
178440
|
getJSDocClassTag: () => getJSDocClassTag,
|
|
178475
178441
|
getJSDocCommentRanges: () => getJSDocCommentRanges,
|
|
@@ -179482,7 +179448,6 @@ ${e.message}`;
|
|
|
179482
179448
|
mapDefined: () => mapDefined,
|
|
179483
179449
|
mapDefinedEntries: () => mapDefinedEntries,
|
|
179484
179450
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
179485
|
-
mapDefinedValues: () => mapDefinedValues,
|
|
179486
179451
|
mapEntries: () => mapEntries,
|
|
179487
179452
|
mapIterator: () => mapIterator,
|
|
179488
179453
|
mapOneOrMany: () => mapOneOrMany,
|
|
@@ -179765,7 +179730,6 @@ ${e.message}`;
|
|
|
179765
179730
|
stringContainsAt: () => stringContainsAt,
|
|
179766
179731
|
stringToToken: () => stringToToken,
|
|
179767
179732
|
stripQuotes: () => stripQuotes,
|
|
179768
|
-
sum: () => sum,
|
|
179769
179733
|
supportedDeclarationExtensions: () => supportedDeclarationExtensions,
|
|
179770
179734
|
supportedJSExtensions: () => supportedJSExtensions,
|
|
179771
179735
|
supportedJSExtensionsFlat: () => supportedJSExtensionsFlat,
|
|
@@ -180060,8 +180024,6 @@ ${e.message}`;
|
|
|
180060
180024
|
writeCommentRange: () => writeCommentRange,
|
|
180061
180025
|
writeFile: () => writeFile,
|
|
180062
180026
|
writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
|
|
180063
|
-
zipToIterator: () => zipToIterator,
|
|
180064
|
-
zipToMap: () => zipToMap,
|
|
180065
180027
|
zipToModeAwareCache: () => zipToModeAwareCache,
|
|
180066
180028
|
zipWith: () => zipWith
|
|
180067
180029
|
});
|