Class instance new properties
LMnet opened this issue · comments
Yuriy Badalyants commented
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();
Manuel Dell'Elce commented
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."