In CF10, why do structure members become undefined?

The code below has some unexpected behavior in CF10, especially compared to CF8 (I have not tried in CF9).

On line 6, some previously defined members of the structure become undefined. What for? Is this a mistake or did I miss a note?

<cfset struct = structNew()>
<cfset struct["x.foo"] = 1>            <!--- LINE 2 --->
<cfset struct["x.bar"] = 2>            <!--- LINE 3 --->
<cfdump var="#struct#" label="before"> <!--- struct["x.foo"] & struct["x.bar"] have values (they're defined) at this point --->

<cfset struct["x"] = structNew()>      <!--- LINE 6: in CF10 struct["x.foo"] & struct["x.bar"] become undefined --->
<cfdump var="#struct#" label="after">

<h3>Coldfusion Version</h3>
#server.coldfusion.productversion#

Coldfusion 10 outputColdfusion 8 output

Thanks for watching.

+4
source share
1 answer

Sounds like you're experiencing what I'm documenting on my blog? " Odd behavior using struct keys with periods in their names ."

It's a little late to raise regressions that affect ColdFusion 8, but you can raise a ticket using Adobe if you want. They will just ignore him, though.

In addition, the only significant reaction is "well, now you know." Excuse me: -/

+5
source

Source: https://habr.com/ru/post/1545999/


All Articles