tracker issue : CF-4150051

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

Elvis operator inside the closure is not working as expected

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): CF Mitrah MitrahSoft / CF Mitrah MitrahSoft (CF Mitrah MitrahSoft)

Created: 05/09/2016

Components: Core Runtime

Versions: 2016

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Win All

Vote Count: 1

Listed in the version 2016.0.02.299200 Issues Fixed doc
Problem Description: Elvis operator inside the closure is not working as expected

Steps to Reproduce:

Run the Try CF URLs to see the issue in CF 2016
http://trycf.com/gist/c7f8f74dc8d835270ba64abc25ef5e23/acf2016

It is working fine in CF 11
http://trycf.com/gist/c7f8f74dc8d835270ba64abc25ef5e23/acf11

Actual Result: undefined

Expected Result: I am null 

Any Workarounds: None

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

Watson Bug ID:	4150051

External Customer Info:
External Company:  
External Customer Name: CF Mitrah MitrahSoft
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Here's the code sample for posterity sake in case those links ever go dead. Expected output is "I am null", but null is returned. clos = function( func ) { func(); }; clos( function(){ clos( function(){ writeDump( foo ?: "I am null" ); } ); } );
Comment by External U.
2907 | May 09, 2016 07:18:58 AM GMT
This really messes with the TestBox BDD syntax since it uses nested closures just like the example code does. I know it looks a little weird, but it really is a real-world use case.
Vote by External U.
2910 | May 09, 2016 07:19:49 AM GMT
test note
Comment by CFwatson U.
2908 | June 07, 2016 04:17:07 AM GMT
The fix for this bug is available as part of the early-access build for ColdFusion 2016 Update 2.
Comment by CFwatson U.
2909 | June 07, 2016 04:23:50 AM GMT