summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorMarcio Junior <marciojunior_eu@yahoo.com.br>2015-02-07 18:23:03 -0200
committerMarcio Junior <marciojunior_eu@yahoo.com.br>2015-02-08 19:31:38 -0200
commit5cc326d42554da8a00c69d8a8c6a71e3e6a61371 (patch)
treee8949aa270219d6bcb3861d397e3192bc7260d0f /lib/handlebars/compiler/compiler.js
parentf857471cc8dd8dca301cd78bfef03bd774b5d4c2 (diff)
downloadhandlebars.js-5cc326d42554da8a00c69d8a8c6a71e3e6a61371.zip
handlebars.js-5cc326d42554da8a00c69d8a8c6a71e3e6a61371.tar.gz
handlebars.js-5cc326d42554da8a00c69d8a8c6a71e3e6a61371.tar.bz2
Test compilation of literal values in mustaches
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 03bf8f4..75b2c1b 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -172,7 +172,11 @@ Compiler.prototype = {
},
MustacheStatement: function(mustache) {
- this.SubExpression(mustache);
+ if (!mustache.path.type.match(/Literal$/)) {
+ this.SubExpression(mustache);
+ } else {
+ this.accept(mustache.path);
+ }
if(mustache.escaped && !this.options.noEscape) {
this.opcode('appendEscaped');