From 60670fc036e3f0d3d81b0ae8ba660822bdc1346c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 13 Oct 2015 02:09:44 +0300 Subject: [PATCH] Update test files. --- test/expected/amd_compile.js | 8 ++-- test/expected/amd_compile_array.js | 8 ++-- test/expected/amd_compile_direct.js | 8 ++-- test/expected/amd_compile_function.js | 4 +- test/expected/amd_compile_string_deps.js | 8 ++-- test/expected/amd_compile_string_path.js | 8 ++-- test/expected/amd_namespace.js | 8 ++-- test/expected/amd_namespace_as_function.js | 14 +++---- test/expected/amd_partials_no_namespace.js | 8 ++-- test/expected/amd_partials_use_namespace.js | 8 ++-- test/expected/commonjs_compile.js | 8 ++-- test/expected/commonjs_compile_direct.js | 8 ++-- test/expected/custom_separator.js | 6 +-- test/expected/handlebars-node.js | 38 +++++++------------ test/expected/handlebars.js | 38 +++++++------------ test/expected/handlebarsnowrap.js | 14 +++---- test/expected/known_helpers.js | 10 ++--- test/expected/namespace_as_function.js | 13 +++---- test/expected/no_namespace.js | 6 +-- test/expected/ns_nested.js | 6 +-- test/expected/ns_nested_this.js | 11 ++---- test/expected/only_known_helpers.js | 10 ++--- test/expected/partial_regex.js | 38 +++++++------------ test/expected/partials_path_regex.js | 8 ++-- test/expected/partials_use_namespace.js | 8 ++-- ...rtials_use_namespace_multiple_templates.js | 10 ++--- test/expected/process_ast.js | 12 +++--- test/expected/process_partial_name.js | 38 +++++++------------ test/expected/processcontent.js | 11 ++---- test/expected/processname.js | 6 +-- test/expected/uglyfile.js | 11 ++---- test/expected/unknown_helpers.js | 10 ++--- 32 files changed, 168 insertions(+), 234 deletions(-) diff --git a/test/expected/amd_compile.js b/test/expected/amd_compile.js index 5a70c78..dd1ffe1 100644 --- a/test/expected/amd_compile.js +++ b/test/expected/amd_compile.js @@ -2,10 +2,10 @@ define(['handlebars'], function(Handlebars) { this["JST"] = this["JST"] || {}; -this["JST"]["test/fixtures/amd.html"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}); +this["JST"]["test/fixtures/amd.html"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}); return this["JST"]; -}); +}); \ No newline at end of file diff --git a/test/expected/amd_compile_array.js b/test/expected/amd_compile_array.js index a03728a..892dff5 100644 --- a/test/expected/amd_compile_array.js +++ b/test/expected/amd_compile_array.js @@ -1,7 +1,7 @@ define(['handlebars', 'handlebars.helpers'], function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}) +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}) -}); +}); \ No newline at end of file diff --git a/test/expected/amd_compile_direct.js b/test/expected/amd_compile_direct.js index b9e26e0..ec17e62 100644 --- a/test/expected/amd_compile_direct.js +++ b/test/expected/amd_compile_direct.js @@ -1,7 +1,7 @@ define(['handlebars'], function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}) +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}) -}); +}); \ No newline at end of file diff --git a/test/expected/amd_compile_function.js b/test/expected/amd_compile_function.js index 8c6fec5..1964bfe 100644 --- a/test/expected/amd_compile_function.js +++ b/test/expected/amd_compile_function.js @@ -1,7 +1,7 @@ define(['handlebars', 'custom dependency'], function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "
\n

Some title

\n

I've been compiled with amd support

\n
"; },"useData":true}) -}); +}); \ No newline at end of file diff --git a/test/expected/amd_compile_string_deps.js b/test/expected/amd_compile_string_deps.js index a03728a..892dff5 100644 --- a/test/expected/amd_compile_string_deps.js +++ b/test/expected/amd_compile_string_deps.js @@ -1,7 +1,7 @@ define(['handlebars', 'handlebars.helpers'], function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}) +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}) -}); +}); \ No newline at end of file diff --git a/test/expected/amd_compile_string_path.js b/test/expected/amd_compile_string_path.js index 9fa8186..b5a9cd6 100644 --- a/test/expected/amd_compile_string_path.js +++ b/test/expected/amd_compile_string_path.js @@ -1,7 +1,7 @@ define(['lib/handlebars'], function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}) +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}) -}); +}); \ No newline at end of file diff --git a/test/expected/amd_namespace.js b/test/expected/amd_namespace.js index d994a92..496e906 100644 --- a/test/expected/amd_namespace.js +++ b/test/expected/amd_namespace.js @@ -2,10 +2,10 @@ define(['handlebars', 'handlebars.helpers'], function(Handlebars) { this["foo"] = this["foo"] || {}; -this["foo"]["test/fixtures/amd.html"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with amd support

\n
"; - },"useData":true}); +this["foo"]["test/fixtures/amd.html"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with amd support

\n
"; +},"useData":true}); return this["foo"]; -}); +}); \ No newline at end of file diff --git a/test/expected/amd_namespace_as_function.js b/test/expected/amd_namespace_as_function.js index 2d2adeb..61a79b6 100644 --- a/test/expected/amd_namespace_as_function.js +++ b/test/expected/amd_namespace_as_function.js @@ -6,14 +6,14 @@ this["JST"]["countries"] = this["JST"]["countries"] || {}; this["JST"]["treeNav"] = this["JST"]["treeNav"] || {}; this["JST"]["treeNav"]["leaves"] = this["JST"]["treeNav"]["leaves"] || {}; -this["JST"]["countries"]["basic"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"]["countries"]["basic"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); -this["JST"]["treeNav"]["leaves"]["basic"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"]["treeNav"]["leaves"]["basic"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); return this["JST"]; -}); +}); \ No newline at end of file diff --git a/test/expected/amd_partials_no_namespace.js b/test/expected/amd_partials_no_namespace.js index 0dce1d6..eed23d3 100644 --- a/test/expected/amd_partials_no_namespace.js +++ b/test/expected/amd_partials_no_namespace.js @@ -2,15 +2,15 @@ define(['handlebars'], function(Handlebars) { this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "Canada"; },"useData":true})); -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; @@ -18,4 +18,4 @@ this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0 return this["JST"]; -}); +}); \ No newline at end of file diff --git a/test/expected/amd_partials_use_namespace.js b/test/expected/amd_partials_use_namespace.js index 7b30246..90e7679 100644 --- a/test/expected/amd_partials_use_namespace.js +++ b/test/expected/amd_partials_use_namespace.js @@ -2,15 +2,15 @@ define(['handlebars'], function(Handlebars) { this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "Canada"; },"useData":true})); -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; @@ -18,4 +18,4 @@ this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0 return this["JST"]; -}); +}); \ No newline at end of file diff --git a/test/expected/commonjs_compile.js b/test/expected/commonjs_compile.js index ebcf5e4..6add1b4 100644 --- a/test/expected/commonjs_compile.js +++ b/test/expected/commonjs_compile.js @@ -2,10 +2,10 @@ module.exports = function(Handlebars) { this["JST"] = this["JST"] || {}; -this["JST"]["test/fixtures/commonjs.html"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with CommonJS support

\n
\n"; - },"useData":true}); +this["JST"]["test/fixtures/commonjs.html"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with CommonJS support

\n
\n"; +},"useData":true}); return this["JST"]; -}; +}; \ No newline at end of file diff --git a/test/expected/commonjs_compile_direct.js b/test/expected/commonjs_compile_direct.js index e127b7c..ee8a6ea 100644 --- a/test/expected/commonjs_compile_direct.js +++ b/test/expected/commonjs_compile_direct.js @@ -1,7 +1,7 @@ module.exports = function(Handlebars) { -return Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\n

Some title

\n

I've been compiled with CommonJS support

\n
\n"; - },"useData":true}); +return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\n

Some title

\n

I've been compiled with CommonJS support

\n
\n"; +},"useData":true}); -}; +}; \ No newline at end of file diff --git a/test/expected/custom_separator.js b/test/expected/custom_separator.js index 920d25c..99230db 100644 --- a/test/expected/custom_separator.js +++ b/test/expected/custom_separator.js @@ -1,3 +1,3 @@ -this["JST"] = this["JST"] || {};;;;;;this["JST"]["test/fixtures/basic.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"] = this["JST"] || {};;;;;;this["JST"]["test/fixtures/basic.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/handlebars-node.js b/test/expected/handlebars-node.js index 0021cc8..1f7151f 100644 --- a/test/expected/handlebars-node.js +++ b/test/expected/handlebars-node.js @@ -4,30 +4,18 @@ Handlebars = glob.Handlebars || require('handlebars'); this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Canada"; - })); - -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; - var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; - - - buffer += "

Hello, my name is "; - if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } - else { stack1 = (depth0 && depth0.name); stack1 = typeof stack1 === functionType ? stack1.call(depth0, {hash:{},data:data}) : stack1; } - buffer += escapeExpression(stack1) - + ". I live in "; - stack1 = self.invokePartial(partials.partial, 'partial', depth0, helpers, partials, data); - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "

"; - return buffer; - }); +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Canada"; +},"useData":true})); + +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper; + + return "

Hello, my name is " + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ". I live in " + + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + "

"; +},"usePartial":true,"useData":true}); if (typeof exports === 'object' && exports) {module.exports = this["JST"];} \ No newline at end of file diff --git a/test/expected/handlebars.js b/test/expected/handlebars.js index 12bca2d..5c41805 100644 --- a/test/expected/handlebars.js +++ b/test/expected/handlebars.js @@ -1,27 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Canada"; - })); - -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; - var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; - - - buffer += "

Hello, my name is "; - if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } - else { stack1 = (depth0 && depth0.name); stack1 = typeof stack1 === functionType ? stack1.call(depth0, {hash:{},data:data}) : stack1; } - buffer += escapeExpression(stack1) - + ". I live in "; - stack1 = self.invokePartial(partials.partial, 'partial', depth0, helpers, partials, data); - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "

"; - return buffer; - }); \ No newline at end of file +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Canada"; +},"useData":true})); + +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper; + + return "

Hello, my name is " + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ". I live in " + + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + "

"; +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/handlebarsnowrap.js b/test/expected/handlebarsnowrap.js index 071c43d..8678d54 100644 --- a/test/expected/handlebarsnowrap.js +++ b/test/expected/handlebarsnowrap.js @@ -1,15 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", {"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Canada"; - },"useData":true}); +Handlebars.registerPartial("partial", {"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Canada"; +},"useData":true}); -this["JST"]["test/fixtures/one.hbs"] = {"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = {"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; - + return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; -},"usePartial":true,"useData":true}; +},"usePartial":true,"useData":true}; \ No newline at end of file diff --git a/test/expected/known_helpers.js b/test/expected/known_helpers.js index 740f627..7fac5ed 100644 --- a/test/expected/known_helpers.js +++ b/test/expected/known_helpers.js @@ -2,13 +2,13 @@ this["JST"] = this["JST"] || {}; this["JST"]["test/fixtures/uses_helpers.hbs"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { return ""; -},"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, options, buffer = +},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, buffer = "This template uses custom helpers: " - + container.escapeExpression(helpers["my-helper"].call(depth0,"variable",{"name":"my-helper","hash":{},"data":data})) + + container.escapeExpression(helpers["my-helper"].call(alias1,"variable",{"name":"my-helper","hash":{},"data":data})) + " & "; - stack1 = ((helper = (helper = helpers["another-helper"] || (depth0 != null ? depth0["another-helper"] : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0,options) : helper)); + stack1 = ((helper = (helper = helpers["another-helper"] || (depth0 != null ? depth0["another-helper"] : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper)); if (!helpers["another-helper"]) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)} if (stack1 != null) { buffer += stack1; } return buffer + "!\n"; -},"useData":true}); +},"useData":true}); \ No newline at end of file diff --git a/test/expected/namespace_as_function.js b/test/expected/namespace_as_function.js index 91e9440..37a350a 100644 --- a/test/expected/namespace_as_function.js +++ b/test/expected/namespace_as_function.js @@ -4,11 +4,10 @@ this["JST"]["countries"] = this["JST"]["countries"] || {}; this["JST"]["treeNav"] = this["JST"]["treeNav"] || {}; this["JST"]["treeNav"]["leaves"] = this["JST"]["treeNav"]["leaves"] || {}; -this["JST"]["countries"]["basic"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"]["countries"]["basic"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); - -this["JST"]["treeNav"]["leaves"]["basic"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"]["treeNav"]["leaves"]["basic"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/no_namespace.js b/test/expected/no_namespace.js index d175f30..951684f 100644 --- a/test/expected/no_namespace.js +++ b/test/expected/no_namespace.js @@ -1,3 +1,3 @@ -Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}) +Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}) \ No newline at end of file diff --git a/test/expected/ns_nested.js b/test/expected/ns_nested.js index 23f8f33..e00d20e 100644 --- a/test/expected/ns_nested.js +++ b/test/expected/ns_nested.js @@ -2,6 +2,6 @@ this["MyApp"] = this["MyApp"] || {}; this["MyApp"]["JST"] = this["MyApp"]["JST"] || {}; this["MyApp"]["JST"]["Main"] = this["MyApp"]["JST"]["Main"] || {}; -this["MyApp"]["JST"]["Main"]["test/fixtures/basic.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["MyApp"]["JST"]["Main"]["test/fixtures/basic.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/ns_nested_this.js b/test/expected/ns_nested_this.js index 4c0cf77..e00d20e 100644 --- a/test/expected/ns_nested_this.js +++ b/test/expected/ns_nested_this.js @@ -2,11 +2,6 @@ this["MyApp"] = this["MyApp"] || {}; this["MyApp"]["JST"] = this["MyApp"]["JST"] || {}; this["MyApp"]["JST"]["Main"] = this["MyApp"]["JST"]["Main"] || {}; -this["MyApp"]["JST"]["Main"]["test/fixtures/basic.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Basic template that does nothing."; - }); \ No newline at end of file +this["MyApp"]["JST"]["Main"]["test/fixtures/basic.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/only_known_helpers.js b/test/expected/only_known_helpers.js index 0771417..c125390 100644 --- a/test/expected/only_known_helpers.js +++ b/test/expected/only_known_helpers.js @@ -2,12 +2,12 @@ this["JST"] = this["JST"] || {}; this["JST"]["test/fixtures/uses_helpers.hbs"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { return ""; -},"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; +},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, alias1=depth0 != null ? depth0 : {}; return "This template uses custom helpers: " - + container.escapeExpression(helpers["my-helper"].call(depth0,"variable",{"name":"my-helper","hash":{},"data":data})) + + container.escapeExpression(helpers["my-helper"].call(alias1,"variable",{"name":"my-helper","hash":{},"data":data})) + " & " - + ((stack1 = helpers["another-helper"].call(depth0,{"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["another-helper"].call(alias1,{"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "!\n"; -},"useData":true}); +},"useData":true}); \ No newline at end of file diff --git a/test/expected/partial_regex.js b/test/expected/partial_regex.js index 12bca2d..5c41805 100644 --- a/test/expected/partial_regex.js +++ b/test/expected/partial_regex.js @@ -1,27 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Canada"; - })); - -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; - var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; - - - buffer += "

Hello, my name is "; - if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } - else { stack1 = (depth0 && depth0.name); stack1 = typeof stack1 === functionType ? stack1.call(depth0, {hash:{},data:data}) : stack1; } - buffer += escapeExpression(stack1) - + ". I live in "; - stack1 = self.invokePartial(partials.partial, 'partial', depth0, helpers, partials, data); - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "

"; - return buffer; - }); \ No newline at end of file +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Canada"; +},"useData":true})); + +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper; + + return "

Hello, my name is " + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ". I live in " + + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + "

"; +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/partials_path_regex.js b/test/expected/partials_path_regex.js index b067a38..5c41805 100644 --- a/test/expected/partials_path_regex.js +++ b/test/expected/partials_path_regex.js @@ -1,15 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "Canada"; },"useData":true})); -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; -},"usePartial":true,"useData":true}); +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/partials_use_namespace.js b/test/expected/partials_use_namespace.js index 9a34874..2a70f7c 100644 --- a/test/expected/partials_use_namespace.js +++ b/test/expected/partials_use_namespace.js @@ -1,15 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "Canada"; },"useData":true})); -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; -},"usePartial":true,"useData":true}); +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/partials_use_namespace_multiple_templates.js b/test/expected/partials_use_namespace_multiple_templates.js index 4237b2e..7eae183 100644 --- a/test/expected/partials_use_namespace_multiple_templates.js +++ b/test/expected/partials_use_namespace_multiple_templates.js @@ -1,19 +1,19 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial("partial", this["JST"]["partial"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "Canada"; },"useData":true})); -this["JST"]["test/fixtures/has-spaces.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/has-spaces.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "\n\n
\n this template has many spaces\n
\n"; },"useData":true}); -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper; return "

Hello, my name is " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + ". I live in " + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + "

"; -},"usePartial":true,"useData":true}); +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/process_ast.js b/test/expected/process_ast.js index 9e7fc1d..8ba06ac 100644 --- a/test/expected/process_ast.js +++ b/test/expected/process_ast.js @@ -1,11 +1,9 @@ this["JST"] = this["JST"] || {}; -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper; +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; return "

Hello, my name is " - + this.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) - + ". I live in " - + ((stack1 = this.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials})) != null ? stack1 : "") - + "

"; -},"usePartial":true,"useData":true}); + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ". I live in Fooville

"; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/process_partial_name.js b/test/expected/process_partial_name.js index 12bca2d..5c41805 100644 --- a/test/expected/process_partial_name.js +++ b/test/expected/process_partial_name.js @@ -1,27 +1,15 @@ this["JST"] = this["JST"] || {}; -Handlebars.registerPartial("partial", Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Canada"; - })); - -this["JST"]["test/fixtures/one.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; - var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; - - - buffer += "

Hello, my name is "; - if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } - else { stack1 = (depth0 && depth0.name); stack1 = typeof stack1 === functionType ? stack1.call(depth0, {hash:{},data:data}) : stack1; } - buffer += escapeExpression(stack1) - + ". I live in "; - stack1 = self.invokePartial(partials.partial, 'partial', depth0, helpers, partials, data); - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "

"; - return buffer; - }); \ No newline at end of file +Handlebars.registerPartial("partial", Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Canada"; +},"useData":true})); + +this["JST"]["test/fixtures/one.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper; + + return "

Hello, my name is " + + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"name","hash":{},"data":data}) : helper))) + + ". I live in " + + ((stack1 = container.invokePartial(partials.partial,depth0,{"name":"partial","data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") + + "

"; +},"usePartial":true,"useData":true}); \ No newline at end of file diff --git a/test/expected/processcontent.js b/test/expected/processcontent.js index bbf98f9..de552d7 100644 --- a/test/expected/processcontent.js +++ b/test/expected/processcontent.js @@ -1,10 +1,5 @@ this["JST"] = this["JST"] || {}; -this["JST"]["test/fixtures/has-spaces.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "
\nthis template has many spaces\n
"; - }); \ No newline at end of file +this["JST"]["test/fixtures/has-spaces.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "
\nthis template has many spaces\n
"; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/processname.js b/test/expected/processname.js index e3730fd..ca64033 100644 --- a/test/expected/processname.js +++ b/test/expected/processname.js @@ -1,5 +1,5 @@ this["JST"] = this["JST"] || {}; -this["JST"]["TEST/FIXTURES/BASIC.HBS"] = Handlebars.template({"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "Basic template that does nothing."; - },"useData":true}); +this["JST"]["TEST/FIXTURES/BASIC.HBS"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Basic template that does nothing."; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/uglyfile.js b/test/expected/uglyfile.js index e5d7e14..56e7148 100644 --- a/test/expected/uglyfile.js +++ b/test/expected/uglyfile.js @@ -1,10 +1,5 @@ this["JST"] = this["JST"] || {}; -this["JST"]["test/fixtures/it's-a-bad-filename.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { - this.compilerInfo = [4,'>= 1.0.0']; -helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; - - - - return "Why would you name your file like this?"; - }); \ No newline at end of file +this["JST"]["test/fixtures/it's-a-bad-filename.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return "Why would you name your file like this?"; +},"useData":true}); \ No newline at end of file diff --git a/test/expected/unknown_helpers.js b/test/expected/unknown_helpers.js index 54f5086..0abbf91 100644 --- a/test/expected/unknown_helpers.js +++ b/test/expected/unknown_helpers.js @@ -2,13 +2,13 @@ this["JST"] = this["JST"] || {}; this["JST"]["test/fixtures/uses_helpers.hbs"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { return ""; -},"compiler":[7,">=4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, options, alias1=helpers.helperMissing, buffer = +},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, buffer = "This template uses custom helpers: " - + container.escapeExpression((helpers["my-helper"] || (depth0 && depth0["my-helper"]) || alias1).call(depth0,"variable",{"name":"my-helper","hash":{},"data":data})) + + container.escapeExpression((helpers["my-helper"] || (depth0 && depth0["my-helper"]) || alias2).call(alias1,"variable",{"name":"my-helper","hash":{},"data":data})) + " & "; - stack1 = ((helper = (helper = helpers["another-helper"] || (depth0 != null ? depth0["another-helper"] : depth0)) != null ? helper : alias1),(options={"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(depth0,options) : helper)); + stack1 = ((helper = (helper = helpers["another-helper"] || (depth0 != null ? depth0["another-helper"] : depth0)) != null ? helper : alias2),(options={"name":"another-helper","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper)); if (!helpers["another-helper"]) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)} if (stack1 != null) { buffer += stack1; } return buffer + "!\n"; -},"useData":true}); +},"useData":true}); \ No newline at end of file