mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Replaced 'getModuleNameFromFilename' with 'removeFileExtension'.
This commit is contained in:
parent
4ba0ce433f
commit
7d9bf5093b
@ -332,7 +332,7 @@ module ts {
|
||||
break;
|
||||
case SyntaxKind.SourceFile:
|
||||
if (isExternalModule(<SourceFile>node)) {
|
||||
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + getModuleNameFromFilename((<SourceFile>node).filename) + '"');
|
||||
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"');
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -56,10 +56,10 @@ module ts {
|
||||
|
||||
function getOwnEmitOutputFilePath(sourceFile: SourceFile, extension: string) {
|
||||
if (compilerOptions.outDir) {
|
||||
var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile));
|
||||
var emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile));
|
||||
}
|
||||
else {
|
||||
var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(sourceFile.filename);
|
||||
var emitOutputFilePathWithoutExtension = removeFileExtension(sourceFile.filename);
|
||||
}
|
||||
|
||||
return emitOutputFilePathWithoutExtension + extension;
|
||||
@ -3141,7 +3141,7 @@ module ts {
|
||||
? referencedFile.filename // Declaration file, use declaration file name
|
||||
: shouldEmitToOwnFile(referencedFile, compilerOptions)
|
||||
? getOwnEmitOutputFilePath(referencedFile, ".d.ts") // Own output file so get the .d.ts file
|
||||
: getModuleNameFromFilename(compilerOptions.out) + ".d.ts";// Global out file
|
||||
: removeFileExtension(compilerOptions.out) + ".d.ts";// Global out file
|
||||
|
||||
declFileName = getRelativePathToDirectoryOrUrl(
|
||||
getDirectoryPath(normalizeSlashes(jsFilePath)),
|
||||
@ -3214,7 +3214,7 @@ module ts {
|
||||
}
|
||||
});
|
||||
declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos);
|
||||
writeFile(getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM);
|
||||
writeFile(removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,10 +22,6 @@ module ts {
|
||||
amdDependencies: string[];
|
||||
}
|
||||
|
||||
export function getModuleNameFromFilename(filename: string) {
|
||||
return removeFileExtension(filename);
|
||||
}
|
||||
|
||||
export function getSourceFileOfNode(node: Node): SourceFile {
|
||||
while (node && node.kind !== SyntaxKind.SourceFile) node = node.parent;
|
||||
return <SourceFile>node;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user