OpenBD / openbd-core

The original open source Java powered GPL CFML runtime engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using var with local ends up in Expression Error

constantin-mike opened this issue · comments

Hello,

I am working on a project with some old CF code. It actually is a library used as foundation for a bigger project. The library is code-versioned on svn where I am not supposed to change anything.
They have code like this: <cfset var LOCAL.foo = 'bar'>.
Horrible, yes i know.
Problem is, with ACF11 it's working, no problem at all. With OpenBD (which I absolutely love as dev environment) i get Expression Error.
I have searched the net, tried everything (tuned the OpenBD settings a little bit on variables & scopes) without any result. I understand that there's a conflict between the variables and local scopes, but somehow it's working on ACF11.

Please, please, please ... would there be any way to fix this without changing the old code from the library, in such a way to work with OpenBD? Today i've tried installing CF2016 dev + IIS & crap on a Win10 machine ... i was not able to make it work. With OpenBD everything is so simple.

Many thanks in advance.
Many thanks for this wonderful tool!

Hi,

The issue is that OpenBD only supports a single identifier in a var assignment like this. The parser doesn't allow for the "LOCAL." prefix.

If you could modify the CFML, then the workaround would be to change the lines to:
<cfset var LOCAL = {}> <cfset LOCAL.foo = 'bar'>

Unfortunately it's not a quick fix to the OpenBD code and I don't have the bandwidth at the moment to address it.

Sorry I couldn't be more help.

Andy

in the meantime, i might be able to help you with CF2016 dev + IIS. Feel free to contact me.

No problem, thank you for your reply.
For the moment i am trying CommandBox, seems pretty cool too.
OpenBD is still a very useful piece of software, I will keep an eye on it.
I find it cool because it works out-of-the-box, it's integrated, has a lot of features etc!