Open LMnet opened 10 years ago
Look at this fiddle: http://jsfiddle.net/tYRn5/ It fails on 11 line. I found, that problem occurs in clone function, on line 100:
var copy = obj.constructor();
In case of class instance, it must be something like this:
var copy = new obj.constructor();
Just for adding some considerations, look at this stackoverflow post on how to clone an object: http://stackoverflow.com/a/728694
"To do this for any object in JavaScript will not be simple or straightforward."
Look at this fiddle: http://jsfiddle.net/tYRn5/ It fails on 11 line. I found, that problem occurs in clone function, on line 100:
In case of class instance, it must be something like this: