Title:
Bug 82579:(Watson Migration Closure)Function call should be allowed on any expression that yields a function:
| View in TrackerStatus/Resolution/Reason: To Test//Fixed
Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)
Created: 04/01/2010
Components: Language
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,251028 /
Priority/Frequency: Minor / Unknown
Locale/System: English / Mac 10 All
Vote Count: 16
Problem:
Function call should be allowed on any expression that yields a function:
s[key]( args ); // should be legal
arr[ n ]( args ); // should be legal for array of functions
func()( args ); // should be legal for func() returning a function
In particular:object[ method ]( args ); // should be legal and equivalent to:evaluate( "object.#method#( args )");
This is the script equivalent of:<cfcomponent component="#object#" method="#method#" argumentCollection=... />
Without this there's no way to do dynamic method invocation in <cfscript> without evaluate() - ugh!
Method:
\\blrfs04.macromedia.com\builds\coldfusion\bugs\82579
Result:
Invalid construct.A script statement must end with ";".The CFML compiler was processing:A script statement beginning with s on line 5, column 1.A script statement beginning with function on line 2, column 1.A cfscript tag beginning on line 1, column 2. The error occurred in /Applications/ColdFusion9/wwwroot/cf9/syntax.cfm: line 53 : s = { fn = greet };4 : s.fn(); // works5 : s['fn'](); // illegal
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041263
External Customer Info:
External Company:
External Customer Name: Sean Corfield
External Customer Email: 479B4EDC43F3A88B992016B6
External Test Config: 04/01/2010
Attachments:
Comments: