Update logger for es6 modules

This commit is contained in:
kpdecker
2013-09-30 23:52:33 -05:00
parent 1173e5a502
commit 27d9010974
3 changed files with 12 additions and 18 deletions
+4 -13
View File
@@ -1,8 +1,8 @@
import { COMPILER_REVISION, REVISION_CHANGES } from "../base";
import { COMPILER_REVISION, REVISION_CHANGES, log } from "../base";
function Literal(value) {
this.value = value;
};
}
export function JavaScriptCompiler() {};
@@ -43,9 +43,7 @@ JavaScriptCompiler.prototype = {
this.environment = environment;
this.options = options || {};
// TODO: a module-compatible logger
// Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
log(this.environment.disassemble() + "\n\n");
log('debug', this.environment.disassemble() + "\n\n");
this.name = this.environment.name;
this.isChild = !!context;
@@ -167,11 +165,7 @@ JavaScriptCompiler.prototype = {
return Function.apply(this, params);
} else {
var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + source + '}';
// TODO: a module-compatible logger
//Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
log(functionSource + "\n\n");
log('debug', functionSource + "\n\n");
return functionSource;
}
},
@@ -847,6 +841,3 @@ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
return false;
};
function log(string) {
//console.log(string);
}