Further progress towards modularization.
At this point, I have only 2 fails in the Node build, but I'm doing a bunch of manual stuff locally and still have a bunch of hacks.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { COMPILER_REVISION, REVISION_CHANGES } from "handlebars/base";
|
||||
import { COMPILER_REVISION, REVISION_CHANGES } from "../base";
|
||||
|
||||
function Literal(value) {
|
||||
this.value = value;
|
||||
};
|
||||
|
||||
|
||||
export function JavaScriptCompiler() {};
|
||||
|
||||
JavaScriptCompiler.prototype = {
|
||||
@@ -44,7 +43,9 @@ JavaScriptCompiler.prototype = {
|
||||
this.environment = environment;
|
||||
this.options = options || {};
|
||||
|
||||
Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
|
||||
// TODO: a module-compatible logger
|
||||
// Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
|
||||
log(this.environment.disassemble() + "\n\n");
|
||||
|
||||
this.name = this.environment.name;
|
||||
this.isChild = !!context;
|
||||
@@ -166,7 +167,11 @@ JavaScriptCompiler.prototype = {
|
||||
return Function.apply(this, params);
|
||||
} else {
|
||||
var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + source + '}';
|
||||
Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
|
||||
|
||||
// TODO: a module-compatible logger
|
||||
//Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
|
||||
log(functionSource + "\n\n");
|
||||
|
||||
return functionSource;
|
||||
}
|
||||
},
|
||||
@@ -841,3 +846,7 @@ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function log(string) {
|
||||
//console.log(string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user