When using parent context in a ifCond in an each then data scope is different to what happens in handlebars js
The scope of ../this should be the root where as ../../this points to the root
Test to reproduce
[Fact]publicvoidwith_an_ifCond_in_a_loop_then_the_parent_this_context_in_the_ifCond_should_be_the_root(){varsource=@"{{#each loop}} {{#ifCond another '===' 'value'}} test {{{../this.foo}}} {{/ifCond}} {{/each}}";varpartialSource="test {{foo}}";vartemplate=HandlebarsDotNet.Handlebars.Compile(source);using(varreader=newStringReader(partialSource)){varpartialTemplate=HandlebarsDotNet.Handlebars.Compile(reader);HandlebarsDotNet.Handlebars.RegisterTemplate("partial",partialTemplate);}HandlebarsDotNet.Handlebars.RegisterHelper("ifCond",(writer,options,context,parameters)=>{if(parameters.Length!=3)options.Inverse(writer,context);else{if(parameters[0]==parameters[2])options.Template(writer,context);elseoptions.Inverse(writer,context);}});vardata=new{foo="bar",loop=newobject[]{new{another="value"}}};varoutput=template(data);Assert.Equal(output,"test bar");}Has anyone else had this issue? I'm happy to work on a pull request but don't know where to start
When using parent context in a ifCond in an each then data scope is different to what happens in handlebars js
The scope of ../this should be the root where as ../../this points to the root
Test to reproduce
Has anyone else had this issue? I'm happy to work on a pull request but don't know where to start