Open jrlost opened 5 months ago
It may be easier to help if you provide a test that reproduces the problem.
Right, as I said, I've still been unable to replicate it locally in an isolated environment. I will continue to poke around and figure out what might be causing this to happen.
I created this issue to simply get some feelers out as to whether or not anyone else has seen behavior like this. I'm trying/hoping that I'm simply doing something wrong, making an incorrect assumption, or at the very least hoping I could get some more anecdotal evidence to use in diagnosing the issue.
I have a model, it looks similar to this:
As part of a larger template, I have this
With
HandlebarsDotNet.Handlebars.CreateSharedEnvironment(config);
, I get a result ofNote the
this.isPrimary => ,
Changing only
HandlebarsDotNet.Handlebars.CreateSharedEnvironment(config);
toHandlebarsDotNet.Handlebars.Create(config);
results in an output ofAgain, note
this.isPrimary => True,
Can anyone think of why
this.
would evaluate differently when using a shared environment? To add to the mystery, it's always happening to this one property, notice theisImage
property was not impacted. Also, we do use custom helpers, but none change the context, attempt to do any late binding, or interact with theBlockHelperOptions
. TheobjectFilter
helper above uses Antlr to filter a collection of objects given an expression, so something like this:The
toJson
simply returns the serialized representation of the objectI added the output of
this
above and below to show that it does contain the property I'm attempting to access; so I can't imagine it's a case where we're running into some concurrency issue; additionally, I'd expect this to puke randomly if that were the case and not always on this specific property.One more piece to add to the mystery, I cannot replicate this locally in an isolated environment (even when using the full complete model and template), so there's something more to it (which I'll continue to try to diagnose and identify). I'm just curious
{{property}}
and{{this.property}}
Thanks, I appreciate any insight.