@@ -308,7 +308,7 @@ JavaScriptCompiler.prototype = {
|
|||||||
|
|
||||||
if (appendOnly) {
|
if (appendOnly) {
|
||||||
if (bufferStart) {
|
if (bufferStart) {
|
||||||
bufferStart.prepend('return ');
|
bufferStart.prepend('return "" + ');
|
||||||
bufferEnd.add(';');
|
bufferEnd.add(';');
|
||||||
} else if (!sourceSeen) {
|
} else if (!sourceSeen) {
|
||||||
this.source.push('return "";');
|
this.source.push('return "";');
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ describe('javascript-compiler api', function() {
|
|||||||
.toCompileTo('food');
|
.toCompileTo('food');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#compilerInfo', function() {
|
describe('#compilerInfo', function() {
|
||||||
var $superCheck, $superInfo;
|
var $superCheck, $superInfo;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@@ -58,6 +59,7 @@ describe('javascript-compiler api', function() {
|
|||||||
.toCompileTo('food ');
|
.toCompileTo('food ');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('buffer', function() {
|
describe('buffer', function() {
|
||||||
var $superAppend, $superCreate;
|
var $superAppend, $superCreate;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@@ -116,4 +118,23 @@ describe('javascript-compiler api', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('options', function() {
|
||||||
|
it('should append `noEscape` statements as string', function() {
|
||||||
|
expectTemplate('{{a}}{{b}}')
|
||||||
|
.withCompileOptions({ noEscape: true })
|
||||||
|
.withInput({ a: 1, b: 1 })
|
||||||
|
.toCompileTo('11');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should append `noEscape` statements as string in a block', function() {
|
||||||
|
expectTemplate('{{#block}}{{a}}{{b}}{{/block}}')
|
||||||
|
.withCompileOptions({ noEscape: true })
|
||||||
|
.withHelper('block', function(options) {
|
||||||
|
return options.fn(this);
|
||||||
|
})
|
||||||
|
.withInput({ a: 1, b: 1 })
|
||||||
|
.toCompileTo('11');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user