From d559f21fc56a28292581e8f587fd4ef704d7421d Mon Sep 17 00:00:00 2001 From: Jeff Conrad Date: Tue, 2 Jun 2015 09:34:11 -0500 Subject: [PATCH] General javascript cleanup. Added semicolon for jslint. Added console test to be consistent with handlerbars.js. --- src/helpers.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 02c1cef..036d318 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -10,7 +10,7 @@ var isArray = function(value) { return Object.prototype.toString.call(value) === '[object Array]'; - } + }; var ExpressionRegistry = function() { this.expressions = []; @@ -92,16 +92,20 @@ }); Handlebars.registerHelper('log', function() { - console.log(['Values:'].concat( - Array.prototype.slice.call(arguments, 0, -1) - )); + if (typeof console !== 'undefined' && console.log) { + console.log(['Values:'].concat( + Array.prototype.slice.call(arguments, 0, -1) + )); + } }); Handlebars.registerHelper('debug', function() { - console.log('Context:', this); - console.log(['Values:'].concat( - Array.prototype.slice.call(arguments, 0, -1) - )); + if (typeof console !== 'undefined' && console.log) { + console.log('Context:', this); + console.log(['Values:'].concat( + Array.prototype.slice.call(arguments, 0, -1) + )); + } }); return eR;