Don't lose host 'this'

This commit is contained in:
Ryan Cavanaugh 2016-05-23 16:25:25 -07:00
parent 2d5f38c2bc
commit f7cc05482b

View File

@ -980,7 +980,7 @@ namespace ts {
// or load all types from the automatic type import fields
if (host && host.getDefaultTypeDirectiveNames) {
const commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), host.getCanonicalFileName);
const commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), f => host.getCanonicalFileName(f));
if (commonRoot) {
return host.getDefaultTypeDirectiveNames(commonRoot);
}