summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index 9f40792..247f5e0 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -248,7 +248,7 @@ JavaScriptCompiler.prototype = {
if (bufferStart) {
bufferStart.prepend('return ');
bufferEnd.add(';');
- } else {
+ } else if (!sourceSeen) {
this.source.push('return "";');
}
} else {
@@ -263,7 +263,7 @@ JavaScriptCompiler.prototype = {
}
if (varDeclarations) {
- this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n '));
+ this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
}
return this.source.merge();