question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Evaluating "new DateTime(2022,1,20)" does not work unless OptionInlineNamespacesEvaluationActive is turned on

See original GitHub issue

Still using this fantastic library and great to see it progresses! I have made a huge version jump from 1.4.12.0 to current 1.4.35.0. However one of my tests does not pass anymore, so I have fiddled around.

When evaluating this expression: new DateTime(2022,1,20) the result is correctly evaluated with OptionInlineNamespacesEvaluationActive=true.

However when OptionInlineNamespacesEvaluationActive=false (which was my default setting), an error is raised as follows: Type or class DateTime is unknown

The old version could successfully evaluate this expression regardless of OptionInlineNamespacesEvaluationActive setting. Maybe it is on purpose in which case I’m fine with turning the option on. I was just hesitating with the possible performance and security implications.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HelgeLcommented, Jan 20, 2022

Found the donate button, never mind!

0reactions
codingsebcommented, Jan 20, 2022

I have forked your repo and have enhanced ExpressionEvaluator to handling single quoted strings. Would you be interested? I could prepare a pull request, or you can see my commits from yesterday here: https://github.com/HelgeL/ExpressionEvaluator/commits/master

Can be useful.

I see that it is an option so normally it should not break compatibility. Just some questions : Do you have some tests that come with ? Did you try it with char evaluation that use also singlequote. how do you manage potential conflicts ? You just always use the option evaluator.OptionCharEvaluationActive = false; when evaluator.OptionSingleQuotedStringEvaluationActive= true; or you can use both together ?

We just should add some documentation on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateTime Struct (System)
A DateTime object does not have a property that returns an object that represents that date and time value's time zone. The Kind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found