tracker issue : CF-4202219

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

[ANeff] Bug for: some BIFs are not 1st class

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

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

Created: 04/30/2018

Components: Language, Functions

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) /

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: isNULL, location, parameterExists, preserveSingleQuotes, quotedValueList, throw, trace, valueList, writeDump and writeLog are not 1st class


  function f(a) {
  f(isNULL)//throws Variable ISNULL is undefined.

Actual Result: exception "Variable ISNULL is undefined."

Expected Result: YES

It doesn't matter if those functions are _currently_ not coldfusion.runtime.CFPageMethod. The issue is that they need to be.



Related thread:
Comment by Aaron N.
27609 | April 30, 2018 10:21:50 PM GMT
Analysis: ------------ The mentioned functions have compiler level transformations being done and then the resultant function call is generated. For example, isNull(struct.key1.key2) – this call gets expanded to first see if struct is page variable, if so, it injects a call to get the pageVar then it injects nested resolve function calls for key1 and key2. So, these functions due to internal compiler optimizations and transformations can't be made first class.  Hence , closing the bug.
Comment by Vijay M.
30774 | May 17, 2019 12:21:38 PM GMT
Hi Vijay, I've created CF-4204402 for parameterExists,preserveSingleQuotes,quotedValueList,valueList. Those are CFPageMethod, so a separate issue. Thanks!, -Aaron
Comment by Aaron N.
30789 | May 21, 2019 05:01:51 AM GMT
Hi Vijay, Thank you very much for the discussion. Regarding the isNull transformation blocker you've described, how does it affect `isNull(struct.key1.key2)` but not `isArray(struct.key1.key2)`, for example? The `struct` variable would always be a page variable in both cases, right? What are the transformation blockers for each of: location, throw, trace, writeDump and writeLog? Thanks!, -Aaron
Comment by Aaron N.
30794 | May 21, 2019 07:19:10 AM GMT
<cfscript> bifs = getFunctionList().keyList().listSort("textnocase") notSoClassyBIFs=[] for(bif in bifs) { try { foo = evaluate(bif) //writeOutput(bif & ': ' & foo.getClass().getName() & '<br>') } catch(any e) { notSoClassyBIFs.append(bif) writeOutput('<span style="color:red;">' & bif & ': ' & e.message & '</span><br>') } } writeDump(notSoClassyBIFs) </cfscript> Can we fix the notSoClassyBIFs, so that CF can be 100% classy? :)
Comment by Aaron N.
30795 | May 21, 2019 07:44:25 AM GMT