summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/code-gen.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-19 08:27:13 -0700
committerkpdecker <kpdecker@gmail.com>2015-08-22 10:59:34 -0700
commit452afbf2ffdf32a6d7112b727cc95cc6b415e8a5 (patch)
treec24b4162e48c3de66c36d7160530cab710e77d24 /lib/handlebars/compiler/code-gen.js
parent408192ba9f262bb82be88091ab3ec3c16dc02c6d (diff)
downloadhandlebars.js-452afbf2ffdf32a6d7112b727cc95cc6b415e8a5.zip
handlebars.js-452afbf2ffdf32a6d7112b727cc95cc6b415e8a5.tar.gz
handlebars.js-452afbf2ffdf32a6d7112b727cc95cc6b415e8a5.tar.bz2
Implement block decorators
These allow for a given block to be wrapped in helper methods or metadata and allow for more control over the current container and method before the code is run.
Diffstat (limited to 'lib/handlebars/compiler/code-gen.js')
-rw-r--r--lib/handlebars/compiler/code-gen.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js
index 3af4f8c..6541fe8 100644
--- a/lib/handlebars/compiler/code-gen.js
+++ b/lib/handlebars/compiler/code-gen.js
@@ -69,6 +69,9 @@ function CodeGen(srcFile) {
}
CodeGen.prototype = {
+ isEmpty() {
+ return !this.source.length;
+ },
prepend: function(source, loc) {
this.source.unshift(this.wrap(source, loc));
},