@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
4545 function verb(n) { return function (v) { return step([n, v]); }; }
4646 function step(op) {
4747 if (f) throw new TypeError("Generator is already executing.");
48- while (_) try {
48+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
4949 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;
5050 if (y = 0, t) op = [op[0] & 2, t.value];
5151 switch (op[0]) {
@@ -118604,14 +118604,16 @@ var ts;
118604118604 }
118605118605 return setReadFileCache(key, fileName);
118606118606 };
118607- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion , onError, shouldCreateNewSourceFile) {
118607+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions , onError, shouldCreateNewSourceFile) {
118608118608 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);
118610118612 if (value)
118611118613 return value;
118612- var sourceFile = getSourceFile(fileName, languageVersion , onError, shouldCreateNewSourceFile);
118614+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions , onError, shouldCreateNewSourceFile);
118613118615 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) );
118615118617 }
118616118618 return sourceFile;
118617118619 } : undefined;
@@ -118636,13 +118638,15 @@ var ts;
118636118638 var value = readFileCache.get(key);
118637118639 if (value !== undefined && value !== data) {
118638118640 readFileCache.delete(key);
118639- sourceFileCache.delete(key);
118641+ sourceFileCache.forEach(function (map) { return map. delete(key); } );
118640118642 }
118641118643 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+ });
118646118650 }
118647118651 originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118648118652 };
0 commit comments