tracker issue : CF-3740276

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: implicit struct|array overrides short-circuiting

| View in Tracker

Status/Resolution/Reason: Needs Review//EnhancementRequired

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 04/10/2014

Components: Core Runtime

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: PublicBeta /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 3

implicit struct|array overrides short-circuiting

Steps to reproduce:

 
{code}
<cfscript>
 function bar(){
 writeDump(ARGUMENTS);
 abort; 
 }
 
if(structKeyExists(variables, "foo") and bar({something=variables.foo})){
	writeOutput("example 1");}//exception: Element FOO is undefined in VARIABLES.
	if(structKeyExists(variables, "foo") and bar([variables.foo])){
		writeOutput("example 2");
	}//exception: Element FOO is undefined in VARIABLES.
	if(structKeyExists(variables, "foo") and invoke("", "bar", {something=variables.foo})){
		writeOutput("example 3");
	}//exception: Element FOO is undefined in VARIABLES
	if(structKeyExists(variables, "foo") and invoke("", "bar", [variables.foo])){
		writeOutput("example 4");
	}//exception: Element FOO is undefined in VARIABLES
</cfscript>
{code}
 

bar() is never called (good) but the implicit struct and array are evaluated (bad)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID: 3740276

External Customer Info:
 External Company: 
 External Customer Name: itisdesign
 External Customer Email:

Attachments:

Comments:

Related thread: http://prerelease.adobe.com/r/?c691aea7c66a48f5bfafde5ea13b23a5 Please close #CF-3740241 as being a duplicate of this one.
Comment by External U.
12700 | April 10, 2014 03:40:13 AM GMT
#CF-3740241 can be closed and marked a duplicate of this one. When filing #CF-3740241, I misunderstood the issue. Thanks, -Aaron
Comment by External U.
12701 | April 10, 2014 03:47:40 AM GMT
Well it's been a while since we had a bug in literal notation. +1 -- Adam
Vote by External U.
12713 | April 10, 2014 03:51:33 AM GMT
Agree that it is a bug but it is difficult to fix because of the design limitation. Deferring it.
Comment by Rupesh K.
12702 | November 17, 2014 12:20:28 AM GMT
Hi Rupesh, Thanks for your reply. Will it be documented on the struct and array pages? Example for Struct page (https://wikidocs.adobe.com/wiki/display/coldfusionen/Creating+and+using+structures): Structure notation overrides short-circuiting. The following line, for example, generates an error if variables.foo is undefined: if(false and myFunction({myVar=variables.foo})) {} Example for Array page (https://wikidocs.adobe.com/wiki/display/coldfusionen/Basic+array+techniques): Array notation overrides short-circuiting. The following line, for example, generates an error if variables.foo is undefined: if(false and myFunction([variables.foo])) {} Searched but didn't find a page that mentions short-circuit booleans. If there is such a page, then it should probably be documented there too. Thanks!, -Aaron
Comment by External U.
12703 | November 18, 2014 03:29:44 AM GMT
Hey, Rupesh, what do you mean "deferring it"? You're right at the beginning of the dev phase for CF12, so until when are you deferring it? Do you actually mean "not fixing"? Perhaps if so, you should say that.
Comment by External U.
12704 | November 18, 2014 04:00:01 AM GMT
As I said, this is a design limitation and fixing this would need almost a re-write for implicit struct/array implementation, which we will not be able to take up for this release. Since it is a language bug that should be fixed, we are deferring it for future.
Comment by Rupesh K.
12705 | November 19, 2014 01:00:08 AM GMT
Ugh, forgetful me, just ran into this again. These gotchas should be documented! Thanks!, -Aaron
Comment by External U.
12706 | July 22, 2015 03:04:51 PM GMT
Hi Rupesh, Just checking to see if this can be considered for CF12. Thanks!, -Aaron
Comment by External U.
12707 | October 27, 2015 10:54:30 PM GMT
No, it would not be taken up for CF 12. We would consider it for the next.
Comment by Rupesh K.
12708 | October 27, 2015 11:02:44 PM GMT
Hi Rupesh, Thanks for the follow-up and for considering it for the next. -Aaron
Comment by External U.
12709 | October 27, 2015 11:05:28 PM GMT
This bug is annoying.
Comment by External U.
12710 | December 30, 2015 05:01:49 PM GMT
Hi Rupesh, Just checking to see if this can be considered for Aether. Thanks!, -Aaron
Comment by Aaron N.
12711 | February 11, 2017 07:47:33 AM GMT
Please reopen and assess for CF-next. If it requires a rewrite of the array / struct -literal implementation (which, face it, as been a bug-ridden shambles from the outset, so you probably do), then you'll wanna get onto it fairly early in the piece. I presume yer already at least planning CF-next, if not actually underway with development.
Comment by Adam C.
12712 | February 16, 2017 11:53:01 AM GMT
Confirmed: this bug is still annoying. After 4yrs, it is still an annoying bug =P Just a status update, since Adobe isn't providing one =P Thanks!, -Aaron
Comment by Aaron N.
29350 | July 14, 2018 06:33:41 AM GMT