Hi,

I am using ObjectUtil.copy to deep copy an object.

The following code works: (note the call to new)

var catTreeLocalToFiltered:CategoryTree = new CategoryTree() ;

catTreeLocalToFiltered = ObjectUtil.copy(categoriesTree) as CategoryTree ;

The problem is that the following code DOES NOT WORK:(note the absense
of new)

var catTreeLocalToFiltered:CategoryTree =
ObjectUtil.copy(categoriesTree) as CategoryTree ;

Actually it semi works. The first time catTreeLocalToFiltered is the
same as categoriesTree. 

The second time catTreeLocalToFiltered does not become equal to
categoriesTree but becomes equal to itself as it was after the first call.

Are bytes cached for local variables if new is not explicitly used?

Anybody from Adobe?

PS: All this was checked/found out in the debugger stepping throught
the code line by line...

Thanks,
Fotis

Reply via email to