tracker issue : CF-3037333

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

Bug 75106:(Watson Migration Closure)It's important that ColdFusion 9 support using colon-syntaxed property value pairs for object literal argument notation:

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)

Created: 01/20/2009

Components: Language

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 9

Problem:

It's important that ColdFusion 9 support using colon-syntaxed property value pairs for object literal argument notation:

<cfset testMethod( { property1: value1, property2: value2 } ) />

in addition to the current

<cfset testMethod( { property1 = value1, property2 = value2 } ) />


As Sean Corfield noted, CF already allows : in named arguments...

function func( foo, bar ) {

   return foo & bar;

}

x = func( foo : 42, bar : "answer" );

writeOutput(x);

Also:

x = func( argumentCollection : { foo = 42, bar = "answer" } );

So why not:

x = func( argumentCollection : { foo : 42, bar : "answer" } );
Method:


Result:

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

Watson Bug ID:	3037333

External Customer Info:
External Company:  
External Customer Name: David McGuigan
External Customer Email: 5E0D54C04462BF5E992016B6
External Test Config: 01/20/2009

Attachments:

Comments:

+1 vote. I rather think the severity here is overstated, but it'd be a "nice to have". -- Adam
Vote by External U.
24123 | November 10, 2011 07:13:51 PM GMT
+1, should be consistent with the named argument notation.
Vote by External U.
24124 | November 10, 2011 07:13:53 PM GMT
This bug has been voted..
Vote by External U.
24125 | November 10, 2011 07:13:55 PM GMT
This bug has been voted..
Vote by External U.
24126 | November 10, 2011 07:13:57 PM GMT
+1, I do agree that the named argument issue makes this an uncomfortable inconsistency and I'd classify this as a bug... it really does need to be fixed (and isn't probably too complicated to deal with, either).
Vote by External U.
24127 | November 10, 2011 07:13:59 PM GMT
I agree, but I'd personally like it to go even further and allow full JS Object Notation, even for cfc's, now that would be a leap forward.
Vote by External U.
24128 | November 10, 2011 07:14:01 PM GMT
This bug has been voted..
Vote by External U.
24129 | November 10, 2011 07:14:04 PM GMT
AS3 and JS (and Groovy) all use : so I'm definitely in favor of this enhancement to CFML to make it easier to jump between languages.
Vote by External U.
24130 | November 10, 2011 07:14:05 PM GMT
This bug has been voted..
Vote by External U.
24131 | November 10, 2011 07:14:08 PM GMT