Subj : Re: Object copying To : Jashin Eugene From : Brendan Eich Date : Wed Jun 02 2004 10:59 pm Jashin Eugene wrote: > Hello. > I can't clearly understand what happened in this case: > > var a = new Object; //or var a = make_me_obj();, where make_me_obj > creates user defined object from C++. > var b = a; > > the var b will have the copy of value a or just another reference to an > object in var a? Just the reference -- objects are reference types in JS, as in Java. What is entailed by copying an object depends on the class of the object and how you use it, so it's up to you to make a copy or clone method. You need to allocate and set private data in any constructor-like native function you write, of course. The JSClass.finalize hook should get and deallocate the private data for the object being finalized. /be .