fixing jshint errors
This commit is contained in:
+11
-10
@@ -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) {
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user