summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/handlebars/base.js3
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js6
-rw-r--r--lib/handlebars/runtime.js1
-rw-r--r--lib/handlebars/utils.js4
-rw-r--r--lib/index.js1
5 files changed, 9 insertions, 6 deletions
diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js
index 022417b..4eac7e9 100644
--- a/lib/handlebars/base.js
+++ b/lib/handlebars/base.js
@@ -67,7 +67,8 @@ function registerDefaultHelpers(instance) {
});
instance.registerHelper('blockHelperMissing', function(context, options) {
- var inverse = options.inverse || function() {}, fn = options.fn;
+ var inverse = options.inverse,
+ fn = options.fn;
if (isFunction(context)) { context = context.call(this); }
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index ef02cc7..d52f2a0 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -99,6 +99,7 @@ JavaScriptCompiler.prototype = {
// Flush any trailing content that might be pending.
this.pushSource('');
+ /* istanbul ignore next */
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
throw new Exception('Compile completed with content left on stack');
}
@@ -551,10 +552,6 @@ JavaScriptCompiler.prototype = {
var helper = this.setupHelper(paramSize, name);
var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing';
- if (helper.paramsInit) {
- lookup += ',' + helper.paramsInit;
- }
-
this.push('((' + lookup + ').call(' + helper.callParams + '))');
// Always flush subexpressions. This is both to prevent the compounding size issue that
@@ -849,6 +846,7 @@ JavaScriptCompiler.prototype = {
return item.value;
} else {
if (!inline) {
+ /* istanbul ignore next */
if (!this.stackSlot) {
throw new Exception('Invalid stack pop');
}
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js
index bfdb3b4..d351918 100644
--- a/lib/handlebars/runtime.js
+++ b/lib/handlebars/runtime.js
@@ -23,6 +23,7 @@ export function checkRevision(compilerInfo) {
// TODO: Remove this line and break up compilePartial
export function template(templateSpec, env) {
+ /* istanbul ignore next */
if (!env) {
throw new Exception("No environment passed to template");
}
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index f2f1a54..087183e 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -14,7 +14,7 @@ var badChars = /[&<>"'`]/g;
var possible = /[&<>"'`]/;
function escapeChar(chr) {
- return escape[chr] || "&amp;";
+ return escape[chr];
}
export function extend(obj /* , ...source */) {
@@ -37,6 +37,7 @@ var isFunction = function(value) {
return typeof value === 'function';
};
// fallback for older versions of Chrome and Safari
+/* istanbul ignore next */
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value === 'function' && toString.call(value) === '[object Function]';
@@ -44,6 +45,7 @@ if (isFunction(/x/)) {
}
export var isFunction;
+/* istanbul ignore next */
export var isArray = Array.isArray || function(value) {
return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
};
diff --git a/lib/index.js b/lib/index.js
index e150524..790aab7 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -14,6 +14,7 @@ handlebars.print = printer.print;
module.exports = handlebars;
// Publish a Node.js require() handler for .handlebars and .hbs files
+/* istanbul ignore else */
if (typeof require !== 'undefined' && require.extensions) {
var extension = function(module, filename) {
var fs = require("fs");