Open fuzetsu opened 5 years ago
Should we use new source.constructor()
instead?
Current implementation will not execute constructor when copying, meaning we could miss side effects in the constructor or if the returned object is overridden.
What is more correct?
EDIT:
If the returned object is overridden then the prototype would most likely be lost or different (but not necessarily) so that might not be an important factor.
Side effects aren't particularly desirable in this context I feel, so also maybe not a factor.
fixes #6