today I found an interesting thing, which might be a bug.
See this code:
test := Object(), test.one := Object() test2 := test.clone() output() test := Object(), test.one := Object() test2 := Object(), test2.one := Object() output() test := Object(), test.one := Object() test2 := copyObject(test) output() ExitApp output() { global test.a := "empty", test.one.a := "a" MsgBox % "1: " . test.one.a . "`n2: " . test2.one.a . "`n`n" . "1: " . test.a . "`n2: " . test2.a } copyObject(input) { output := Object() for key, val in input output[key] := IsObject(val) ? copyObject(val) : val return output }Why is there a difference between cloning an Object that contains other (empty) objects and recreating the object myself? In my opinion, the Object.clone() function should clone the Object with all it's subobjects as it is at the moment and don't just keep the references of the subobjects.
I created a little function for myself that really copies an object and does not keep the references.
Can you tell me, if the way it is now is the way it is meant to be? If so, could you tell me why? I can't think of a reason for this.
Regards, nfl
[Moved from Bug Reports. ~jaco0646]