-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I added the following test toExtensionFixture.cs
:
[Test]
public void TestRecursiveCustomExtension()
{
var variables = new VariableDictionary();
variables.Add("Foo", "Bar");
variables.AddExtension("supercoolfunc", SuperCoolFunc!);
variables.Add("Var1", "#{Foo|supercoolfunc}");
variables.Add("Var2", "#{Var1}");
var result = variables.Get("Var2");
result.Should().Be("2-1-18");
}
This should work fine, but actually the test fails, and the result is #{Foo|supercoolfunc}
.
The bug can be fixed by updating the EvaluationContext
to pass extensions to nested contexts.
On EvaluationContext.cs line 125, change:
var context = new EvaluationContext(new Binding(), x, this);
to:
var context = new EvaluationContext(new Binding(), x, this, Extensions);
Metadata
Metadata
Assignees
Labels
No labels