chore(traceur): update to 0.0.79

fixes #8
This commit is contained in:
Victor Berchet
2014-12-11 00:19:03 +01:00
committed by Vojta Jina
parent 6f303121c6
commit f04967ad37
2 changed files with 13 additions and 2 deletions

View File

@ -15,6 +15,7 @@ var SELF_COMPILE_OPTIONS = {
};
var needsReload = true;
var oldSystemGet = System.get;
exports.reloadSources = function() {
needsReload = true;
@ -63,6 +64,16 @@ function reloadCompiler() {
glob.sync(__dirname + '/src/**/*.js').forEach(function(fileName) {
loadModule(fileName, true);
});
// Traceur modules are register with the ".js" extension but we don't want
// to add it to all the import statements.
System.get = function get(normalizedName) {
var m = oldSystemGet.call(this, normalizedName);
if (!m && normalizedName.indexOf('traceur') == 0) {
m = oldSystemGet.call(this, normalizedName + '.js');
}
return m;
};
}
function loadModule(filepath, transpile) {
@ -94,4 +105,4 @@ function extend(source, props) {
res[prop] = props[prop];
}
return res;
}
}