diff options
author | kpdecker <kpdecker@gmail.com> | 2014-12-01 01:32:41 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-12-16 12:57:46 -0600 |
commit | 203df9d5b7cdd6eb9543c0544f08f37e1a77a223 (patch) | |
tree | 1c0879b7ddc7c8af711aa1a30f0bc5556afedaa9 | |
parent | 0d396ccd30b51d3c5ffb7fb3e79670d89b610163 (diff) | |
download | handlebars.js-203df9d5b7cdd6eb9543c0544f08f37e1a77a223.zip handlebars.js-203df9d5b7cdd6eb9543c0544f08f37e1a77a223.tar.gz handlebars.js-203df9d5b7cdd6eb9543c0544f08f37e1a77a223.tar.bz2 |
Remove unused vars and add jshint checking
-rw-r--r-- | .jshintrc | 1 | ||||
-rw-r--r-- | lib/handlebars/compiler/ast.js | 2 | ||||
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 4 | ||||
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 1 | ||||
-rw-r--r-- | lib/handlebars/compiler/printer.js | 2 | ||||
-rw-r--r-- | lib/handlebars/compiler/visitor.js | 1 | ||||
-rw-r--r-- | lib/handlebars/utils.js | 2 | ||||
-rw-r--r-- | lib/precompiler.js | 1 |
8 files changed, 4 insertions, 10 deletions
@@ -45,6 +45,7 @@ "plusplus": false, "regexp": false, "undef": true, + "unused": true, "sub": true, "strict": false, "white": false diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index 0020216..3f4639c 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -1,5 +1,3 @@ -import Exception from "../exception"; - var AST = { Program: function(statements, blockParams, strip, locInfo) { this.loc = locInfo; diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 71e0ccf..2c0bd08 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -18,8 +18,6 @@ function scopedId(path) { // an ID is simple if it only has one part, and that part is not // `..` or `this`. function simpleId(path) { - var part = path.parts[0]; - return path.parts.length === 1 && !scopedId(path) && !path.depth; } @@ -93,7 +91,7 @@ Compiler.prototype = { compileProgram: function(program) { var result = new this.compiler().compile(program, this.options); - var guid = this.guid++, depth; + var guid = this.guid++; this.usePartial = this.usePartial || result.usePartial; diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index dfe2df1..356424b 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -755,7 +755,6 @@ JavaScriptCompiler.prototype = { replaceStack: function(callback) { var prefix = ['('], - inline = this.isInline(), stack, createdStack, usedLiteral; diff --git a/lib/handlebars/compiler/printer.js b/lib/handlebars/compiler/printer.js index b549d61..ad276f1 100644 --- a/lib/handlebars/compiler/printer.js +++ b/lib/handlebars/compiler/printer.js @@ -127,7 +127,7 @@ PrintVisitor.prototype.BooleanLiteral = function(bool) { PrintVisitor.prototype.Hash = function(hash) { var pairs = hash.pairs; - var joinedPairs = [], left, right; + var joinedPairs = []; for (var i=0, l=pairs.length; i<l; i++) { joinedPairs.push(this.accept(pairs[i])); diff --git a/lib/handlebars/compiler/visitor.js b/lib/handlebars/compiler/visitor.js index c0cfab6..c2480ad 100644 --- a/lib/handlebars/compiler/visitor.js +++ b/lib/handlebars/compiler/visitor.js @@ -1,3 +1,4 @@ +/*jshint unused: false */ function Visitor() {} Visitor.prototype = { diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index ce85077..0878cc4 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -1,6 +1,4 @@ /*jshint -W004 */ -import SafeString from "./safe-string"; - var escape = { "&": "&", "<": "<", diff --git a/lib/precompiler.js b/lib/precompiler.js index 64a6dab..f673479 100644 --- a/lib/precompiler.js +++ b/lib/precompiler.js @@ -13,7 +13,6 @@ module.exports.cli = function(opts) { return; } - var template = [0]; if (!opts.templates.length) { throw new Handlebars.Exception('Must define at least one template or directory.'); } |