[OpenLayers-Trac] Re: [OpenLayers] #3447: Bleeding of variables

OpenLayers trac-20090302 at openlayers.org
Tue Aug 2 13:53:09 EDT 2011

#3447: Bleeding of variables
  Reporter:  jonasenander     |       Owner:  tschaub     
      Type:  bug              |      Status:  closed      
  Priority:  minor            |   Milestone:  2.12 Release
 Component:  BaseTypes.Class  |     Version:  2.10        
Resolution:  invalid          |    Keywords:              
     State:                   |  
Changes (by pagameba):

  * status:  new => closed
  * resolution:  => invalid


 This is an expected behaviour.  I have seen the same behaviour in other
 javascript 'class' systems where initializing a property as an array when
 defining a class causes all instances of that class to share a reference
 to the array (prototype, mootools).  In the case of an object, you might
 find that if you did something like myInst.clsObj.x = 'x';
 myInst2.clsObj.y = 'y' you would find that both myInst and myInst2 would
 have an x and a y property.

Ticket URL: <http://trac.openlayers.org/ticket/3447#comment:2>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer

More information about the Trac mailing list