Ticket #2527901 (closed enhancement)

Reporter


Michael Hasenstein
Opened: 05/13/09
Last modified: 09/19/12
Status: closed
Type: enhancement
Resolution: fixed

Owner


Dav Glass
Target Release: 3.NEXT
Priority: P3 (normal)
Summary: Add parameter to Array.unique: an optional comparison function
Description:

Problem: Array.unique is useless for arrays of objects - UNLESS I can provide as an additional parameter a function to do the comparison, which if provided replaces the built-in default comparison.

Type: enhancement Observed in Version: development master
Component: YUI Global Object Severity: S3 (normal)
Assigned To: Dav Glass Target Release: 3.NEXT
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Change History

George

YUI Developer

Posted: 05/14/09
  • component changed from None to YUI Global Object
  • owner changed from Adam Moore to Adam Moore
  • priority changed to P3 (normal)
  • status changed from new to assigned

Adam Moore

YUI Contributor

Posted: 05/14/09
  • milestone changed to FUTURE
  • status changed from assigned to accepted

George

YUI Developer

Posted: 04/20/11

Dav Glass

Posted: 04/26/11
  • location changed to Library Code
  • milestone changed from FUTURE to 3.4.0
  • status changed from assigned to accepted

Dav Glass

Posted: 05/13/11

Ryan Grove

YUI Developer

Posted: 05/13/11
  • milestone changed from 3.4.0 to 3.NEXT
  • status changed from assigned to accepted

I agree this is necessary. It'll probably have to wait for 3.5.0 though, because Y.Array.unique() currently supports a "sort" parameter that was silently deprecated in 3.3.0. I'll want to remove that param to make way for a comparator function param, but we'll need to message its pending removal at least one release ahead of time in case existing code depends on it.

We can do that messaging in 3.4.0, then replace the param in 3.5.0.

Ryan Grove

YUI Developer

Posted: 09/13/11
  • milestone changed from 3.NEXT to 3.5.0

Ryan Grove

YUI Developer

Posted: 09/13/11
  • estimated changed from 0 to 0.2
  • remaining changed from 0 to 0.2
  • sprint changed to sprint 2

Ryan Grove

YUI Developer

Posted: 04/9/12
  • milestone changed from 3.5.0 to 3.NEXT

Ryan Grove

YUI Developer

Posted: 05/10/12

Array.unique(): remove deprecated sort param, add optional test function [Ticket #2527901]

The sort parameter was deprecated back in 3.3.0.
View Commit: 034665da3b46cefc8a09a02d75825bfd6caefc2c

Dav Glass

Posted: 05/15/12

Dav Glass

Posted: 05/15/12
  • status changed from assigned to checkedin

Andrew Wooldridge

Posted: 09/19/12
  • resolution changed to fixed
  • status changed from checkedin to closed