tracker issue : CF-3039697

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

Bug 79480:(Watson Migration Closure)ColdFusion 8 and now 9 do not allow access to private and package functions through the "this" scope even when the function called from within the component definition that defines the package or priv

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/LowImpact

Reporter/Name(from Bugbase): Brett Suwyn / Brett Suwyn (WF Software)

Created: 08/18/2009

Components: Language, CF Component

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,247238 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 5

Problem:

ColdFusion 8 and now 9 do not allow access to private and package functions through the "this" scope even when the function called from within the component definition that defines the package or private function.This limits the ability to chain methods together and makes CFML much more verbose than it needs to be.  It is very convenient to return this (<cfreturn this />) and to use that return object to call more methods.  i.e. myPage.setTitle(“My Page Title”).validateTitle().save()
Method:

Create a component and define two functions, one private and one public.  From the public  function call the private function with this.PrivateFunction().  Create a template to create the component object and request the public function.ColdFusion will throw an invalid function access error reporting that the private function cannot be called even though it is being called from within the component definition.See the CFML Compatibility Report for more information on this:  http://bit.ly/info/o7zLq
Result:

Access was to the function was restricted

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

Watson Bug ID:	3039697

External Customer Info:
External Company:  
External Customer Name: Brett Suwyn
External Customer Email: 1E736C5744AAE692992016B7
External Test Config: 08/18/2009

Attachments:

Comments:

This bug has been voted..
Vote by External U.
23032 | November 10, 2011 07:02:06 PM GMT
This bug has been voted..
Vote by External U.
23033 | November 10, 2011 07:02:07 PM GMT
-1 vote. (note to Adobe: that's a NEGATIVE vote). It's currently working as one would expect. One should NOT be able to do this: myObj.myPrivateMethod() or myObj.myPackageethod() The whole point of restricted methods is that they *can't* be called externally. -- Adam
Vote by External U.
23034 | November 10, 2011 07:02:08 PM GMT
This bug has been voted..
Vote by External U.
23035 | November 10, 2011 07:02:09 PM GMT
This bug has been voted..
Vote by External U.
23036 | November 10, 2011 07:02:10 PM GMT