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:
Yehuda Katz
2013-07-24 05:03:27 +00:00
parent da130f7745
commit f5c8484ea0
15 changed files with 129 additions and 79 deletions
+13 -4
View File
@@ -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);
}