diff options
author | Alex Navasardyan <alex.navasardyan@yahoo.com> | 2013-10-04 14:28:05 -0400 |
---|---|---|
committer | Alex Navasardyan <alex.navasardyan@yahoo.com> | 2013-10-04 14:28:05 -0400 |
commit | 19f1a1f81d5e9cd6e95b72d322ce4f324e13eeec (patch) | |
tree | 25d7829663d2b7ddb17d0e9eb41d4b33710495d2 | |
parent | 386c20cc63054427656d7d5231702641801b6345 (diff) | |
download | handlebars.js-19f1a1f81d5e9cd6e95b72d322ce4f324e13eeec.zip handlebars.js-19f1a1f81d5e9cd6e95b72d322ce4f324e13eeec.tar.gz handlebars.js-19f1a1f81d5e9cd6e95b72d322ce4f324e13eeec.tar.bz2 |
fixing jshint errors
-rw-r--r-- | lib/handlebars/runtime.js | 21 | ||||
-rw-r--r-- | lib/index.js | 6 |
2 files changed, 14 insertions, 13 deletions
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index 55a5c6f..f984fe6 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -23,8 +23,9 @@ function checkRevision(compilerInfo) { // TODO: Remove this line and break up compilePartial export function template(templateSpec, Hbars, compile) { + var invokePartialWrapper; if (compile) { - var invokePartialWrapper = function(partial, name, context, helpers, partials, data) { + invokePartialWrapper = function(partial, name, context, helpers, partials, data) { // TODO : Check this for all inputs and the options handling (partial flag, etc). This feels // like there should be a common exec path var result = invokePartial.apply(this, arguments); @@ -35,7 +36,7 @@ export function template(templateSpec, Hbars, compile) { return partials[name](context, options); }; } else { - var invokePartialWrapper = function(partial, name, context, helpers, partials, data) { + invokePartialWrapper = function(partial, name, context, helpers, partials, data) { var result = invokePartial.apply(this, arguments); if (result) { return result; } throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); @@ -103,25 +104,25 @@ export function template(templateSpec, Hbars, compile) { export function programWithDepth(i, fn, data /*, $depth */) { var args = Array.prototype.slice.call(arguments, 3); - var program = function(context, options) { + var prog = function(context, options) { options = options || {}; return fn.apply(this, [context, options.data || data].concat(args)); }; - program.program = i; - program.depth = args.length; - return program; + prog.program = i; + prog.depth = args.length; + return prog; } export function program(i, fn, data) { - var program = function(context, options) { + var prog = function(context, options) { options = options || {}; return fn(context, options.data || data); }; - program.program = i; - program.depth = 0; - return program; + prog.program = i; + prog.depth = 0; + return prog; } export function invokePartial(partial, name, context, helpers, partials, data) { diff --git a/lib/index.js b/lib/index.js index 3a071b8..639435c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,16 +3,16 @@ // var local = handlebars.create(); -var Handlebars = require('../dist/cjs/handlebars').default; +var handlebars = require('../dist/cjs/handlebars').default; -module.exports = Handlebars; +module.exports = handlebars; // Publish a Node.js require() handler for .handlebars and .hbs files if (typeof require !== 'undefined' && require.extensions) { var extension = function(module, filename) { var fs = require("fs"); var templateString = fs.readFileSync(filename, "utf8"); - module.exports = Handlebars.compile(templateString); + module.exports = handlebars.compile(templateString); }; require.extensions[".handlebars"] = extension; require.extensions[".hbs"] = extension; |