summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2013-07-24 05:03:27 +0000
committerYehuda Katz <wycats@gmail.com>2013-07-24 05:03:27 +0000
commitf5c8484ea0c1ac1aec6994ad3b5928fb67b7aa62 (patch)
tree8e92df6cccab8ff4da78c11d90d4e534a19374b8 /lib/handlebars/compiler/javascript-compiler.js
parentda130f7745fc338d7ea31c60d9954ab6e0e1511a (diff)
downloadhandlebars.js-f5c8484ea0c1ac1aec6994ad3b5928fb67b7aa62.zip
handlebars.js-f5c8484ea0c1ac1aec6994ad3b5928fb67b7aa62.tar.gz
handlebars.js-f5c8484ea0c1ac1aec6994ad3b5928fb67b7aa62.tar.bz2
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.
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index f5d70ee..a416431 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -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);
+}