Just a quick one. Have a look at this code:
// MY.cfc
component {
function inComponent(){
}
}
<!---test.cfm --->
<cfscript>
o = new My();
function inCallingCode(){
}
o.fromCallingCode = inCallingCode;
writeDump(var=o, label="Object"); // outputs f() in the "methods" part of the dump
writeOutput("<hr />");
for (key in o){
writeDump(var=o[key], label="Each public variable: #key#");
}
writeOutput("<hr />");
writeDump(var=getMetadata(o), label="getMetadata()"); // what would you expect to see in the "functions" sub-array of this?
writeOutput("<hr />");
try{
writeOutput("Calling o.fromCallingCode()<br />");
o.fromCallingCode();
writeOutput("OK<br />");
} catch(any e){
writeOutput("#e.message# #e.detail#<br />");
}
try{
writeOutput("Calling o.inCallingCode()<br />");
o.inCallingCode();
writeOutput("OK<br />");
} catch(any e){
writeOutput("#e.message# #e.detail#<br />");
}
</cfscript>
This outputs much the same thing on both CF9 and Railo 4.0.0.013:
Object - component cf.cfml.functions.system.getMetadata.My | |||
---|---|---|---|
METHODS |
|
Each public variable: inComponent - function inComponent |
---|
Each public variable: FROMCALLINGCODE - function inCallingCode |
---|
getMetadata() - struct | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EXTENDS | |||||||||||||
FULLNAME | cf.cfml.functions.system.getMetadata.My | ||||||||||||
FUNCTIONS |
| ||||||||||||
NAME | cf.cfml.functions.system.getMetadata.My | ||||||||||||
PATH | D:\websites\www.scribble.local\cf\cfml\functions\system\getMetadata\My.cfc | ||||||||||||
TYPE | component |
Calling o.fromCallingCode()
OK
Calling o.inCallingCode()
The method inCallingCode was not found in component D:\websites\www.scribble.local\cf\cfml\functions\system\getMetadata\My.cfc. Ensure that the method is defined, and that it is spelled correctly.
What I was expecting here is that I'd see a method fromCallingCode() being cited in all three of those dumps. What would you expect to see?
There's a coupla problems here from my perspective:
- How is it that the first dump things the method name is inCallingCode() when I inserted it into the object as fromCallingCode()?
- Where is it at all in the functions array returned from getMetadata()?
So what do you think: bug? Am I missing something?
--
Adam