fix: correct library not to have lib and dart in name.

This commit is contained in:
Misko Hevery 2014-09-26 09:23:04 -07:00
parent eb8336816a
commit 87dd88ff0c
1 changed files with 5 additions and 2 deletions

View File

@ -28,8 +28,11 @@ export class Compiler extends TraceurCompiler {
var writer = new DartTreeWriter();
writer.visitAny(tree);
// TODO: Do this in the writer...
var library = 'library '+this.resolveModuleName(filename).replace(/\//g, '.')+';\n';
return library + writer.toString();
var library = this.resolveModuleName(filename)
.replace(/\//g, '.')
.replace('.lib.', '.')
.replace(/\.dart$/, '');
return 'library ' + library + ';\n' + writer.toString();
}
// Copy of the original method to use our custom Parser
parse(content, sourceName) {