Merge pull request #86 from jblotus/master

A few bug fixes
This commit is contained in:
Yehuda Katz
2011-05-25 17:06:31 -07:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ embedded in them, as well as the text for a link:
});
var context = { posts: [{url: "/hello-world", body: "Hello World!"}] };
var source = "<ul>{{#posts}}<li>{{{link_to this}}}</li></ul>"
var source = "<ul>{{#posts}}<li>{{{link_to this}}}</li>{{/posts}}</ul>"
var template = Handlebars.compile(source);
template(context);
+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;