summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2012-12-23 20:21:36 -0800
committerYehuda Katz <wycats@gmail.com>2012-12-23 20:21:36 -0800
commit070e12f76f251fc038956f61f132dec99a898cd2 (patch)
tree4f95c5221bd186781f9f359ec05f6f81ed33e0b5 /lib/handlebars/compiler/compiler.js
parent9385666e08ed86ddb10095ccfef9fa731adae16e (diff)
parent12f160fb313852f88d7745973124b830ad5f0422 (diff)
downloadhandlebars.js-070e12f76f251fc038956f61f132dec99a898cd2.zip
handlebars.js-070e12f76f251fc038956f61f132dec99a898cd2.tar.gz
handlebars.js-070e12f76f251fc038956f61f132dec99a898cd2.tar.bz2
Merge pull request #390 from eastridge/master
Make {data: true} a default compile option
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 1481098..57516a5 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -1040,7 +1040,9 @@ Handlebars.precompile = function(string, options) {
}
options = options || {};
-
+ if (!('data' in options)) {
+ options.data = true;
+ }
var ast = Handlebars.parse(string);
var environment = new Handlebars.Compiler().compile(ast, options);
return new Handlebars.JavaScriptCompiler().compile(environment, options);
@@ -1052,7 +1054,9 @@ Handlebars.compile = function(string, options) {
}
options = options || {};
-
+ if (!('data' in options)) {
+ options.data = true;
+ }
var compiled;
function compile() {
var ast = Handlebars.parse(string);