toScript bug?

46 views
Skip to first unread message

Chris Blackwell

unread,
Jul 25, 2013, 10:00:41 AM7/25/13
to railo
Can anyone else confirm the following behavior.

given this code:

<cfscript>
test = {
"CaseMatTers": true
}
dump(test);
echo(toScript(test, 'test')); // --> test=new Object();test["casematters"]="true";
</cfscript>

dump(test) shows the struct with the correct casing.
toScript creates a javascript Object() but then assigns a lower case key to it.

I tested this on 4.1.0.011.

Cheer, Chris

Chris Blackwell

unread,
Jul 25, 2013, 10:08:45 AM7/25/13
to railo
Looking in the src the issue seems to be calling getLowerString() on the key

Chris

Adam Cameron

unread,
Jul 25, 2013, 10:09:52 AM7/25/13
to ra...@googlegroups.com
I see the same if I run this on cflive.net.

Also: it represents your true value as a string "true" not a boolean true. I dunno if that is by design..?

-- 
Adam


On 25 July 2013 15:00, Chris Blackwell <ch...@team193.com> wrote:

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/CAB%3DtfTqM%3DzbDwao277Ga_c6k-4FZcgZbmQGL3m5-tooBBHPR2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris Blackwell

unread,
Jul 25, 2013, 10:21:50 AM7/25/13
to railo
ooh cflive.. not seen that before very handy, although its broken.  seems to be running the code on CF when you tick Railo, as indicated by the styling of the cfdump's






Chris Blackwell

unread,
Jul 25, 2013, 10:24:02 AM7/25/13
to railo
no wait.. thats railo outputting a CF styled dump.  my head is spinning

Matt Quackenbush

unread,
Jul 25, 2013, 10:28:33 AM7/25/13
to ra...@googlegroups.com
Yeah, I noticed that recently, and it threw me off, too. I'm assuming Russ had a reason to do that (like CSS conflict, or something), but it is definitely confusing when you're use to the difference.

Adam Cameron

unread,
Jul 25, 2013, 10:29:52 AM7/25/13
to ra...@googlegroups.com
Nah, that's a homespun <cfdump>... Russ has blocked Java access for security reasons, and this in turn prevents the native <cfdump> from working so he's rolled his own.

This is - in a way - a blessing, as it means one never has to look at the achromatopsically-designed Railo <cfdump>.

For the record it's running Railo 4.1.0.004 and CF 9,0,2,282541.

-- 
Adam


On 25 July 2013 15:21, Chris Blackwell <ch...@team193.com> wrote:

Matt Quackenbush

unread,
Jul 25, 2013, 10:38:23 AM7/25/13
to ra...@googlegroups.com
On Thu, Jul 25, 2013 at 10:29 AM, Adam Cameron <dac...@gmail.com> wrote:
Nah, that's a homespun <cfdump>... Russ has blocked Java access for security reasons, and this in turn prevents the native <cfdump> from working so he's rolled his own.


Oh yeah, that's right. I forgot about that bit.

 

This is - in a way - a blessing, as it means one never has to look at the achromatopsically-designed Railo <cfdump>.


LMAO

While I agree the color choices are, umm, uhh, generally putrid, It's nice to see the "difference", so-to-speak. I'll also note that for Railo users, I believe one can also override those styles - 'though I never have.

Adam Cameron

unread,
Jul 25, 2013, 10:47:21 AM7/25/13
to ra...@googlegroups.com
Yeah def. Even I have done a double-take on cflive a coupla times. Esp given a few weeks back it was actually outputing RAILO in both windows. Which threw me off for a while, as I was testing a bug in CF at the time and suddenly couldn't repro it.

I have to concede I am getting used to the Railo colour scheme.

That's not to say I like it. But I'm getting used to it ;-)

-- 
Adam



--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

M@

unread,
Jul 25, 2013, 10:49:03 AM7/25/13
to ra...@googlegroups.com
>achromatopsically-
Does that mean "Awesome" ?

Adam Cameron

unread,
Jul 25, 2013, 11:05:59 AM7/25/13
to ra...@googlegroups.com
Yeah it does.

Sure it does.

-- 
Adam


Carl Von Stetten

unread,
Jul 25, 2013, 12:52:25 PM7/25/13
to ra...@googlegroups.com
I took it to mean "ohhh! My eyes are bleeding!" ;-)
-Carl V.

Adam Cameron

unread,
Jul 25, 2013, 3:42:12 PM7/25/13
to ra...@googlegroups.com
Give that man a colour chart!

It's an adverbial form of a type of colour blindness. One in which the person cannot perceive colours at all. Which is what I am guessing the person who chose the colour palette for Railo's <cfdump> suffers from. I cannot think of any other way to explain it ;-)

-- 
Adam

Igal @ getRailo.org

unread,
Jul 25, 2013, 3:47:42 PM7/25/13
to ra...@googlegroups.com
if you guys want to be positive and helpful -- you are welcome to suggest a detailed color pallet for cfdump.

if you just want to complain -- carry on...  I'll simply add this thread to my ignore list.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

Adam Cameron

unread,
Jul 25, 2013, 3:49:47 PM7/25/13
to ra...@googlegroups.com
Thanks for giving us permission to banter, Igal. Much appreciated.

-- 
Adam


Igal @ getRailo.org

unread,
Jul 25, 2013, 3:52:26 PM7/25/13
to ra...@googlegroups.com
I wouldn't call it "banter" when someone just complains all the time, but -- you're welcome.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Carl Von Stetten

unread,
Jul 25, 2013, 3:54:57 PM7/25/13
to ra...@googlegroups.com
@Igal,

I really didn't mean to cause offense; just trying to be humorous.  I have great appreciation for the hard work that has gone into Railo.  I'll try to be more diplomatic in the future.
-Carl V.

Matt Quackenbush

unread,
Jul 25, 2013, 3:58:05 PM7/25/13
to ra...@googlegroups.com
While I think the colors are a bit fugly, I've grown quite accustomed to them and don't have a problem with them - maybe even grown fond-ish of them. Especially since I know that I have ZERO design talent whatsoever and if >>I<< chose the color pallet it'd probably be much worse. :-)



Igal @ getRailo.org

unread,
Jul 25, 2013, 4:02:43 PM7/25/13
to ra...@googlegroups.com
@Carl --

there's really no need to be diplomatic, and humor is absolutely welcome.

my point is that if something bothers anyone about the Railo project, they are welcome to offer modifications.  that's the beauty of an open source project.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mark Drew

unread,
Jul 25, 2013, 4:03:28 PM7/25/13
to ra...@googlegroups.com
Maybe we should choose some Kuler pallets?

At the end of the day I am kinda used to them so don't mind them. I get shocked when I see the ACF ones. 

Submit a patch my lovelies :)

Regards
Mark Drew
Sent from a mobile device

Igal @ getRailo.org

unread,
Jul 25, 2013, 4:07:59 PM7/25/13
to ra...@googlegroups.com
I plan to completely rewrite cfdump for Railo 5.

then you will be able to override the colors with a few simple css declarations if you choose to.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Peter Boughton

unread,
Jul 25, 2013, 6:05:00 PM7/25/13
to ra...@googlegroups.com
My suggestion for colours would be the original v1 colours.

Used to be even more bright and cheery than the wonderful hues we have
today, and I'm sure Adam would *love* those. :>

Michael Offner

unread,
Jul 27, 2013, 4:08:34 AM7/27/13
to ra...@googlegroups.com
this is expected, we have to match ACF behaviour in that case that gives the same output
i have changed your code a little bit to make it work on ACF
<cfscript>
test["CaseMatTers"] = true;
writedump(test);
writeoutput(toScript(test, 'test')); // --> test=new Object();test["casematters"]="true";
</cfscript>
when you run this code (for example on cflive.net) you get exact the same output on ACF, we could think about a new argument for this function to have impact on this behaviour, but you can also simply use serializeJson(test) instead.

Micha


2013/7/25 Chris Blackwell <ch...@team193.com>

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
/micha

Michael Offner CTO Railo Technologies GmbH

Adam Cameron

unread,
Jul 27, 2013, 1:13:46 PM7/27/13
to ra...@googlegroups.com
Hi Micha
Fair enough that you are following ColdFusion's behaviour here I guess.

That said, can you see any reason why the ColdFusion behaviour itself is not a bug, rather than actual desired behaviour?

--
Adam
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Mark Drew

unread,
Jul 27, 2013, 2:43:13 PM7/27/13
to ra...@googlegroups.com

Hmm… it looks like a bug surely? Since one is creating a JavaScript object, javascript being case sensitive, one would then expect the function to respect case wouldn't one?


Regards
Mark Drew

The Railo Company
Professional Open Source
skype: mark_railo ma...@getrailo.com
+44 7971 852296 http://www.getrailo.com

Adam Cameron

unread,
Jul 27, 2013, 3:16:25 PM7/27/13
to ra...@googlegroups.com
Well that's my feeling. ColdFusion needs to pull its socks up when it comes to data interchange with other systems: respecting things like typefulness (where it can be inferred... and Railo does a bloody good job of this), and case-sensitivity etc.

I can't see how this isn't just sloppiness in ColdFusion, and can't be their actual intent?

In which case I question (but it is a question, not a statement dressed up as one) whether this is the sort of thing Railo should be following CF's lead on, for the sake of completeness.

(NB: I know this is a reversal on my traditional position on "Railo should copy CF warts 'n' all". I've changed my opinion on the merits of Adobe's persistence in interfering with the CFML community recently, as some of you might know).

-- 
Adam 

Adam Cameron

unread,
Jul 27, 2013, 4:07:26 PM7/27/13
to ra...@googlegroups.com
That was my take on it. ColdFusion is wrong here.

-- 
Adam


--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

Adam Cameron

unread,
Jul 27, 2013, 4:09:55 PM7/27/13
to ra...@googlegroups.com
Oops. Sorry for  the double reply there. I've got dodgy connectivity here (free pub wifi in Portumna, Co. Galway), and I thought my initial reply had gone west. But... no.

-- 
Adam

AJ Mercer

unread,
Jul 27, 2013, 8:31:46 PM7/27/13
to ra...@googlegroups.com
with the key being in quotes, I think Railo should treat it the same as test["CaseMatTers"] = true

test = {
"CaseMatTers": true
}

May be ACF compatibility there could be (no quotes)
test = {
CaseDoesNotMatters: true
}

OR

use the 'Dot notation' setting in 'Settings - Language/Compiler'
    /railo-context/admin/web.cfm?action=server.compiler




For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Offner

unread,
Jul 28, 2013, 10:51:18 AM7/28/13
to ra...@googlegroups.com
With Railo 4.0 we added a setting to the railo admin to avoid, that the compiler convert key defined with dot notation to upper case, in the same place we could also add a flag for this setting. 

Micha
Reply all
Reply to author
Forward
0 new messages