first step of deprecating copyOf() functions, to be replaced with clone()

git-svn-id: http://svn.openlayers.org/trunk/openlayers@943 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-14 12:59:08 +00:00
parent a3aa327d2f
commit eb6c2a6346

View File

@@ -41,9 +41,18 @@ OpenLayers.Pixel.prototype = {
},
/**
* @type OpenLayers.Pixel
*/
* @deprecated
*
* @type OpenLayers.Pixel
*/
copyOf:function() {
return this.clone();
},
/**
* @type OpenLayers.Pixel
*/
clone:function() {
return new OpenLayers.Pixel(this.x, this.y);
},
@@ -124,10 +133,20 @@ OpenLayers.Size.prototype = {
},
/**
* @return New OpenLayers.Size object with the same w and h values
* @type OpenLayers.Size
*/
* @deprecated
*
* @return New OpenLayers.Size object with the same w and h values
* @type OpenLayers.Size
*/
copyOf:function() {
return this.clone();
},
/**
* @return New OpenLayers.Size object with the same w and h values
* @type OpenLayers.Size
*/
clone:function() {
return new OpenLayers.Size(this.w, this.h);
},
@@ -193,10 +212,20 @@ OpenLayers.LonLat.prototype = {
},
/**
* @return New OpenLayers.LonLat object with the same lon and lat values
* @type OpenLayers.LonLat
*/
* @deprecated
*
* @return New OpenLayers.LonLat object with the same lon and lat values
* @type OpenLayers.LonLat
*/
copyOf:function() {
return this.clone();
},
/**
* @return New OpenLayers.LonLat object with the same lon and lat values
* @type OpenLayers.LonLat
*/
clone:function() {
return new OpenLayers.LonLat(this.lon, this.lat);
},
@@ -288,10 +317,20 @@ OpenLayers.Bounds.prototype = {
},
/**
* @returns A fresh copy of the bounds
* @type OpenLayers.Bounds
*/
* @deprecated
*
* @returns A fresh copy of the bounds
* @type OpenLayers.Bounds
*/
copyOf:function() {
return this.clone();
},
/**
* @returns A fresh copy of the bounds
* @type OpenLayers.Bounds
*/
clone:function() {
return new OpenLayers.Bounds(this.left, this.bottom,
this.right, this.top);
},
@@ -609,16 +648,26 @@ Array.prototype.remove = function(item) {
return this;
}
/**
* @deprecated
*
* @returns A fresh copy of the array
* @type Array
*/
Array.prototype.copyOf = function() {
return this.clone();
};
/**
* @returns A fresh copy of the array
* @type Array
*/
Array.prototype.copyOf = function() {
var copy = new Array();
Array.prototype.clone = function() {
var clone = new Array();
for (var i = 0; i < this.length; i++) {
copy[i] = this[i];
clone[i] = this[i];
}
return copy;
return clone;
};
/**