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

OpenLayers trac-20090302 at openlayers.org
Tue Aug 2 15:34:47 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:                   |  
------------------------------+---------------------------------------------

Comment(by erilem):

 You don't need !OpenLayers to observe that behavior.

 {{{
 C = function() {};
 C.prototype = {arr: []};

 c1 = new C;
 c2 = new C;

 c1.arr.push('foo');
 c2.arr.push('bar');

 console.log(c2.arr);
 console.log(c2.arr === c1.arr);
 }}}

 (Untested code)

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


More information about the Trac mailing list