[OpenLayers-Trac] [OpenLayers] #3494: OpenLayers.Util.isArray issue with custom Array

OpenLayers trac-20090302 at openlayers.org
Sun Sep 11 12:47:16 EDT 2011


#3494: OpenLayers.Util.isArray issue with custom Array
------------------------------+---------------------------------------------
 Reporter:  johanhasselstrom  |       Owner:              
     Type:  bug               |      Status:  new         
 Priority:  minor             |   Milestone:  2.12 Release
Component:  Util              |     Version:  2.11 RC3    
 Keywords:                    |       State:              
------------------------------+---------------------------------------------
 I recently discovered a possible issue with the OpenLayers.Util.isArray
 -function. If a custom array is used that inherits from the standard
 array, the isArray will return false.


 {{{
 var MyArray = function(){
 };
 MyArray.prototype = new Array();

 var anArray = new MyArray();

 anArray instanceof Array; //true (the 'old' behaviour of OpenLayers)
 OpenLayers.Util.isArray(anArray); //false
 }}}

 Tested in FF 3.6.15 and IE9.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3494>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list