Title:
Ternary operator doesn't short-circuit with implicit array/struct expressions
| View in TrackerStatus/Resolution/Reason: To Fix//Investigate
Reporter/Name(from Bugbase): Edward Keighley / Edward Keighley ()
Created: 03/06/2017
Components: Language, Expressions
Versions: 2016,11.0,10.0
Failure Type: Others
Found In Build/Fixed In Build: 11,0,10,300066 /
Priority/Frequency: Normal /
Locale/System: / Linux All
Vote Count: 8
Steps to Reproduce:
{code:java}
<cfscript>
a = 1; b = 1;
x = true ? [a++] : [b++];
writeDump(a);
writeDump(b);
writeDump(var=x, abort=true);
</cfscript>
{code}
Actual Result:
a==2
b==2
x==[1]
Expected Result:
a==2
b==1
x==[1]
Any Workarounds:
a = 1; b = 1;
if(true) x=[a++]; else x=[b++];
Attachments:
Comments: