Resolves issue 7 regarding proper handling of nested contexts when processing a

nested context.
This commit is contained in:
Michael Bayne
2011-05-26 14:52:45 -07:00
parent 31d0a0985d
commit ef971015bd
3 changed files with 34 additions and 13 deletions
@@ -458,7 +458,9 @@ public class Mustache
_template = compiler.compile(r);
}
@Override public void execute (Template tmpl, Template.Context ctx, Writer out) {
_template.execute(ctx.data, out);
// we must take care to preserve our context rather than creating a new one, which
// would happen if we just called execute() with ctx.data
_template.executeSegs(ctx, out);
}
protected final Template _template;
}