Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Class instance new properties #63

Open
LMnet opened this issue Nov 21, 2013 · 1 comment
Open

Class instance new properties #63

LMnet opened this issue Nov 21, 2013 · 1 comment

Comments

@LMnet
Copy link

LMnet commented Nov 21, 2013

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();
@Maluen
Copy link
Contributor

Maluen commented Nov 21, 2013

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."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants