@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
function verb(n) { return function (v) { return step([n, v]); }; }
46
46
function step(op) {
47
47
if (f) throw new TypeError("Generator is already executing.");
48
- while (_) try {
48
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
49
49
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
50
50
if (y = 0, t) op = [op[0] & 2, t.value];
51
51
switch (op[0]) {
@@ -118604,14 +118604,16 @@ var ts;
118604
118604
}
118605
118605
return setReadFileCache(key, fileName);
118606
118606
};
118607
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion , onError, shouldCreateNewSourceFile) {
118607
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions , onError, shouldCreateNewSourceFile) {
118608
118608
var key = toPath(fileName);
118609
- var value = sourceFileCache.get(key);
118609
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118610
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118611
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118610
118612
if (value)
118611
118613
return value;
118612
- var sourceFile = getSourceFile(fileName, languageVersion , onError, shouldCreateNewSourceFile);
118614
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions , onError, shouldCreateNewSourceFile);
118613
118615
if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118614
- sourceFileCache.set(key, sourceFile);
118616
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set( key, sourceFile) );
118615
118617
}
118616
118618
return sourceFile;
118617
118619
} : undefined;
@@ -118636,13 +118638,15 @@ var ts;
118636
118638
var value = readFileCache.get(key);
118637
118639
if (value !== undefined && value !== data) {
118638
118640
readFileCache.delete(key);
118639
- sourceFileCache.delete(key);
118641
+ sourceFileCache.forEach(function (map) { return map. delete(key); } );
118640
118642
}
118641
118643
else if (getSourceFileWithCache) {
118642
- var sourceFile = sourceFileCache.get(key);
118643
- if (sourceFile && sourceFile.text !== data) {
118644
- sourceFileCache.delete(key);
118645
- }
118644
+ sourceFileCache.forEach(function (map) {
118645
+ var sourceFile = map.get(key);
118646
+ if (sourceFile && sourceFile.text !== data) {
118647
+ map.delete(key);
118648
+ }
118649
+ });
118646
118650
}
118647
118651
originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118648
118652
};
0 commit comments