Skip to content

Commit

Permalink
Upgrade to latest handlebars.js (4.7.7)
Browse files Browse the repository at this point in the history
Fixes #848.
  • Loading branch information
loganrosen committed Jun 14, 2021
1 parent 1d44be3 commit c21e68a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
Expand Up @@ -113,7 +113,7 @@ public class PrecompilePlugin extends HandlebarsPlugin {
/**
* The handlebars js file.
*/
@Parameter(defaultValue = "/handlebars-v4.7.6.js")
@Parameter(defaultValue = "/handlebars-v4.7.7.js")
private String handlebarsJsFile;

/**
Expand Down
Expand Up @@ -24,7 +24,7 @@ public void withAmdOutput() throws Exception {
plugin.addTemplate("c");
plugin.setAmd(true);
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();

Expand Down
Expand Up @@ -27,7 +27,7 @@ public void i18nJs() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/helpers-i18njs.js");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();

Expand All @@ -45,7 +45,7 @@ public void chooseSpecificFiles() throws Exception {
plugin.addTemplate("a");
plugin.addTemplate("c");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();

Expand All @@ -61,7 +61,7 @@ public void outputDirMustBeCreated() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/newdir/helpers.js");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();
}
Expand All @@ -73,7 +73,7 @@ public void missingHelperMustBeSilent() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/missing-helpers.js");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();
}
Expand All @@ -85,7 +85,7 @@ public void noFileMustBeCreatedIfNoTemplatesWereFound() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/no-helpers.js");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();

Expand Down Expand Up @@ -127,7 +127,7 @@ public void mustFailOnUnExpectedException() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/no-helpers.js");
plugin.setProject(project);
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();
}
Expand All @@ -139,7 +139,7 @@ public void fileWithRuntimeMustBeLargerThanNormalFiles() throws Exception {
withoutRT.setSuffix(".html");
withoutRT.setOutput("target/without-rt-helpers.js");
withoutRT.setProject(newProject());
withoutRT.setHandlebarsJsFile("/handlebars-v4.7.6.js");
withoutRT.setHandlebarsJsFile("/handlebars-v4.7.7.js");

withoutRT.execute();

Expand All @@ -149,7 +149,7 @@ public void fileWithRuntimeMustBeLargerThanNormalFiles() throws Exception {
withRT.setOutput("target/with-rt-helpers.js");
withRT.setRuntime("src/test/resources/handlebars.runtime.js");
withRT.setProject(newProject());
withRT.setHandlebarsJsFile("/handlebars-v4.7.6.js");
withRT.setHandlebarsJsFile("/handlebars-v4.7.7.js");

withRT.execute();

Expand All @@ -165,7 +165,7 @@ public void normalFileShouleBeLargerThanMinimizedFiles() throws Exception {
withoutRT.setSuffix(".html");
withoutRT.setOutput("target/helpers-normal.js");
withoutRT.setProject(newProject());
withoutRT.setHandlebarsJsFile("/handlebars-v4.7.6.js");
withoutRT.setHandlebarsJsFile("/handlebars-v4.7.7.js");

withoutRT.execute();

Expand All @@ -175,7 +175,7 @@ public void normalFileShouleBeLargerThanMinimizedFiles() throws Exception {
withRT.setOutput("target/helpers.min.js");
withRT.setMinimize(true);
withRT.setProject(newProject());
withRT.setHandlebarsJsFile("/handlebars-v4.7.6.js");
withRT.setHandlebarsJsFile("/handlebars-v4.7.7.js");
withRT.execute();

assertTrue("Normal file must be larger than minimized",
Expand All @@ -190,7 +190,7 @@ public void partials() throws Exception {
plugin.setSuffix(".html");
plugin.setOutput("target/helpers.js");
plugin.setProject(newProject());
plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
plugin.setHandlebarsJsFile("/handlebars-v4.7.7.js");

plugin.execute();

Expand Down
Expand Up @@ -371,10 +371,10 @@ public void setFormatters(final Formatter... formatters) {
*
* <pre>
* Handlebars handlebars = new Handlebars()
* .handlebarsJsFile("handlebars-v4.7.6.js");
* .handlebarsJsFile("handlebars-v4.7.7.js");
* </pre>
*
* Default handlebars.js is <code>handlebars-v4.7.6.js</code>.
* Default handlebars.js is <code>handlebars-v4.7.7.js</code>.
*
* @param location A classpath location of the handlebar.js file.
*/
Expand Down
Expand Up @@ -313,7 +313,7 @@ public static CharSequence escapeExpression(final CharSequence input) {
private String endDelimiter = DELIM_END;

/** Location of the handlebars.js file. */
private String handlebarsJsFile = "/handlebars-v4.7.6.js";
private String handlebarsJsFile = "/handlebars-v4.7.7.js";

/** List of formatters. */
private List<Formatter> formatters = new ArrayList<>();
Expand Down
@@ -1,7 +1,7 @@
/**!
@license
handlebars v4.7.6
handlebars v4.7.7
Copyright (C) 2011-2019 by Yehuda Katz
Expand Down Expand Up @@ -278,7 +278,7 @@ return /******/ (function(modules) { // webpackBootstrap

var _internalProtoAccess = __webpack_require__(33);

var VERSION = '4.7.6';
var VERSION = '4.7.7';
exports.VERSION = VERSION;
var COMPILER_REVISION = 8;
exports.COMPILER_REVISION = COMPILER_REVISION;
Expand Down Expand Up @@ -1525,7 +1525,7 @@ return /******/ (function(modules) { // webpackBootstrap
loc: loc
});
}
return obj[name];
return container.lookupProperty(obj, name);
},
lookupProperty: function lookupProperty(parent, propertyName) {
var result = parent[propertyName];
Expand Down Expand Up @@ -3903,7 +3903,7 @@ return /******/ (function(modules) { // webpackBootstrap
return this.internalNameLookup(parent, name);
},
depthedLookup: function depthedLookup(name) {
return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
},

compilerInfo: function compilerInfo() {
Expand Down
Expand Up @@ -25,7 +25,7 @@ public void v4_0_0() throws IOException {
+ " return \"Hi \"\n"
+ " + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"var\") || (depth0 != null ? lookupProperty(depth0,\"var\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"var\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":3},\"end\":{\"line\":1,\"column\":10}}}) : helper)))\n"
+ " + \"!\";\n"
+ "},\"useData\":true}", new Handlebars().handlebarsJsFile("/handlebars-v4.7.6.js")
+ "},\"useData\":true}", new Handlebars().handlebarsJsFile("/handlebars-v4.7.7.js")
.compileInline("Hi {{var}}!").toJavaScript());
}

Expand Down

0 comments on commit c21e68a

Please sign in to comment.