tracker issue : CF-4119653

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

Setting non-scoped variable in a udf in CF2016 behaves differently from CF11

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Mingo Hagen / Mingo Hagen (Mingo Hagen)

Created: 02/19/2016

Components: Language, Scopes

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: ALL / Platforms All

Vote Count: 11

Listed in the version 2016.0.01.298513 Issues Fixed doc
Verification notes: verified_fixed on September 29, 2019 using build 2016.0.01.298513
Related Bugs:
CF-4031746 - Similar to


Problem Description:

Setting a non-scoped variable in a udf in CF2016 behaves differently from CF11. In CF11 the repro code below would work, now it throws an error.

Steps to Reproduce:

<cfscript>
function foo( bar ) {
    bar = "test";
    writeDump( arguments.bar );
}

foo();
</cfscript>

Actual Result:

Element BAR is undefined in ARGUMENTS.
 
The error occurred in {path-to}/index.cfm: line 4
2 : function foo( bar ) {
3 :     bar = "test";
4 :     writeDump( arguments.bar );
5 : }
6 : 

Expected Result:

According to the scope priority in the CF docs, I would think setting without scope would fall back to arguments.bar (since there is an argument named bar) and then to local.bar, but the code above sets variables.bar to "test".

Any Workarounds:

use explicit scopes

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

Watson Bug ID:	4119653

External Customer Info:
External Company:  
External Customer Name: Mingo Hagen
External Customer Email:  
External Test Config: My Hardware and Environment details:



CF2016 on Windows 10

Attachments:

Comments:

See http://blog.adamcameron.me/2016/02/coldfusion-2016-critical-regression-in.html for more tests
Comment by External U.
4611 | February 19, 2016 03:13:27 AM GMT
(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote
Vote by External U.
4615 | February 19, 2016 03:25:31 AM GMT
Never ignore coincidence. Unless, of course, you’re busy. In which case, always ignore coincidence.
Vote by External U.
4616 | February 19, 2016 07:57:00 AM GMT
bad bug, fix, bad bug, fix, bad bug, fix, bad bug, fix, bad bug, fix, bad bug, fix
Vote by External U.
4617 | February 19, 2016 01:11:39 PM GMT
This bug will totally break my app
Vote by External U.
4618 | February 19, 2016 01:21:42 PM GMT
NB, the new searchImplicitScopes setting does not influence this behavior.
Comment by External U.
4612 | February 19, 2016 02:22:55 PM GMT
This is not expected.
Vote by External U.
4619 | February 23, 2016 06:57:30 AM GMT
When is the fix for this projected to be released?
Comment by External U.
4613 | March 21, 2016 11:31:30 PM GMT
The fix will be made available with CF2016 HF1.
Comment by Awdhesh K.
4614 | March 21, 2016 11:44:54 PM GMT
My understanding is that Mura CMS will not work without this fix. That is certainly true for me.
Vote by External U.
4620 | May 03, 2016 02:31:21 PM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
31453 | September 29, 2019 06:02:37 AM GMT