OpenLayers OpenLayers

Changeset 3636

Show
Ignore:
Timestamp:
07/06/07 18:55:17 (1 year ago)
Author:
euzuro
Message:

fix for #787 - put clearArray() in its place ((marked as deprecated, throwing a console warning during use, all usage replaced in code))

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/WFS.js

    r3584 r3636  
    386386            if (this.vectorMode) { 
    387387                this.renderer.clear(); 
    388                 OpenLayers.Util.clearArray(this.features)
     388                this.features.length = 0
    389389            } else {    
    390390                this.clearMarkers(); 
    391                 OpenLayers.Util.clearArray(this.markers)
     391                this.markers.length = 0
    392392            }     
    393393            this.tile.draw(); 
  • trunk/openlayers/lib/OpenLayers/Util.js

    r3545 r3636  
    7272/** 
    7373 * Function: clearArray 
    74 */ 
     74 * *Deprecated*. This function will disappear in 3.0. 
     75 * Please use "array.length = 0" instead. 
     76 *  
     77 * Parameters: 
     78 * array - {Array} 
     79 */ 
    7580OpenLayers.Util.clearArray = function(array) { 
     81    var msg = "OpenLayers.Util.clearArray() is Deprecated." + 
     82              " Please use 'array.length = 0' instead."; 
     83    OpenLayers.Console.warn(msg); 
    7684    array.length = 0; 
    7785}; 
  • trunk/openlayers/tests/test_Util.html

    r3328 r3636  
    3131 
    3232    function test_03_Util_Array(t) { 
    33         t.plan( 2 ); 
     33        t.plan( 1 ); 
    3434 
    3535        var array = new Array(1,2,3,4,5); 
     
    3737        OpenLayers.Util.removeItem(array, 3); 
    3838        t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");     
    39  
    40         OpenLayers.Util.clearArray(array); 
    41         t.eq( array.toString(), "", "Util.clearArray works");     
    42          
    4339    } 
    4440