refactor: Move away from index signature based "updateCache". (#30518)

We're deprecating the index signature overloads in favor of using a Map.

PR Close #30518
This commit is contained in:
Bowen Ni 2019-05-16 12:11:11 -07:00 committed by Misko Hevery
parent 55a14e4866
commit 4ecff42e7f

View File

@ -165,11 +165,11 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
if (inputs) { if (inputs) {
fileLoader = new CachedFileLoader(fileCache); fileLoader = new CachedFileLoader(fileCache);
// Resolve the inputs to absolute paths to match TypeScript internals // Resolve the inputs to absolute paths to match TypeScript internals
const resolvedInputs: {[path: string]: string} = {}; const resolvedInputs = new Map<string, string>();
const inputKeys = Object.keys(inputs); const inputKeys = Object.keys(inputs);
for (let i = 0; i < inputKeys.length; i++) { for (let i = 0; i < inputKeys.length; i++) {
const key = inputKeys[i]; const key = inputKeys[i];
resolvedInputs[resolveNormalizedPath(key)] = inputs[key]; resolvedInputs.set(resolveNormalizedPath(key), inputs[key]);
} }
fileCache.updateCache(resolvedInputs); fileCache.updateCache(resolvedInputs);
} else { } else {