Hi skar,

this article should answer your question:
http://qooxdoo.org/documentation/1.0/antipatterns#reference_types_in_member_section

Regards,
Daniel

skar schrieb:
> Hi,
> 
> I've got a class like this:
> 
> qx.Class.define("testproject.ArrayClass",
> {
>   extend: qx.ui.basic.Atom,
> 
>   construct : function()
>   {
>     arguments.callee.base.apply(this);
>     this.arr2 = new Array();
>   },
>   members : {
>     arr : new Array()
>    }
> });
> 
> Now, I do the following:
> 
> s1=new testproject.ArrayClass();
> s2=new testproject.ArrayClass();
> s1.arr==s2.arr -> evaluates to true
> s1.arr2==s2.arr2 -> evaluates to false
> 
> Now pushing any object/value into s1.arr results in s2.arr also having 
> the same values. Both the arrays point to the same array values. Why 
> does arr2 result in per instance arrays while arr has the same array 
> being shared across all the instances?
> 
> I'm using qx 1.0.1.
> 
> cheers,
> skar.
> 


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to