diff options
author | kpdecker <kpdecker@gmail.com> | 2014-07-12 13:48:06 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-08-11 20:10:12 -0500 |
commit | f4af8e06b68be0a46ffbefe139b1ce8bd25660c8 (patch) | |
tree | 650329d44dd5e7d492a2132456e345c3549d544b | |
parent | 63c5eb7a82802b2e955c6e8423000c9db3fec1a7 (diff) | |
download | handlebars.js-f4af8e06b68be0a46ffbefe139b1ce8bd25660c8.zip handlebars.js-f4af8e06b68be0a46ffbefe139b1ce8bd25660c8.tar.gz handlebars.js-f4af8e06b68be0a46ffbefe139b1ce8bd25660c8.tar.bz2 |
Allow compat flag in test specs
-rw-r--r-- | spec/env/common.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/env/common.js b/spec/env/common.js index 45687ba..03eef93 100644 --- a/spec/env/common.js +++ b/spec/env/common.js @@ -1,3 +1,4 @@ +/*global CompilerContext, compileWithPartials, shouldCompileToWithPartials */ global.shouldCompileTo = function(string, hashOrArray, expected, message) { shouldCompileToWithPartials(string, hashOrArray, false, expected, message); }; @@ -10,15 +11,19 @@ global.shouldCompileToWithPartials = function(string, hashOrArray, partials, exp }; global.compileWithPartials = function(string, hashOrArray, partials) { - var template = CompilerContext[partials ? 'compileWithPartial' : 'compile'](string), ary; + var template, + ary, + options; if(Object.prototype.toString.call(hashOrArray) === "[object Array]") { ary = []; ary.push(hashOrArray[0]); - ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2] }); + ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2], compat: hashOrArray[3] }); + options = {compat: hashOrArray[3]}; } else { ary = [hashOrArray]; } + template = CompilerContext[partials ? 'compileWithPartial' : 'compile'](string, options); return template.apply(this, ary); }; |