@typescript-deploys/pr-build 5.5.0-pr-55267-86 → 5.5.0-pr-57421-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +479 -116
- package/lib/tsserver.js +584 -246
- package/lib/typescript.d.ts +653 -1090
- package/lib/typescript.js +179552 -179018
- package/lib/typingsInstaller.js +249 -2
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -15,10 +15,39 @@ and limitations under the License.
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
"use strict";
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __accessCheck = (obj, member, msg) => {
|
|
30
|
+
if (!member.has(obj))
|
|
31
|
+
throw TypeError("Cannot " + msg);
|
|
32
|
+
};
|
|
33
|
+
var __privateGet = (obj, member, getter) => {
|
|
34
|
+
__accessCheck(obj, member, "read from private field");
|
|
35
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
36
|
+
};
|
|
37
|
+
var __privateAdd = (obj, member, value) => {
|
|
38
|
+
if (member.has(obj))
|
|
39
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
40
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
41
|
+
};
|
|
42
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
43
|
+
__accessCheck(obj, member, "write to private field");
|
|
44
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
18
47
|
|
|
19
48
|
// src/compiler/corePublic.ts
|
|
20
49
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
50
|
+
var version = `${versionMajorMinor}.0-insiders.20240305`;
|
|
22
51
|
|
|
23
52
|
// src/compiler/core.ts
|
|
24
53
|
var emptyArray = [];
|
|
@@ -1215,7 +1244,7 @@ function skipWhile(array, predicate) {
|
|
|
1215
1244
|
}
|
|
1216
1245
|
}
|
|
1217
1246
|
function isNodeLikeSystem() {
|
|
1218
|
-
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof
|
|
1247
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof require !== "undefined";
|
|
1219
1248
|
}
|
|
1220
1249
|
|
|
1221
1250
|
// src/compiler/debug.ts
|
|
@@ -4834,7 +4863,7 @@ var sys = (() => {
|
|
|
4834
4863
|
}
|
|
4835
4864
|
let activeSession;
|
|
4836
4865
|
let profilePath = "./profile.cpuprofile";
|
|
4837
|
-
const
|
|
4866
|
+
const Buffer2 = require("buffer").Buffer;
|
|
4838
4867
|
const isMacOs = process.platform === "darwin";
|
|
4839
4868
|
const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
|
|
4840
4869
|
const platform = _os.platform();
|
|
@@ -5044,7 +5073,7 @@ var sys = (() => {
|
|
|
5044
5073
|
}
|
|
5045
5074
|
}
|
|
5046
5075
|
function bufferFrom(input, encoding) {
|
|
5047
|
-
return
|
|
5076
|
+
return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
|
|
5048
5077
|
}
|
|
5049
5078
|
function isFileSystemCaseSensitive() {
|
|
5050
5079
|
if (platform === "win32" || platform === "win64") {
|
|
@@ -14622,15 +14651,34 @@ function getSemanticJsxChildren(children) {
|
|
|
14622
14651
|
}
|
|
14623
14652
|
function createDiagnosticCollection() {
|
|
14624
14653
|
let nonFileDiagnostics = [];
|
|
14625
|
-
|
|
14626
|
-
|
|
14654
|
+
let filesWithDiagnostics = [];
|
|
14655
|
+
let fileDiagnostics = /* @__PURE__ */ new Map();
|
|
14627
14656
|
let hasReadNonFileDiagnostics = false;
|
|
14628
14657
|
return {
|
|
14629
14658
|
add,
|
|
14630
14659
|
lookup,
|
|
14631
14660
|
getGlobalDiagnostics,
|
|
14632
|
-
getDiagnostics
|
|
14661
|
+
getDiagnostics,
|
|
14662
|
+
checkpoint,
|
|
14663
|
+
revert
|
|
14633
14664
|
};
|
|
14665
|
+
function checkpoint() {
|
|
14666
|
+
const c = {
|
|
14667
|
+
nonFileDiagnostics: nonFileDiagnostics.slice(),
|
|
14668
|
+
filesWithDiagnostics: filesWithDiagnostics.slice(),
|
|
14669
|
+
fileDiagnostics: new Map(map(arrayFrom(fileDiagnostics.entries()), ([k, v]) => [k, v.slice()])),
|
|
14670
|
+
hasReadNonFileDiagnostics
|
|
14671
|
+
};
|
|
14672
|
+
return c;
|
|
14673
|
+
}
|
|
14674
|
+
function revert(checkpoint2) {
|
|
14675
|
+
({
|
|
14676
|
+
nonFileDiagnostics,
|
|
14677
|
+
filesWithDiagnostics,
|
|
14678
|
+
fileDiagnostics,
|
|
14679
|
+
hasReadNonFileDiagnostics
|
|
14680
|
+
} = checkpoint2);
|
|
14681
|
+
}
|
|
14634
14682
|
function lookup(diagnostic) {
|
|
14635
14683
|
let diagnostics;
|
|
14636
14684
|
if (diagnostic.file) {
|
|
@@ -16236,6 +16284,17 @@ function createCompilerDiagnosticFromMessageChain(chain, relatedInformation) {
|
|
|
16236
16284
|
relatedInformation
|
|
16237
16285
|
};
|
|
16238
16286
|
}
|
|
16287
|
+
function prefixDiagnosticWithMessageChain(base, chain) {
|
|
16288
|
+
if (!chain)
|
|
16289
|
+
return base;
|
|
16290
|
+
concatenateDiagnosticMessageChains(chain, createDiagnosticMessageChainFromDiagnostic(base));
|
|
16291
|
+
return {
|
|
16292
|
+
...base,
|
|
16293
|
+
code: chain.code,
|
|
16294
|
+
category: chain.category,
|
|
16295
|
+
messageText: chain.next ? chain : chain.messageText
|
|
16296
|
+
};
|
|
16297
|
+
}
|
|
16239
16298
|
function chainDiagnosticMessages(details, message, ...args) {
|
|
16240
16299
|
let text = getLocaleSpecificMessage(message);
|
|
16241
16300
|
if (some(args)) {
|
|
@@ -43193,11 +43252,226 @@ var intrinsicTypeKinds = new Map(Object.entries({
|
|
|
43193
43252
|
Uncapitalize: 3 /* Uncapitalize */,
|
|
43194
43253
|
NoInfer: 4 /* NoInfer */
|
|
43195
43254
|
}));
|
|
43196
|
-
var
|
|
43255
|
+
var SpeculatableCache = (valueOrTarget, _contextOrPropertyKey, descriptor) => {
|
|
43256
|
+
const baseGet = descriptor ? descriptor.get : valueOrTarget.get;
|
|
43257
|
+
const baseSet = descriptor ? descriptor.set : valueOrTarget.set;
|
|
43258
|
+
return {
|
|
43259
|
+
...descriptor,
|
|
43260
|
+
get: readValue,
|
|
43261
|
+
set: setValue,
|
|
43262
|
+
init(v) {
|
|
43263
|
+
const epoch = this.host.getCurrentSpeculativeEpoch();
|
|
43264
|
+
const values = [];
|
|
43265
|
+
const writtenEpochs = [epoch];
|
|
43266
|
+
values[epoch] = v;
|
|
43267
|
+
return {
|
|
43268
|
+
values,
|
|
43269
|
+
writtenEpochs
|
|
43270
|
+
};
|
|
43271
|
+
}
|
|
43272
|
+
};
|
|
43273
|
+
function readValue() {
|
|
43274
|
+
const internals = baseGet.call(this);
|
|
43275
|
+
if (!internals)
|
|
43276
|
+
return void 0;
|
|
43277
|
+
const {
|
|
43278
|
+
values,
|
|
43279
|
+
writtenEpochs
|
|
43280
|
+
} = internals;
|
|
43281
|
+
const discardedSpeculativeEpochs = this.host.getDiscardedSpeculativeEpochs();
|
|
43282
|
+
const hostEpoch = this instanceof SymbolLinks ? this.symbolEpoch : 0;
|
|
43283
|
+
const symbolDiscarded = discardedSpeculativeEpochs.has(hostEpoch);
|
|
43284
|
+
for (let i = writtenEpochs.length - 1; i >= 0; i--) {
|
|
43285
|
+
if (!symbolDiscarded && discardedSpeculativeEpochs.has(writtenEpochs[i])) {
|
|
43286
|
+
delete values[writtenEpochs[i]];
|
|
43287
|
+
writtenEpochs.splice(i, 1);
|
|
43288
|
+
continue;
|
|
43289
|
+
}
|
|
43290
|
+
return values[writtenEpochs[i]];
|
|
43291
|
+
}
|
|
43292
|
+
return void 0;
|
|
43293
|
+
}
|
|
43294
|
+
function setValue(value) {
|
|
43295
|
+
const internals = baseGet.call(this);
|
|
43296
|
+
const currentSpeculativeEpoch = this.host.getCurrentSpeculativeEpoch();
|
|
43297
|
+
if (!internals) {
|
|
43298
|
+
const values2 = [];
|
|
43299
|
+
const writtenEpochs2 = [];
|
|
43300
|
+
writtenEpochs2.push(currentSpeculativeEpoch);
|
|
43301
|
+
values2[currentSpeculativeEpoch] = value;
|
|
43302
|
+
baseSet.call(this, { values: values2, writtenEpochs: writtenEpochs2 });
|
|
43303
|
+
return value;
|
|
43304
|
+
}
|
|
43305
|
+
const {
|
|
43306
|
+
values,
|
|
43307
|
+
writtenEpochs
|
|
43308
|
+
} = internals;
|
|
43309
|
+
writtenEpochs.push(currentSpeculativeEpoch);
|
|
43310
|
+
values[currentSpeculativeEpoch] = value;
|
|
43311
|
+
return value;
|
|
43312
|
+
}
|
|
43197
43313
|
};
|
|
43198
|
-
|
|
43199
|
-
|
|
43200
|
-
|
|
43314
|
+
var SpeculatableLinks = class {
|
|
43315
|
+
constructor(host) {
|
|
43316
|
+
this.host = host;
|
|
43317
|
+
}
|
|
43318
|
+
};
|
|
43319
|
+
var _type, _writeType, _nameType;
|
|
43320
|
+
var SymbolLinks = class extends SpeculatableLinks {
|
|
43321
|
+
constructor(host, symbolEpoch = 0) {
|
|
43322
|
+
super(host);
|
|
43323
|
+
this.symbolEpoch = symbolEpoch;
|
|
43324
|
+
__privateAdd(this, _type, void 0);
|
|
43325
|
+
__privateAdd(this, _writeType, void 0);
|
|
43326
|
+
__privateAdd(this, _nameType, void 0);
|
|
43327
|
+
}
|
|
43328
|
+
get type() {
|
|
43329
|
+
return __privateGet(this, _type);
|
|
43330
|
+
}
|
|
43331
|
+
set type(_) {
|
|
43332
|
+
__privateSet(this, _type, _);
|
|
43333
|
+
}
|
|
43334
|
+
get writeType() {
|
|
43335
|
+
return __privateGet(this, _writeType);
|
|
43336
|
+
}
|
|
43337
|
+
set writeType(_) {
|
|
43338
|
+
__privateSet(this, _writeType, _);
|
|
43339
|
+
}
|
|
43340
|
+
get nameType() {
|
|
43341
|
+
return __privateGet(this, _nameType);
|
|
43342
|
+
}
|
|
43343
|
+
set nameType(_) {
|
|
43344
|
+
__privateSet(this, _nameType, _);
|
|
43345
|
+
}
|
|
43346
|
+
};
|
|
43347
|
+
_type = new WeakMap();
|
|
43348
|
+
_writeType = new WeakMap();
|
|
43349
|
+
_nameType = new WeakMap();
|
|
43350
|
+
__decorateClass([
|
|
43351
|
+
SpeculatableCache
|
|
43352
|
+
], SymbolLinks.prototype, "type", 1);
|
|
43353
|
+
__decorateClass([
|
|
43354
|
+
SpeculatableCache
|
|
43355
|
+
], SymbolLinks.prototype, "writeType", 1);
|
|
43356
|
+
__decorateClass([
|
|
43357
|
+
SpeculatableCache
|
|
43358
|
+
], SymbolLinks.prototype, "nameType", 1);
|
|
43359
|
+
var _flags, _resolvedType, _resolvedEnumType, _resolvedSignature, _resolvedSymbol, _resolvedIndexInfo, _effectsSignature, _switchTypes, _contextFreeType, _assertionExpressionType;
|
|
43360
|
+
var NodeLinks = class extends SpeculatableLinks {
|
|
43361
|
+
constructor() {
|
|
43362
|
+
super(...arguments);
|
|
43363
|
+
__privateAdd(this, _flags, 0 /* None */);
|
|
43364
|
+
__privateAdd(this, _resolvedType, void 0);
|
|
43365
|
+
__privateAdd(this, _resolvedEnumType, void 0);
|
|
43366
|
+
__privateAdd(this, _resolvedSignature, void 0);
|
|
43367
|
+
__privateAdd(this, _resolvedSymbol, void 0);
|
|
43368
|
+
__privateAdd(this, _resolvedIndexInfo, void 0);
|
|
43369
|
+
__privateAdd(this, _effectsSignature, void 0);
|
|
43370
|
+
__privateAdd(this, _switchTypes, void 0);
|
|
43371
|
+
__privateAdd(this, _contextFreeType, void 0);
|
|
43372
|
+
__privateAdd(this, _assertionExpressionType, void 0);
|
|
43373
|
+
}
|
|
43374
|
+
get flags() {
|
|
43375
|
+
return __privateGet(this, _flags);
|
|
43376
|
+
}
|
|
43377
|
+
set flags(_) {
|
|
43378
|
+
__privateSet(this, _flags, _);
|
|
43379
|
+
}
|
|
43380
|
+
get resolvedType() {
|
|
43381
|
+
return __privateGet(this, _resolvedType);
|
|
43382
|
+
}
|
|
43383
|
+
set resolvedType(_) {
|
|
43384
|
+
__privateSet(this, _resolvedType, _);
|
|
43385
|
+
}
|
|
43386
|
+
get resolvedEnumType() {
|
|
43387
|
+
return __privateGet(this, _resolvedEnumType);
|
|
43388
|
+
}
|
|
43389
|
+
set resolvedEnumType(_) {
|
|
43390
|
+
__privateSet(this, _resolvedEnumType, _);
|
|
43391
|
+
}
|
|
43392
|
+
get resolvedSignature() {
|
|
43393
|
+
return __privateGet(this, _resolvedSignature);
|
|
43394
|
+
}
|
|
43395
|
+
set resolvedSignature(_) {
|
|
43396
|
+
__privateSet(this, _resolvedSignature, _);
|
|
43397
|
+
}
|
|
43398
|
+
get resolvedSymbol() {
|
|
43399
|
+
return __privateGet(this, _resolvedSymbol);
|
|
43400
|
+
}
|
|
43401
|
+
set resolvedSymbol(_) {
|
|
43402
|
+
__privateSet(this, _resolvedSymbol, _);
|
|
43403
|
+
}
|
|
43404
|
+
get resolvedIndexInfo() {
|
|
43405
|
+
return __privateGet(this, _resolvedIndexInfo);
|
|
43406
|
+
}
|
|
43407
|
+
set resolvedIndexInfo(_) {
|
|
43408
|
+
__privateSet(this, _resolvedIndexInfo, _);
|
|
43409
|
+
}
|
|
43410
|
+
get effectsSignature() {
|
|
43411
|
+
return __privateGet(this, _effectsSignature);
|
|
43412
|
+
}
|
|
43413
|
+
set effectsSignature(_) {
|
|
43414
|
+
__privateSet(this, _effectsSignature, _);
|
|
43415
|
+
}
|
|
43416
|
+
get switchTypes() {
|
|
43417
|
+
return __privateGet(this, _switchTypes);
|
|
43418
|
+
}
|
|
43419
|
+
set switchTypes(_) {
|
|
43420
|
+
__privateSet(this, _switchTypes, _);
|
|
43421
|
+
}
|
|
43422
|
+
get contextFreeType() {
|
|
43423
|
+
return __privateGet(this, _contextFreeType);
|
|
43424
|
+
}
|
|
43425
|
+
set contextFreeType(_) {
|
|
43426
|
+
__privateSet(this, _contextFreeType, _);
|
|
43427
|
+
}
|
|
43428
|
+
get assertionExpressionType() {
|
|
43429
|
+
return __privateGet(this, _assertionExpressionType);
|
|
43430
|
+
}
|
|
43431
|
+
set assertionExpressionType(_) {
|
|
43432
|
+
__privateSet(this, _assertionExpressionType, _);
|
|
43433
|
+
}
|
|
43434
|
+
};
|
|
43435
|
+
_flags = new WeakMap();
|
|
43436
|
+
_resolvedType = new WeakMap();
|
|
43437
|
+
_resolvedEnumType = new WeakMap();
|
|
43438
|
+
_resolvedSignature = new WeakMap();
|
|
43439
|
+
_resolvedSymbol = new WeakMap();
|
|
43440
|
+
_resolvedIndexInfo = new WeakMap();
|
|
43441
|
+
_effectsSignature = new WeakMap();
|
|
43442
|
+
_switchTypes = new WeakMap();
|
|
43443
|
+
_contextFreeType = new WeakMap();
|
|
43444
|
+
_assertionExpressionType = new WeakMap();
|
|
43445
|
+
__decorateClass([
|
|
43446
|
+
SpeculatableCache
|
|
43447
|
+
], NodeLinks.prototype, "flags", 1);
|
|
43448
|
+
__decorateClass([
|
|
43449
|
+
SpeculatableCache
|
|
43450
|
+
], NodeLinks.prototype, "resolvedType", 1);
|
|
43451
|
+
__decorateClass([
|
|
43452
|
+
SpeculatableCache
|
|
43453
|
+
], NodeLinks.prototype, "resolvedEnumType", 1);
|
|
43454
|
+
__decorateClass([
|
|
43455
|
+
SpeculatableCache
|
|
43456
|
+
], NodeLinks.prototype, "resolvedSignature", 1);
|
|
43457
|
+
__decorateClass([
|
|
43458
|
+
SpeculatableCache
|
|
43459
|
+
], NodeLinks.prototype, "resolvedSymbol", 1);
|
|
43460
|
+
__decorateClass([
|
|
43461
|
+
SpeculatableCache
|
|
43462
|
+
], NodeLinks.prototype, "resolvedIndexInfo", 1);
|
|
43463
|
+
__decorateClass([
|
|
43464
|
+
SpeculatableCache
|
|
43465
|
+
], NodeLinks.prototype, "effectsSignature", 1);
|
|
43466
|
+
__decorateClass([
|
|
43467
|
+
SpeculatableCache
|
|
43468
|
+
], NodeLinks.prototype, "switchTypes", 1);
|
|
43469
|
+
__decorateClass([
|
|
43470
|
+
SpeculatableCache
|
|
43471
|
+
], NodeLinks.prototype, "contextFreeType", 1);
|
|
43472
|
+
__decorateClass([
|
|
43473
|
+
SpeculatableCache
|
|
43474
|
+
], NodeLinks.prototype, "assertionExpressionType", 1);
|
|
43201
43475
|
function getNodeId(node) {
|
|
43202
43476
|
if (!node.id) {
|
|
43203
43477
|
node.id = nextNodeId;
|
|
@@ -43217,7 +43491,18 @@ function isInstantiatedModule(node, preserveConstEnums) {
|
|
|
43217
43491
|
return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */;
|
|
43218
43492
|
}
|
|
43219
43493
|
function createTypeChecker(host) {
|
|
43220
|
-
var
|
|
43494
|
+
var speculativeCaches = [];
|
|
43495
|
+
var currentSpeculativeEpoch = 0;
|
|
43496
|
+
var discardedSpeculativeEpochs = /* @__PURE__ */ new Set();
|
|
43497
|
+
var speculationHost = {
|
|
43498
|
+
getCurrentSpeculativeEpoch() {
|
|
43499
|
+
return currentSpeculativeEpoch;
|
|
43500
|
+
},
|
|
43501
|
+
getDiscardedSpeculativeEpochs() {
|
|
43502
|
+
return discardedSpeculativeEpochs;
|
|
43503
|
+
}
|
|
43504
|
+
};
|
|
43505
|
+
var deferredDiagnosticsCallbacks = registerSpeculativeCache([]);
|
|
43221
43506
|
var addLazyDiagnostic = (arg) => {
|
|
43222
43507
|
deferredDiagnosticsCallbacks.push(arg);
|
|
43223
43508
|
};
|
|
@@ -44153,12 +44438,12 @@ function createTypeChecker(host) {
|
|
|
44153
44438
|
var mergedSymbols = [];
|
|
44154
44439
|
var symbolLinks = [];
|
|
44155
44440
|
var nodeLinks = [];
|
|
44156
|
-
var flowLoopCaches = [];
|
|
44157
|
-
var flowLoopNodes = [];
|
|
44158
|
-
var flowLoopKeys = [];
|
|
44159
|
-
var flowLoopTypes = [];
|
|
44160
|
-
var sharedFlowNodes = [];
|
|
44161
|
-
var sharedFlowTypes = [];
|
|
44441
|
+
var flowLoopCaches = registerSpeculativeCache([]);
|
|
44442
|
+
var flowLoopNodes = registerSpeculativeCache([]);
|
|
44443
|
+
var flowLoopKeys = registerSpeculativeCache([]);
|
|
44444
|
+
var flowLoopTypes = registerSpeculativeCache([]);
|
|
44445
|
+
var sharedFlowNodes = registerSpeculativeCache([]);
|
|
44446
|
+
var sharedFlowTypes = registerSpeculativeCache([]);
|
|
44162
44447
|
var flowNodeReachable = [];
|
|
44163
44448
|
var flowNodePostSuper = [];
|
|
44164
44449
|
var potentialThisCollisions = [];
|
|
@@ -44167,17 +44452,17 @@ function createTypeChecker(host) {
|
|
|
44167
44452
|
var potentialReflectCollisions = [];
|
|
44168
44453
|
var potentialUnusedRenamedBindingElementsInTypes = [];
|
|
44169
44454
|
var awaitedTypeStack = [];
|
|
44170
|
-
var diagnostics = createDiagnosticCollection();
|
|
44171
|
-
var suggestionDiagnostics = createDiagnosticCollection();
|
|
44455
|
+
var diagnostics = registerSpeculativeCache(createDiagnosticCollection());
|
|
44456
|
+
var suggestionDiagnostics = registerSpeculativeCache(createDiagnosticCollection());
|
|
44172
44457
|
var typeofType = createTypeofType();
|
|
44173
44458
|
var _jsxNamespace;
|
|
44174
44459
|
var _jsxFactoryEntity;
|
|
44175
|
-
var subtypeRelation = /* @__PURE__ */ new Map();
|
|
44176
|
-
var strictSubtypeRelation = /* @__PURE__ */ new Map();
|
|
44177
|
-
var assignableRelation = /* @__PURE__ */ new Map();
|
|
44178
|
-
var comparableRelation = /* @__PURE__ */ new Map();
|
|
44179
|
-
var identityRelation = /* @__PURE__ */ new Map();
|
|
44180
|
-
var enumRelation = /* @__PURE__ */ new Map();
|
|
44460
|
+
var subtypeRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44461
|
+
var strictSubtypeRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44462
|
+
var assignableRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44463
|
+
var comparableRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44464
|
+
var identityRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44465
|
+
var enumRelation = registerSpeculativeCache(/* @__PURE__ */ new Map());
|
|
44181
44466
|
var builtinGlobals = createSymbolTable();
|
|
44182
44467
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
44183
44468
|
var suggestedExtensions = [
|
|
@@ -44356,7 +44641,8 @@ function createTypeChecker(host) {
|
|
|
44356
44641
|
function createSymbol(flags, name, checkFlags) {
|
|
44357
44642
|
symbolCount++;
|
|
44358
44643
|
const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
|
|
44359
|
-
symbol.
|
|
44644
|
+
symbol.epoch = currentSpeculativeEpoch;
|
|
44645
|
+
symbol.links = new SymbolLinks(speculationHost, symbol.epoch);
|
|
44360
44646
|
symbol.links.checkFlags = checkFlags || 0 /* None */;
|
|
44361
44647
|
return symbol;
|
|
44362
44648
|
}
|
|
@@ -44614,11 +44900,11 @@ function createTypeChecker(host) {
|
|
|
44614
44900
|
if (symbol.flags & 33554432 /* Transient */)
|
|
44615
44901
|
return symbol.links;
|
|
44616
44902
|
const id = getSymbolId(symbol);
|
|
44617
|
-
return symbolLinks[id] ?? (symbolLinks[id] = new SymbolLinks());
|
|
44903
|
+
return symbolLinks[id] ?? (symbolLinks[id] = new SymbolLinks(speculationHost));
|
|
44618
44904
|
}
|
|
44619
44905
|
function getNodeLinks(node) {
|
|
44620
44906
|
const nodeId = getNodeId(node);
|
|
44621
|
-
return nodeLinks[nodeId]
|
|
44907
|
+
return nodeLinks[nodeId] ?? (nodeLinks[nodeId] = new NodeLinks(speculationHost));
|
|
44622
44908
|
}
|
|
44623
44909
|
function isGlobalSourceFile(node) {
|
|
44624
44910
|
return node.kind === 307 /* SourceFile */ && !isExternalOrCommonJsModule(node);
|
|
@@ -54514,10 +54800,11 @@ function createTypeChecker(host) {
|
|
|
54514
54800
|
const modifiers = getMappedTypeModifiers(type);
|
|
54515
54801
|
return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0;
|
|
54516
54802
|
}
|
|
54803
|
+
function getModifiersTypeOptionality(type) {
|
|
54804
|
+
return type.flags & 2097152 /* Intersection */ ? Math.max(...map(type.types, getModifiersTypeOptionality)) : getObjectFlags(type) & 32 /* Mapped */ ? getCombinedMappedTypeOptionality(type) : 0;
|
|
54805
|
+
}
|
|
54517
54806
|
function getCombinedMappedTypeOptionality(type) {
|
|
54518
|
-
|
|
54519
|
-
const modifiersType = getModifiersTypeFromMappedType(type);
|
|
54520
|
-
return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0);
|
|
54807
|
+
return getMappedTypeOptionality(type) || getModifiersTypeOptionality(getModifiersTypeFromMappedType(type));
|
|
54521
54808
|
}
|
|
54522
54809
|
function isPartialMappedType(type) {
|
|
54523
54810
|
return !!(getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */);
|
|
@@ -58282,7 +58569,13 @@ function createTypeChecker(host) {
|
|
|
58282
58569
|
function substituteIndexedMappedType(objectType, index) {
|
|
58283
58570
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
58284
58571
|
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
58285
|
-
|
|
58572
|
+
const instantiatedTemplateType = instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
58573
|
+
return addOptionality(
|
|
58574
|
+
instantiatedTemplateType,
|
|
58575
|
+
/*isProperty*/
|
|
58576
|
+
true,
|
|
58577
|
+
getCombinedMappedTypeOptionality(objectType) > 0
|
|
58578
|
+
);
|
|
58286
58579
|
}
|
|
58287
58580
|
function getIndexedAccessType(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
58288
58581
|
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
|
|
@@ -59193,7 +59486,7 @@ function createTypeChecker(host) {
|
|
|
59193
59486
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59194
59487
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
59195
59488
|
const links = getNodeLinks(declaration);
|
|
59196
|
-
const target = type.objectFlags & 4 /* Reference */ ?
|
|
59489
|
+
const target = type.objectFlags & 4 /* Reference */ ? getTypeFromTypeNode(declaration) : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
59197
59490
|
let typeParameters = links.outerTypeParameters;
|
|
59198
59491
|
if (!typeParameters) {
|
|
59199
59492
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -71687,8 +71980,8 @@ function createTypeChecker(host) {
|
|
|
71687
71980
|
Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this");
|
|
71688
71981
|
const args = getEffectiveCallArguments(node);
|
|
71689
71982
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
71690
|
-
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
71691
71983
|
let candidatesForArgumentError;
|
|
71984
|
+
let candidateArgumentErrors;
|
|
71692
71985
|
let candidateForArgumentArityError;
|
|
71693
71986
|
let candidateForTypeArgumentError;
|
|
71694
71987
|
let result;
|
|
@@ -71719,18 +72012,10 @@ function createTypeChecker(host) {
|
|
|
71719
72012
|
if (headMessage) {
|
|
71720
72013
|
chain = chainDiagnosticMessages(chain, headMessage);
|
|
71721
72014
|
}
|
|
71722
|
-
const diags =
|
|
71723
|
-
node,
|
|
71724
|
-
args,
|
|
71725
|
-
last2,
|
|
71726
|
-
assignableRelation,
|
|
71727
|
-
0 /* Normal */,
|
|
71728
|
-
/*reportErrors*/
|
|
71729
|
-
true,
|
|
71730
|
-
() => chain
|
|
71731
|
-
);
|
|
72015
|
+
const diags = candidateArgumentErrors[candidateArgumentErrors.length - 1];
|
|
71732
72016
|
if (diags) {
|
|
71733
|
-
for (
|
|
72017
|
+
for (let d of diags) {
|
|
72018
|
+
d = prefixDiagnosticWithMessageChain(d, chain);
|
|
71734
72019
|
if (last2.declaration && candidatesForArgumentError.length > 3) {
|
|
71735
72020
|
addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here));
|
|
71736
72021
|
}
|
|
@@ -71755,23 +72040,14 @@ function createTypeChecker(host) {
|
|
|
71755
72040
|
candidates.length,
|
|
71756
72041
|
signatureToString(c)
|
|
71757
72042
|
);
|
|
71758
|
-
const diags2 =
|
|
71759
|
-
node,
|
|
71760
|
-
args,
|
|
71761
|
-
c,
|
|
71762
|
-
assignableRelation,
|
|
71763
|
-
0 /* Normal */,
|
|
71764
|
-
/*reportErrors*/
|
|
71765
|
-
true,
|
|
71766
|
-
chain2
|
|
71767
|
-
);
|
|
72043
|
+
const diags2 = candidateArgumentErrors[i];
|
|
71768
72044
|
if (diags2) {
|
|
71769
72045
|
if (diags2.length <= min2) {
|
|
71770
72046
|
min2 = diags2.length;
|
|
71771
72047
|
minIndex = i;
|
|
71772
72048
|
}
|
|
71773
72049
|
max = Math.max(max, diags2.length);
|
|
71774
|
-
allDiagnostics.push(diags2);
|
|
72050
|
+
allDiagnostics.push(map(diags2, (d) => prefixDiagnosticWithMessageChain(d, chain2())));
|
|
71775
72051
|
} else {
|
|
71776
72052
|
Debug.fail("No error for 3 or fewer overload signatures");
|
|
71777
72053
|
}
|
|
@@ -71820,6 +72096,7 @@ function createTypeChecker(host) {
|
|
|
71820
72096
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
71821
72097
|
var _a, _b;
|
|
71822
72098
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
72099
|
+
const oldCandidateArgumentErrors = candidateArgumentErrors;
|
|
71823
72100
|
const oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
71824
72101
|
const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
71825
72102
|
const failedSignatureDeclarations = ((_b = (_a = failed.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.declarations) || emptyArray;
|
|
@@ -71833,11 +72110,13 @@ function createTypeChecker(host) {
|
|
|
71833
72110
|
}
|
|
71834
72111
|
}
|
|
71835
72112
|
candidatesForArgumentError = oldCandidatesForArgumentError;
|
|
72113
|
+
candidateArgumentErrors = oldCandidateArgumentErrors;
|
|
71836
72114
|
candidateForArgumentArityError = oldCandidateForArgumentArityError;
|
|
71837
72115
|
candidateForTypeArgumentError = oldCandidateForTypeArgumentError;
|
|
71838
72116
|
}
|
|
71839
72117
|
function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) {
|
|
71840
72118
|
candidatesForArgumentError = void 0;
|
|
72119
|
+
candidateArgumentErrors = void 0;
|
|
71841
72120
|
candidateForArgumentArityError = void 0;
|
|
71842
72121
|
candidateForTypeArgumentError = void 0;
|
|
71843
72122
|
if (isSingleNonGenericCandidate2) {
|
|
@@ -71845,101 +72124,113 @@ function createTypeChecker(host) {
|
|
|
71845
72124
|
if (some(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
71846
72125
|
return void 0;
|
|
71847
72126
|
}
|
|
71848
|
-
|
|
72127
|
+
let diags;
|
|
72128
|
+
if (diags = getSignatureApplicabilityError(
|
|
71849
72129
|
node,
|
|
71850
72130
|
args,
|
|
71851
72131
|
candidate,
|
|
71852
72132
|
relation,
|
|
71853
72133
|
0 /* Normal */,
|
|
71854
72134
|
/*reportErrors*/
|
|
71855
|
-
|
|
72135
|
+
relation === assignableRelation,
|
|
71856
72136
|
/*containingMessageChain*/
|
|
71857
72137
|
void 0
|
|
71858
72138
|
)) {
|
|
71859
72139
|
candidatesForArgumentError = [candidate];
|
|
72140
|
+
candidateArgumentErrors = [diags];
|
|
71860
72141
|
return void 0;
|
|
71861
72142
|
}
|
|
71862
72143
|
return candidate;
|
|
71863
72144
|
}
|
|
72145
|
+
const initialCheckMode = !isDecorator2 && !isSingleNonGenericCandidate2 && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
71864
72146
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
71865
72147
|
const candidate = candidates2[candidateIndex];
|
|
71866
72148
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
71867
72149
|
continue;
|
|
71868
72150
|
}
|
|
71869
|
-
|
|
71870
|
-
|
|
71871
|
-
|
|
71872
|
-
let
|
|
71873
|
-
if (
|
|
71874
|
-
typeArgumentTypes
|
|
71875
|
-
|
|
71876
|
-
|
|
71877
|
-
|
|
71878
|
-
|
|
71879
|
-
|
|
71880
|
-
|
|
71881
|
-
|
|
71882
|
-
|
|
72151
|
+
const result2 = speculate(() => {
|
|
72152
|
+
let argCheckMode = initialCheckMode;
|
|
72153
|
+
let checkCandidate;
|
|
72154
|
+
let inferenceContext;
|
|
72155
|
+
if (candidate.typeParameters) {
|
|
72156
|
+
let typeArgumentTypes;
|
|
72157
|
+
if (some(typeArguments)) {
|
|
72158
|
+
typeArgumentTypes = checkTypeArguments(
|
|
72159
|
+
candidate,
|
|
72160
|
+
typeArguments,
|
|
72161
|
+
/*reportErrors*/
|
|
72162
|
+
false
|
|
72163
|
+
);
|
|
72164
|
+
if (!typeArgumentTypes) {
|
|
72165
|
+
candidateForTypeArgumentError = candidate;
|
|
72166
|
+
return false;
|
|
72167
|
+
}
|
|
72168
|
+
} else {
|
|
72169
|
+
inferenceContext = createInferenceContext(
|
|
72170
|
+
candidate.typeParameters,
|
|
72171
|
+
candidate,
|
|
72172
|
+
/*flags*/
|
|
72173
|
+
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
72174
|
+
);
|
|
72175
|
+
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
72176
|
+
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
71883
72177
|
}
|
|
71884
|
-
|
|
71885
|
-
inferenceContext = createInferenceContext(
|
|
71886
|
-
candidate.typeParameters,
|
|
71887
|
-
candidate,
|
|
71888
|
-
/*flags*/
|
|
71889
|
-
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
71890
|
-
);
|
|
71891
|
-
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
71892
|
-
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
71893
|
-
}
|
|
71894
|
-
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
71895
|
-
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
71896
|
-
candidateForArgumentArityError = checkCandidate;
|
|
71897
|
-
continue;
|
|
71898
|
-
}
|
|
71899
|
-
} else {
|
|
71900
|
-
checkCandidate = candidate;
|
|
71901
|
-
}
|
|
71902
|
-
if (getSignatureApplicabilityError(
|
|
71903
|
-
node,
|
|
71904
|
-
args,
|
|
71905
|
-
checkCandidate,
|
|
71906
|
-
relation,
|
|
71907
|
-
argCheckMode,
|
|
71908
|
-
/*reportErrors*/
|
|
71909
|
-
false,
|
|
71910
|
-
/*containingMessageChain*/
|
|
71911
|
-
void 0
|
|
71912
|
-
)) {
|
|
71913
|
-
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
71914
|
-
continue;
|
|
71915
|
-
}
|
|
71916
|
-
if (argCheckMode) {
|
|
71917
|
-
argCheckMode = 0 /* Normal */;
|
|
71918
|
-
if (inferenceContext) {
|
|
71919
|
-
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
71920
|
-
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
72178
|
+
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
71921
72179
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
71922
72180
|
candidateForArgumentArityError = checkCandidate;
|
|
71923
|
-
|
|
72181
|
+
return false;
|
|
71924
72182
|
}
|
|
72183
|
+
} else {
|
|
72184
|
+
checkCandidate = candidate;
|
|
71925
72185
|
}
|
|
71926
|
-
|
|
72186
|
+
let diags;
|
|
72187
|
+
if (diags = getSignatureApplicabilityError(
|
|
71927
72188
|
node,
|
|
71928
72189
|
args,
|
|
71929
72190
|
checkCandidate,
|
|
71930
72191
|
relation,
|
|
71931
72192
|
argCheckMode,
|
|
71932
72193
|
/*reportErrors*/
|
|
71933
|
-
|
|
72194
|
+
relation === assignableRelation,
|
|
71934
72195
|
/*containingMessageChain*/
|
|
71935
72196
|
void 0
|
|
71936
72197
|
)) {
|
|
71937
72198
|
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
71938
|
-
|
|
72199
|
+
(candidateArgumentErrors || (candidateArgumentErrors = [])).push(diags);
|
|
72200
|
+
return false;
|
|
71939
72201
|
}
|
|
72202
|
+
if (argCheckMode) {
|
|
72203
|
+
argCheckMode = 0 /* Normal */;
|
|
72204
|
+
if (inferenceContext) {
|
|
72205
|
+
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72206
|
+
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
72207
|
+
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
72208
|
+
candidateForArgumentArityError = checkCandidate;
|
|
72209
|
+
return false;
|
|
72210
|
+
}
|
|
72211
|
+
}
|
|
72212
|
+
if (diags = getSignatureApplicabilityError(
|
|
72213
|
+
node,
|
|
72214
|
+
args,
|
|
72215
|
+
checkCandidate,
|
|
72216
|
+
relation,
|
|
72217
|
+
argCheckMode,
|
|
72218
|
+
/*reportErrors*/
|
|
72219
|
+
relation === assignableRelation,
|
|
72220
|
+
/*containingMessageChain*/
|
|
72221
|
+
void 0
|
|
72222
|
+
)) {
|
|
72223
|
+
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
72224
|
+
(candidateArgumentErrors || (candidateArgumentErrors = [])).push(diags);
|
|
72225
|
+
return false;
|
|
72226
|
+
}
|
|
72227
|
+
}
|
|
72228
|
+
candidates2[candidateIndex] = checkCandidate;
|
|
72229
|
+
return checkCandidate;
|
|
72230
|
+
});
|
|
72231
|
+
if (result2) {
|
|
72232
|
+
return result2;
|
|
71940
72233
|
}
|
|
71941
|
-
candidates2[candidateIndex] = checkCandidate;
|
|
71942
|
-
return checkCandidate;
|
|
71943
72234
|
}
|
|
71944
72235
|
return void 0;
|
|
71945
72236
|
}
|
|
@@ -83125,6 +83416,78 @@ function createTypeChecker(host) {
|
|
|
83125
83416
|
}
|
|
83126
83417
|
return getDeclarationOfKind(moduleSymbol, 307 /* SourceFile */);
|
|
83127
83418
|
}
|
|
83419
|
+
function speculate(cb) {
|
|
83420
|
+
currentSpeculativeEpoch++;
|
|
83421
|
+
const startEpoch = currentSpeculativeEpoch;
|
|
83422
|
+
const initialState = snapshotCheckerState();
|
|
83423
|
+
const result = cb();
|
|
83424
|
+
const endEpoch = currentSpeculativeEpoch;
|
|
83425
|
+
currentSpeculativeEpoch++;
|
|
83426
|
+
if (!result) {
|
|
83427
|
+
for (let i = startEpoch; i <= endEpoch; i++) {
|
|
83428
|
+
discardedSpeculativeEpochs.add(i);
|
|
83429
|
+
}
|
|
83430
|
+
restoreCheckerState(initialState);
|
|
83431
|
+
return void 0;
|
|
83432
|
+
}
|
|
83433
|
+
return result;
|
|
83434
|
+
}
|
|
83435
|
+
function registerSpeculativeCache(collection) {
|
|
83436
|
+
speculativeCaches.push(collection);
|
|
83437
|
+
return collection;
|
|
83438
|
+
}
|
|
83439
|
+
function snapshotCheckerState() {
|
|
83440
|
+
const state = { restores: map(speculativeCaches, save) };
|
|
83441
|
+
return state;
|
|
83442
|
+
function save(cache) {
|
|
83443
|
+
if (Array.isArray(cache)) {
|
|
83444
|
+
return saveArray(cache);
|
|
83445
|
+
} else if (cache instanceof Map) {
|
|
83446
|
+
return saveMap(cache);
|
|
83447
|
+
} else if (cache instanceof Set) {
|
|
83448
|
+
return saveSet(cache);
|
|
83449
|
+
} else if (cache.add && cache.getDiagnostics) {
|
|
83450
|
+
return saveDiagnosticCollection(cache);
|
|
83451
|
+
}
|
|
83452
|
+
return Debug.fail("Unknown speculative cache type");
|
|
83453
|
+
}
|
|
83454
|
+
function saveArray(cache) {
|
|
83455
|
+
const original = cache.slice();
|
|
83456
|
+
return () => {
|
|
83457
|
+
cache.length = 0;
|
|
83458
|
+
cache.push(...original);
|
|
83459
|
+
};
|
|
83460
|
+
}
|
|
83461
|
+
function saveMap(cache) {
|
|
83462
|
+
const original = arrayFrom(cache.entries());
|
|
83463
|
+
return () => {
|
|
83464
|
+
cache.clear();
|
|
83465
|
+
for (const [k, v] of original) {
|
|
83466
|
+
cache.set(k, v);
|
|
83467
|
+
}
|
|
83468
|
+
};
|
|
83469
|
+
}
|
|
83470
|
+
function saveSet(cache) {
|
|
83471
|
+
const original = arrayFrom(cache.entries());
|
|
83472
|
+
return () => {
|
|
83473
|
+
cache.clear();
|
|
83474
|
+
for (const [_, v] of original) {
|
|
83475
|
+
cache.add(v);
|
|
83476
|
+
}
|
|
83477
|
+
};
|
|
83478
|
+
}
|
|
83479
|
+
function saveDiagnosticCollection(cache) {
|
|
83480
|
+
const c = cache.checkpoint();
|
|
83481
|
+
return () => {
|
|
83482
|
+
cache.revert(c);
|
|
83483
|
+
};
|
|
83484
|
+
}
|
|
83485
|
+
}
|
|
83486
|
+
function restoreCheckerState(state) {
|
|
83487
|
+
for (const restore of state.restores) {
|
|
83488
|
+
restore();
|
|
83489
|
+
}
|
|
83490
|
+
}
|
|
83128
83491
|
function initializeTypeChecker() {
|
|
83129
83492
|
for (const file of host.getSourceFiles()) {
|
|
83130
83493
|
bindSourceFile(file, compilerOptions);
|