fixing partials with int names

This commit is contained in:
James Fuller
2011-05-24 00:40:09 -04:00
parent 0e22301e8f
commit 28d35180bd
+1 -1
View File
@@ -288,7 +288,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] || name.indexOf('-') !== -1) {
if(JavaScriptCompiler.RESERVED_WORDS[name] || name.indexOf('-') !== -1 || !isNaN(name)) {
return parent + "['" + name + "']";
} else {
return parent + "." + name;