From 87dd88ff0c03a22e7b53fafd11ef46035c83ce46 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 26 Sep 2014 09:23:04 -0700 Subject: [PATCH] fix: correct library not to have lib and dart in name. --- tools/js2dart/src/compiler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/js2dart/src/compiler.js b/tools/js2dart/src/compiler.js index 186bc8386c..ebbdf4c46d 100644 --- a/tools/js2dart/src/compiler.js +++ b/tools/js2dart/src/compiler.js @@ -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) {