diff --git a/source/Handlebars.Test/BasicIntegrationTests.cs b/source/Handlebars.Test/BasicIntegrationTests.cs index ea076246..bc942451 100644 --- a/source/Handlebars.Test/BasicIntegrationTests.cs +++ b/source/Handlebars.Test/BasicIntegrationTests.cs @@ -57,21 +57,21 @@ public void BasicPath(IHandlebars handlebars) var result = template(data); Assert.Equal("Hello, Handlebars.Net!", result); } - + [Fact] public void BasicSharedEnvironment() { var handlebars = Handlebars.CreateSharedEnvironment(); - handlebars.RegisterHelper("registerLateHelper", + handlebars.RegisterHelper("registerLateHelper", (in EncodedTextWriter writer, in HelperOptions options, in Context context, in Arguments arguments) => { var configuration = options.Frame .GetType() .GetProperty("Configuration", BindingFlags.Instance | BindingFlags.NonPublic)? .GetValue(options.Frame) as ICompiledHandlebarsConfiguration; - - if(configuration == null) return; - + + if (configuration == null) return; + var helpers = configuration.Helpers; const string name = "lateHelper"; @@ -80,12 +80,12 @@ public void BasicSharedEnvironment() @ref.Value = new DelegateReturnHelperDescriptor(name, (c, a) => 42); } }); - + var _0_template = "{{registerLateHelper}}"; var _0 = handlebars.Compile(_0_template); var _1_template = "{{lateHelper}}"; var _1 = handlebars.Compile(_1_template); - + var result = _1(null); Assert.Equal("", result); // `lateHelper` is not registered yet @@ -127,7 +127,7 @@ public void BasicPathUnresolvedBindingFormatter(IHandlebars handlebars) var expected = HtmlEncodeStringHelper(handlebars, "Hello, ('foo' is undefined)!"); Assert.Equal(expected, result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void PathUnresolvedBindingFormatter(IHandlebars handlebars) { @@ -145,7 +145,7 @@ public void PathUnresolvedBindingFormatter(IHandlebars handlebars) var expected = HtmlEncodeStringHelper(handlebars, "Hello, ('foo' is undefined)!"); Assert.Equal(expected, result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void CustomDateTimeFormat(IHandlebars handlebars) { @@ -160,23 +160,23 @@ public void CustomDateTimeFormat(IHandlebars handlebars) { now = DateTime.Now }; - + var result = template(data); Assert.Equal(data.now.ToString(format), result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void DefaultDateTimeFormat(IHandlebars handlebars) { var source = "{{time}}"; - + var template = handlebars.Compile(source); var time = "2020-11-19T23:36:08.4256520Z"; var data = new { time = DateTime.Parse(time).ToUniversalTime() }; - + var result = template(data); Assert.Equal(time, result); } @@ -193,7 +193,7 @@ public void BasicPathThrowOnUnresolvedBindingExpression(IHandlebars handlebars) { name = "Handlebars.Net" }; - + Assert.Throws(() => template(data)); } @@ -203,7 +203,7 @@ public void BasicPathThrowOnNestedUnresolvedBindingExpression(IHandlebars handle var source = "Hello, {{foo.bar}}!"; handlebars.Configuration.ThrowOnUnresolvedBindingExpression = true; - + var template = handlebars.Compile(source); var data = new @@ -211,7 +211,7 @@ public void BasicPathThrowOnNestedUnresolvedBindingExpression(IHandlebars handle foo = (object)null }; var ex = Assert.Throws(() => template(data)); - + Assert.Equal("bar is undefined", ex.Message); } @@ -347,7 +347,7 @@ public void BasicPathArrayNoSquareBracketsChildPath(IHandlebars handlebars) var result = template(data); Assert.Equal("Hello, Handlebars.Net!", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicPathEnumerableNoSquareBracketsChildPath(IHandlebars handlebars) { @@ -437,7 +437,7 @@ public void PathRelativeBinding(IHandlebars handlebars) }; var result = handlebarsTemplate(data); - var actual = string.Join(" ", result.Split(new []{"\r\n"}, StringSplitOptions.RemoveEmptyEntries).Select(o => o.Trim(' '))); + var actual = string.Join(" ", result.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Select(o => o.Trim(' '))); Assert.Equal("Garry Finch gazraa Karen Finch photobasics", actual); } @@ -453,11 +453,101 @@ public void BasicPropertyOnArray(IHandlebars handlebars) var result = template(data); Assert.Equal("Array is 2 item(s) long", result); } - + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void PathRelativeBinding_WithDefaultValue(IHandlebars handlebars) + { + var template = + @"{{#each users}} + {{this/person.name/firstName}} + {{#with this/person.name}} + {{lastName}} + {{lookup (lookup ../this/../users @index) 'twitter' 'N/A'}} + {{/with}} + {{/each}}"; + + var handlebarsTemplate = handlebars.Compile(template); + + var data = new + { + users = new object[] + { + new + { + person = new + { + name = new + { + firstName = "Garry", + lastName = "Finch" + } + }, + jobTitle = "Front End Technical Lead", + }, + new + { + person = new + { + name = new + { + firstName = "Karen", + lastName = "Finch" + } + }, + jobTitle = "Photographer", + twitter = "photobasics" + } + } + }; + + var result = handlebarsTemplate(data); + var actual = string.Join(" ", result.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Select(o => o.Trim(' '))); + Assert.Equal("Garry Finch N/A Karen Finch photobasics", actual); + } + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void PathRelativeBinding_WrongNumberOfArguments(IHandlebars handlebars) + { + // Arrange + var template = + @"{{#each users}} + {{this/person.name/firstName}} + {{#with this/person.name}} + {{lastName}} + {{lookup (lookup ../this/../users @index)}} + {{/with}} + {{/each}}"; + + var handlebarsTemplate = handlebars.Compile(template); + + var data = new + { + users = new object[] + { + new + { + person = new + { + name = new + { + firstName = "Garry", + lastName = "Finch" + } + }, + twitter = "test" + } + } + }; + + // Act + var ex = Assert.Throws(() => handlebarsTemplate(data)); + Assert.Equal("{{lookup}} helper must have two or three arguments", ex.Message); + } + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void AliasedPropertyOnArray(IHandlebars handlebars) { - if(handlebars.IsSharedEnvironment) return; + if (handlebars.IsSharedEnvironment) return; var source = "Array is {{ names.count }} item(s) long"; handlebars.Configuration.UseCollectionMemberAliasProvider(); @@ -469,15 +559,15 @@ public void AliasedPropertyOnArray(IHandlebars handlebars) var result = template(data); Assert.Equal("Array is 2 item(s) long", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void CustomAliasedPropertyOnArray(IHandlebars handlebars) { var aliasProvider = new DelegatedMemberAliasProvider() .AddAlias("myCountAlias", list => list.Count); - + handlebars.Configuration.AliasProviders.Add(aliasProvider); - + var source = "Array is {{ names.myCountAlias }} item(s) long"; var template = handlebars.Compile(source); var data = new @@ -487,12 +577,12 @@ public void CustomAliasedPropertyOnArray(IHandlebars handlebars) var result = template(data); Assert.Equal("Array is 2 item(s) long", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void AliasedPropertyOnList(IHandlebars handlebars) { - if(handlebars.IsSharedEnvironment) return; - + if (handlebars.IsSharedEnvironment) return; + var source = "Array is {{ names.Length }} item(s) long"; handlebars.Configuration.UseCollectionMemberAliasProvider(); var template = handlebars.Compile(source); @@ -581,7 +671,7 @@ public void BasicWith(IHandlebars handlebars) var result = template(data); Assert.Equal("Hello, my good friend Erik!", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void GlobalDataPropagation(IHandlebars handlebars) { @@ -600,7 +690,7 @@ public void GlobalDataPropagation(IHandlebars handlebars) var result = template(data, new { global1 = 2, global2 = 4 }); Assert.Equal("1 2 3 4", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void TestSingleLoopDictionary(IHandlebars handlebars) { @@ -616,7 +706,7 @@ public void TestSingleLoopDictionary(IHandlebars handlebars) var result = template(data); Assert.Equal("ii=0 ii=1 ii=2 ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void WithWithBlockParams(IHandlebars handlebars) { @@ -700,7 +790,7 @@ public void BasicObjectEnumerator(IHandlebars handlebars) var result = template(data); Assert.Equal("hello world ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicListEnumerator(IHandlebars handlebars) { @@ -717,7 +807,7 @@ public void BasicListEnumerator(IHandlebars handlebars) var result = template(data); Assert.Equal("hello world ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicObjectEnumeratorWithLast(IHandlebars handlebars) { @@ -751,7 +841,7 @@ public void BasicObjectEnumeratorWithKey(IHandlebars handlebars) var result = template(data); Assert.Equal("foo: hello bar: world ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void ObjectEnumeratorWithBlockParams(IHandlebars handlebars) { @@ -768,7 +858,7 @@ public void ObjectEnumeratorWithBlockParams(IHandlebars handlebars) var result = template(data); Assert.Equal("hello: foo world: bar ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void ObjectEnumeratorWithWithContainingBlockParams(IHandlebars handlebars) { @@ -802,7 +892,7 @@ public void BasicDictionaryEnumerator(IHandlebars handlebars) var result = template(data); Assert.Equal("hello world ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicDictionaryEnumeratorDeep(IHandlebars handlebars) { @@ -834,7 +924,7 @@ public void BasicDictionaryEnumeratorDeep(IHandlebars handlebars) } } }; - + var result = template(data); Assert.Equal("1234", result); } @@ -855,7 +945,7 @@ public void DictionaryEnumeratorWithBlockParams(IHandlebars handlebars) var result = template(data); Assert.Equal("hello foo world bar ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void DictionaryWithLastEnumerator(IHandlebars handlebars) { @@ -1679,12 +1769,12 @@ public void TestNoWhitespaceBetweenExpressions(IHandlebars handlebars) var source = @"{{#is ProgramID """"}}no program{{/is}}{{#is ProgramID ""1081""}}some program text{{/is}}"; handlebars.RegisterHelper("is", (output, options, context, args) => + { + if (args[0] == args[1]) { - if (args[0] == args[1]) - { - options.Template(output, context); - } - }); + options.Template(output, context); + } + }); var template = handlebars.Compile(source); @@ -1771,74 +1861,74 @@ public void ImplicitIDictionaryImplementationShouldNotThrowNullref(IHandlebars h // Act compile.Invoke(mock); } - - [Theory, ClassData(typeof(HandlebarsEnvGenerator))] - public void ShouldBeAbleToHandleFieldContainingDots(IHandlebars handlebars) - { - var source = "Everybody was {{ foo.bar }}-{{ [foo.bar] }} {{ foo.[bar.baz].buz }}!"; - var template = handlebars.Compile(source); - var data = new Dictionary() - { - {"foo.bar", "fu"}, - {"foo", new Dictionary{{ "bar", "kung" }, { "bar.baz", new Dictionary {{ "buz", "fighting" }} }} } - }; - var result = template(data); - Assert.Equal("Everybody was kung-fu fighting!", result); - } - - [Theory, ClassData(typeof(HandlebarsEnvGenerator))] - public void ShouldBeAbleToHandleListWithNumericalFields(IHandlebars handlebars) - { - var source = "{{ [0] }}"; - var template = handlebars.Compile(source); - var data = new List {"FOOBAR"}; - var result = template(data); - Assert.Equal("FOOBAR", result); - } - - [Theory, ClassData(typeof(HandlebarsEnvGenerator))] - public void ShouldBeAbleToHandleDictionaryWithNumericalFields(IHandlebars handlebars) - { - var source = "{{ [0] }}"; - var template = handlebars.Compile(source); - var data = new Dictionary - { - {"0", "FOOBAR"}, - }; - var result = template(data); - Assert.Equal("FOOBAR", result); - } - - [Theory, ClassData(typeof(HandlebarsEnvGenerator))] - public void ShouldBeAbleToHandleJObjectsWithNumericalFields(IHandlebars handlebars) - { - var source = "{{ [0] }}"; - var template = handlebars.Compile(source); - var data = new JObject - { - {"0", "FOOBAR"}, - }; - var result = template(data); - Assert.Equal("FOOBAR", result); - } - - [Theory, ClassData(typeof(HandlebarsEnvGenerator))] - public void ShouldBeAbleToHandleKeysStartingAndEndingWithSquareBrackets(IHandlebars handlebars) - { - var source = - "{{ noBracket }} {{ [noBracket] }} {{ [[startsWithBracket] }} {{ [endsWithBracket]] }} {{ [[bothBrackets]] }}"; - var template = handlebars.Compile(source); - var data = new Dictionary - { - {"noBracket", "foo"}, - {"[startsWithBracket", "bar"}, - {"endsWithBracket]", "baz"}, - {"[bothBrackets]", "buz"} - }; - var result = template(data); - Assert.Equal("foo foo bar baz buz", result); - } - + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void ShouldBeAbleToHandleFieldContainingDots(IHandlebars handlebars) + { + var source = "Everybody was {{ foo.bar }}-{{ [foo.bar] }} {{ foo.[bar.baz].buz }}!"; + var template = handlebars.Compile(source); + var data = new Dictionary() + { + {"foo.bar", "fu"}, + {"foo", new Dictionary{{ "bar", "kung" }, { "bar.baz", new Dictionary {{ "buz", "fighting" }} }} } + }; + var result = template(data); + Assert.Equal("Everybody was kung-fu fighting!", result); + } + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void ShouldBeAbleToHandleListWithNumericalFields(IHandlebars handlebars) + { + var source = "{{ [0] }}"; + var template = handlebars.Compile(source); + var data = new List { "FOOBAR" }; + var result = template(data); + Assert.Equal("FOOBAR", result); + } + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void ShouldBeAbleToHandleDictionaryWithNumericalFields(IHandlebars handlebars) + { + var source = "{{ [0] }}"; + var template = handlebars.Compile(source); + var data = new Dictionary + { + {"0", "FOOBAR"}, + }; + var result = template(data); + Assert.Equal("FOOBAR", result); + } + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void ShouldBeAbleToHandleJObjectsWithNumericalFields(IHandlebars handlebars) + { + var source = "{{ [0] }}"; + var template = handlebars.Compile(source); + var data = new JObject + { + {"0", "FOOBAR"}, + }; + var result = template(data); + Assert.Equal("FOOBAR", result); + } + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] + public void ShouldBeAbleToHandleKeysStartingAndEndingWithSquareBrackets(IHandlebars handlebars) + { + var source = + "{{ noBracket }} {{ [noBracket] }} {{ [[startsWithBracket] }} {{ [endsWithBracket]] }} {{ [[bothBrackets]] }}"; + var template = handlebars.Compile(source); + var data = new Dictionary + { + {"noBracket", "foo"}, + {"[startsWithBracket", "bar"}, + {"endsWithBracket]", "baz"}, + {"[bothBrackets]", "buz"} + }; + var result = template(data); + Assert.Equal("foo foo bar baz buz", result); + } + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicReturnFromHelper(IHandlebars Handlebars) { @@ -1846,11 +1936,11 @@ public void BasicReturnFromHelper(IHandlebars Handlebars) Handlebars.RegisterHelper(getData, (context, arguments) => arguments[0]); var source = $"{{{{{getData} 'data'}}}}"; var template = Handlebars.Compile(source); - + var result = template(new object()); Assert.Equal("data", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void CollectionReturnFromHelper(IHandlebars handlebars) { @@ -1861,17 +1951,17 @@ public void CollectionReturnFromHelper(IHandlebars handlebars) {"Nils", arguments[0].ToString()}, {"Yehuda", arguments[1].ToString()} }; - + return data; }); var source = "{{#each (getData 'Darmstadt' 'San Francisco')}}{{@key}} lives in {{@value}}. {{/each}}"; var template = handlebars.Compile(source); - + var result = template(new object()); Assert.Equal("Nils lives in Darmstadt. Yehuda lives in San Francisco. ", result); } - - + + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void ReturnFromHelperWithSubExpression(IHandlebars handlebars) { @@ -1882,42 +1972,42 @@ public void ReturnFromHelperWithSubExpression(IHandlebars handlebars) writer.WriteSafeString(" "); writer.WriteSafeString(arguments[1]); }); - + var getData = $"getData{Guid.NewGuid()}"; handlebars.RegisterHelper(getData, (context, arguments) => { return arguments[0]; }); - + var source = $"{{{{{getData} ({formatData} 'data' '42')}}}}"; var template = handlebars.Compile(source); - + var result = template(new object()); Assert.Equal("data 42", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void ReturnFromHelperLateBindWithSubExpression(IHandlebars handlebars) { var formatData = $"formatData{Guid.NewGuid()}"; var getData = $"getData{Guid.NewGuid()}"; - + var source = $"{{{{{getData} ({formatData} 'data' '42')}}}}"; var template = handlebars.Compile(source); - + handlebars.RegisterHelper(formatData, (writer, context, arguments) => { writer.WriteSafeString(arguments[0]); writer.WriteSafeString(" "); writer.WriteSafeString(arguments[1]); }); - + handlebars.RegisterHelper(getData, (context, arguments) => arguments[0]); - + var result = template(new object()); Assert.Equal("data 42", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void BasicLookup(IHandlebars handlebars) { @@ -1925,14 +2015,14 @@ public void BasicLookup(IHandlebars handlebars) var template = handlebars.Compile(source); var data = new { - people = new[]{"Nils", "Yehuda"}, - cities = new[]{"Darmstadt", "San Francisco"} + people = new[] { "Nils", "Yehuda" }, + cities = new[] { "Darmstadt", "San Francisco" } }; - + var result = template(data); Assert.Equal("Nils lives in Darmstadt Yehuda lives in San Francisco ", result); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] public void LookupAsSubExpression(IHandlebars handlebars) { @@ -1967,7 +2057,7 @@ public void LookupAsSubExpression(IHandlebars handlebars) } } }; - + var result = template(data); Assert.Equal("Nils lives in Darmstadt (Germany)Yehuda lives in San Francisco (USA)", result); } @@ -1984,10 +2074,10 @@ private void StringConditionTest(IHandlebars handlebars) var func = handlebars.Compile(template); var actual = func(data); - + Assert.Equal(expected, actual); } - + [Theory, ClassData(typeof(HandlebarsEnvGenerator))] private void CustomHelperResolverTest(IHandlebars handlebars) { @@ -1995,9 +2085,9 @@ private void CustomHelperResolverTest(IHandlebars handlebars) var template = "{{ toLower input }}"; var func = handlebars.Compile(template); var data = new { input = "ABC" }; - + var actual = func(data); - + Assert.Equal(data.input.ToLower(), actual); } @@ -2009,7 +2099,7 @@ private void CustomHelperResolverTest(IHandlebars handlebars) public void ReferencingDirectlyVariableWhenHelperRegistered(string helperName) { var source = "{{ ./" + helperName + " }}"; - + foreach (IHandlebars handlebars in new HandlebarsEnvGenerator().Select(o => o[0])) { handlebars.RegisterHelper("one.two", (context, arguments) => 0); @@ -2017,8 +2107,8 @@ public void ReferencingDirectlyVariableWhenHelperRegistered(string helperName) var template = handlebars.Compile(source); var actual = template(new { one = new { two = 42 } }); - - Assert.Equal("42", actual); + + Assert.Equal("42", actual); } } @@ -2060,12 +2150,12 @@ public void HtmlEncoderCompatibilityIntegration_LateChangeConfig(bool useLegacyH var handlebars = Handlebars.Create(config); handlebars.Configuration.TextEncoder = useLegacyHandlebarsNetHtmlEncoding ? (ITextEncoder)new HtmlEncoderLegacy() : new HtmlEncoder(); var compiledTemplate = handlebars.Compile(template); - + var actual = compiledTemplate(value); Assert.Equal(expected, actual); } - + [Fact] public void ChainedPathIteratorHelper() { @@ -2099,11 +2189,11 @@ public bool TryResolveHelper(PathInfo name, Type targetType, out IHelperDescript helper = null; return false; } - + helper = new HelperDescriptor(name, method); return true; } - + helper = null; return false; } @@ -2113,7 +2203,7 @@ public bool TryResolveBlockHelper(PathInfo name, out IHelperDescriptor { private readonly MethodInfo _methodInfo; @@ -2136,7 +2226,7 @@ public void Invoke(in EncodedTextWriter output, in HelperOptions options, in Con } } } - + private class CustomUndefinedFormatter : IFormatter, IFormatterProvider { public void Format(T value, in EncodedTextWriter writer) @@ -2156,7 +2246,7 @@ public bool TryCreateFormatter(Type type, out IFormatter formatter) return true; } } - + private class CustomDateTimeFormatter : IFormatter, IFormatterProvider { private readonly string _format; @@ -2165,9 +2255,9 @@ private class CustomDateTimeFormatter : IFormatter, IFormatterProvider public void Format(T value, in EncodedTextWriter writer) { - if(!(value is DateTime dateTime)) + if (!(value is DateTime dateTime)) throw new ArgumentException("supposed to be DateTime"); - + writer.Write($"{dateTime.ToString(_format)}"); } diff --git a/source/Handlebars.sln b/source/Handlebars.sln index 0224c9d9..adaa5299 100644 --- a/source/Handlebars.sln +++ b/source/Handlebars.sln @@ -1,19 +1,18 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26403.3 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33403.182 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Handlebars", "Handlebars\Handlebars.csproj", "{A09CFF95-B671-48FE-96A8-D3CBDC110B75}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Handlebars", "Handlebars\Handlebars.csproj", "{9822C7B8-7E51-42BC-9A49-72A10491B202}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Handlebars.Test", "Handlebars.Test\Handlebars.Test.csproj", "{2BD48FB6-C852-4141-B734-12E501B1D761}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Handlebars.Test", "Handlebars.Test\Handlebars.Test.csproj", "{6BA232A6-8C4D-4C7D-BD75-1844FE9774AF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9AC0BCD-C060-4634-BBBB-636167C809B4}" ProjectSection(SolutionItems) = preProject - ..\README.md = ..\README.md Directory.Build.props = Directory.Build.props + ..\README.md = ..\README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Handlebars.Benchmark", "Handlebars.Benchmark\Handlebars.Benchmark.csproj", "{417E2E51-2DD2-4045-84E5-BA66484E957B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Handlebars.Benchmark", "Handlebars.Benchmark\Handlebars.Benchmark.csproj", "{417E2E51-2DD2-4045-84E5-BA66484E957B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,14 +20,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A09CFF95-B671-48FE-96A8-D3CBDC110B75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A09CFF95-B671-48FE-96A8-D3CBDC110B75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A09CFF95-B671-48FE-96A8-D3CBDC110B75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A09CFF95-B671-48FE-96A8-D3CBDC110B75}.Release|Any CPU.Build.0 = Release|Any CPU - {2BD48FB6-C852-4141-B734-12E501B1D761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BD48FB6-C852-4141-B734-12E501B1D761}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BD48FB6-C852-4141-B734-12E501B1D761}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BD48FB6-C852-4141-B734-12E501B1D761}.Release|Any CPU.Build.0 = Release|Any CPU + {9822C7B8-7E51-42BC-9A49-72A10491B202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9822C7B8-7E51-42BC-9A49-72A10491B202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9822C7B8-7E51-42BC-9A49-72A10491B202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9822C7B8-7E51-42BC-9A49-72A10491B202}.Release|Any CPU.Build.0 = Release|Any CPU + {6BA232A6-8C4D-4C7D-BD75-1844FE9774AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BA232A6-8C4D-4C7D-BD75-1844FE9774AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BA232A6-8C4D-4C7D-BD75-1844FE9774AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BA232A6-8C4D-4C7D-BD75-1844FE9774AF}.Release|Any CPU.Build.0 = Release|Any CPU {417E2E51-2DD2-4045-84E5-BA66484E957B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {417E2E51-2DD2-4045-84E5-BA66484E957B}.Debug|Any CPU.Build.0 = Debug|Any CPU {417E2E51-2DD2-4045-84E5-BA66484E957B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -37,6 +36,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0260B1C7-30DF-49B6-A96E-9FD2F2AEFA1B} + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.TextStylePolicy = $1 diff --git a/source/Handlebars/Helpers/LookupReturnHelperDescriptor.cs b/source/Handlebars/Helpers/LookupReturnHelperDescriptor.cs index 6cd6849f..7b8f80ff 100644 --- a/source/Handlebars/Helpers/LookupReturnHelperDescriptor.cs +++ b/source/Handlebars/Helpers/LookupReturnHelperDescriptor.cs @@ -8,14 +8,15 @@ public sealed class LookupReturnHelperDescriptor : IHelperDescriptor