Update logger for es6 modules
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user