Closed JEVietti closed 4 months ago
@JEVietti PR #306 will fix the issue. #304 also happens at v5.2?
@gumbarros Hard for me to test this easily since, my project is setup in a way that relies on what your PR will fix. I'd assume though from the other issue test your posted, that #304 is resolved in v5.2; and if not I can continue to use the work around expression instead.
Describe the bug I've been using this with version 5.1.0 of NCalcSync, but with 5.2.0 new behavior occurs which I think is an error in which ParameterNames are missing from the GetParameterNames and the Parameters Dictionary in the NCalc.Expression itself is empty
Expression: if([Value] >= 50, 'background-color: #80ffcc;', null)
I first ran into the issue with an Index out of bounds exception upon upgrading and testing.
Due to where I am assigning a parameter ["Value"] and inspected the expression and looked at the Parameters in the built Expression and it was empty. The GetParametersNames changed to GetParameterNames but now it is returning a List of just "null" without "Value" I tested by modifying the expression by changing [Value] to: Value, and {Value}, all of these yielded the same result of not appearing in the Parameters Property and would yield an IndexOutOfBoundException.
Example Expression Add the expression with your problem if applicable if([Value] >= 50, 'background-color: #80ffcc;', null)
Before in 5.1.0 I'd get styleExpression.GetParametersNames() Count = 2
Now I get Count = 1
Funnily enough though if I don't attempt to assign a Test Value to Parameters I get this error:
None of this behavior occurred in 5.1.0