Skip to content

Commit

Permalink
Merge pull request #684 from blakeembrey/javascript-variable
Browse files Browse the repository at this point in the history
Allow any number of trailing characters for valid JavaScript variable
  • Loading branch information
kpdecker committed Dec 25, 2013
2 parents 096b8cc + f3a9081 commit 2dae244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/handlebars/compiler/javascript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,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)) {
if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) {
return true;
}
return false;
Expand Down

0 comments on commit 2dae244

Please sign in to comment.