Skip to content
Browse files

GH-134 , remove support for scalar in the block #

  • Loading branch information...
1 parent a7ae9df commit 27600481d68c21dee77f50e714d1a15c4cc50e27 @vybs vybs committed Sep 10, 2012
Showing with 1 addition and 15 deletions.
  1. +1 −1 lib/dust.js
  2. +0 −14 test/jasmine-test/spec/grammarTests.js
View
2 lib/dust.js
@@ -410,7 +410,7 @@ Chunk.prototype.section = function(elem, context, bodies, params) {
}
} else if (elem === true) {
if (body) return body(this, context);
- } else if (elem || elem === 0) {
+ } else if (elem && typeof elem === 'object') {
if (body) {
context.stack.head['$idx'] = 0;
context.stack.head['$len'] = 1;
View
14 test/jasmine-test/spec/grammarTests.js
@@ -704,20 +704,6 @@ var grammarTests = [
message: "should test scope of context function"
},
{
- name: "test that the scope of the function is correct",
- source: "Hello {#foo}{#bar}{.}{/bar}{/foo} World!",
- context: {
- foo: {
- foobar: 'Foo Bar',
- bar: function () {
- return this.foobar;
- }
- }
- },
- expected: "Hello Foo Bar World!",
- message: "should test scope of context function"
- },
- {
name: "Use dash in key",
source: 'Hello {first-name}, {last-name}! You have {count} new messages.',
context: { "first-name": "Mick", "last-name" : "Jagger", "count": 30 },

0 comments on commit 2760048

Please sign in to comment.
Something went wrong with that request. Please try again.