Skip to content

Commit

Permalink
Merge pull request #700 from blakeembrey/valid-js-variable
Browse files Browse the repository at this point in the history
Remove redundant conditions
  • Loading branch information
kpdecker committed Jan 6, 2014
2 parents 6d996ef + 3d9685c commit 08fab25
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/handlebars/compiler/javascript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,7 @@ for(var i=0, l=reservedWords.length; i<l; i++) {
}

JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) {
return true;
}
return false;
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
};

export default JavaScriptCompiler;

0 comments on commit 08fab25

Please sign in to comment.