[Jspro-cvs] jsPro array.js,1.23,1.24
Brought to you by:
wigleys
|
From: <gat...@us...> - 2003-09-15 03:26:28
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv2660
Modified Files:
array.js
Log Message:
QA: Array.prototype.changeKeyCase()
Index: array.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/array.js,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** array.js 12 Sep 2003 14:22:08 -0000 1.23
--- array.js 15 Sep 2003 03:26:23 -0000 1.24
***************
*** 27,39 ****
/**
! * Changes the case of array keys to upper or lowercase
*
* @summary change key case
* @author Stuart Wigley
! * @version 1.0, 09/12/03
* @interface <code>Array.changeKeyCase(iCase)</code>
! * @param iCase an integer representing the case (lowercase: 0;
! * uppercase: 1;)
! * @return an array with keys changed to upper or lowercase
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
--- 27,40 ----
/**
! * Changes the case of all array keys to lowercase or uppercase.
*
* @summary change key case
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/14/03
* @interface <code>Array.changeKeyCase(iCase)</code>
! * @param iCase an integer representing the case to change array keys
! * to (lowercase: 0; uppercase: 1)
! * @return an array with keys changed to lowercase or uppercase
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
***************
*** 58,65 ****
for (var sKey in this) {
if (this.hasOwnProperty(sKey)) {
-
var sKeyCase = (iCase == 1) ? sKey.toUpperCase() : sKey.toLowerCase();
if (sKeyCase != sKey) {
-
this[sKeyCase] = this[sKey];
delete this[sKey];
--- 59,64 ----
|