Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

CFEasyMock
Project Home Blog Forums Wiki Known Issues Contact Project

CFEasyMock Issue: Error if CFC has no methods

Name: Error if CFC has no methods
ID: 4
Project: CFEasyMock
Type: Bug
Area: Code
Severity: Low
Status: Closed
Related URL:
Creator: Ryan Wood
Created: 04/18/08 10:57 AM
Updated: 04/18/08 5:09 PM
Description: This is an edge case, but I have a CFC that extends another but has no methods yet. When I run my tests, I get:

Element METADATA.FUNCTIONS is undefined in ARGUMENTS.

COLUMN     0
ID    CF_DOTRESOLVER
LINE    38
RAW_TRACE    at cfMetaDataInjector2ecfc2131214936$funcRECURSEMETHODS.runFunction(C:\code\cfmx\extensions\components\reflect\MetaDataInjector.cfc:38)
TEMPLATE    C:\code\cfmx\extensions\components\reflect\MetaDataInjector.cfc
TYPE    CFML

Wrapping an if block around current code fixes it:

   <cfif structKeyExists( arguments.metaData, 'functions' )>
   <cfloop from="1" to="#arrayLen( arguments.metaData.functions )#" index="x">
      <cfif NOT structKeyExists( arguments.metaData.functions[ x ], "access" ) OR arguments.metaData.functions[ x ].access neq "private">
         <cfset methodStruct[ arguments.metaData.functions[ x ].name ] = extractFunction( arguments.className, arguments.metaData.functions[ x ] ) />
      </cfif>
   </cfloop>
</cfif>

(I guess there is no way to upload a patch. I'll send it in an email.)

-Ryan
History: Created by ryanwood (Ryan Wood) : 04/18/08 10:57 AM

Updated by m_steele (Michael Steele) : 04/18/08 5:09 PM
Ryan was given SVN access and uploaded the patch. Will be placed into the ZIP tonight.

Updated by m_steele (Michael Steele) : 04/18/08 5:09 PM

To add a comment to this bug, please login using the link above.