tracker issue : CF-4152471

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

[ANeff] ER for: member functions should return a useful value

| View in Tracker

Status/Resolution/Reason: To Test//Fixed

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 05/12/2016

Components: Language, Member Functions

Versions: 2016

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 2

3844976 fixed .append() member functions to return a useful value for chaining. Same should be done for these member functions: .clear(), .insert(), .insertAt(), .update(), .resize(), .set(), .swap(), .addColumn(), .addRow() and .setCell().

Repro:
{code:java}
<cfscript> 
  a = ["a", "b", "c"];
  s = {"a"=1, "b"=2, "c"=3};
  q = queryNew("col1", "varchar", [["a"], ["b"], ["c"]]);
  
  a.clear().append("d").each(function(e) {writeOutput(e);});//should return "d"
  s.clear().append({"d"=4}).each(function(k,v) {writeOutput(k);});//should return "d"
  
  a.insertAt(2, "a2").each(function(e) {writeOutput(e);});//should return aa2bc
  s.insert("a2", 11).each(function(k,v) {writeOutput(k);});//should return aa2bc
  
  s.update("a", 11).each(function(k,v) {writeOutput(v);});//should return 1123
  
  a.resize(4).each(function(e,i) {writeOutput(i);});//should return 1234
  a.set(2, 4, 0).each(function(e) {writeOutput(e);});//should return a000
  a.swap(2, 3).each(function(e) {writeOutput(e);});//should return acb
  
  q.addColumn("col2", []).each(function(r) {writeOutput(r.col1);});//should return abc
  q.addRow({col1="d"}).each(function(r) {writeOutput(r.col1);});//should return abcd
  q.setCell("col1", "b2", 2).each(function(r) {writeOutput(r.col1);});//should return ab2c
</cfscript>
{code}

Actual behavior: exceptions

Expected behavior: see script comments

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

Watson Bug ID:	4152471

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:

Attachments:

Comments:

Additional related tickets: CF-4152447,CF-4152461,CF-4152465
Comment by External U.
2840 | May 12, 2016 11:19:46 PM GMT