From b2aed8f86f48b850089e42e21e5c2bbc33618a7c Mon Sep 17 00:00:00 2001 From: Sahab Yazdani Date: Tue, 4 Oct 2011 12:14:33 -0400 Subject: [PATCH] Add dot notation support for section and inverted section tags --- mustache.js | 38 +++++++++++++++++++++----------------- test/unit.js | 9 +++++++++ 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/mustache.js b/mustache.js index 04e9b00..1b79cd5 100644 --- a/mustache.js +++ b/mustache.js @@ -345,6 +345,23 @@ var Mustache = (function(undefined) { return undefined; } + function find_with_dot_notation(name, context) { + var name_components = name.split('.'), + i = 1, n = name_components.length, + value = find_in_stack(name_components[0], context); + + while (value && i