Default the Scope and Writer for Nested Contexts

I forgot to default the KeyScope and TextWriter to the parent tag's
scope and writer if they are not provided.
This commit is contained in:
Travis Parks 2013-01-16 16:06:30 -05:00
parent a6ddb18448
commit fe54d9522b
3 changed files with 6 additions and 6 deletions

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("0.0.2.0")] [assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.2.0")] [assembly: AssemblyFileVersion("0.0.3.0")]

View File

@ -93,10 +93,10 @@ namespace mustache
{ {
foreach (IGenerator generator in generators) foreach (IGenerator generator in generators)
{ {
generator.GetText(context.KeyScope, context.Writer); generator.GetText(context.KeyScope ?? scope, context.Writer ?? writer);
if (context.WriterNeedsConsidated) if (context.WriterNeedsConsidated)
{ {
writer.Write(_definition.ConsolidateWriter(context.Writer, arguments)); writer.Write(_definition.ConsolidateWriter(context.Writer ?? writer, arguments));
} }
} }
} }

View File

@ -34,6 +34,6 @@ using System.Runtime.CompilerServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.0")] [assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.2.0")] [assembly: AssemblyFileVersion("0.0.3.0")]
[assembly: InternalsVisibleTo("mustache-sharp.test")] [assembly: InternalsVisibleTo("mustache-sharp.test")]