moved getCanonicalName to 'core'

This commit is contained in:
Vladimir Matveev 2014-07-14 14:31:13 -07:00
parent 56f29e02d2
commit 35ec15538a
2 changed files with 7 additions and 7 deletions

View File

@ -464,6 +464,12 @@ module ts {
return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension;
}
export function getCanonicalFileName(fileName: string): string {
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
// otherwise use toLowerCase as a canonical form.
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
}
export interface ObjectAllocator {
getNodeConstructor(kind: SyntaxKind): new () => Node;
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;

View File

@ -222,10 +222,4 @@ var sys: System = (function () {
else {
return undefined; // Unsupported host
}
})();
function getCanonicalFileName(fileName: string): string {
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
// otherwise use toLowerCase as a canonical form.
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
}
})();