Merge pull request #69 from rgrove/allow-hyphens.

Allow ids to contain hyphens. Fixes #36.
This commit is contained in:
Yehuda Katz
2011-05-03 19:01:37 -07:00
4 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ Handlebars.JavaScriptCompiler = function() {};
// PUBLIC API: You can override these methods in a subclass to provide
// alternative compiled forms for name lookup and buffering semantics
nameLookup: function(parent, name, type) {
if(JavaScriptCompiler.RESERVED_WORDS[name]) {
if(JavaScriptCompiler.RESERVED_WORDS[name] || name.indexOf('-') !== -1) {
return parent + "['" + name + "']";
} else {
return parent + "." + name;