Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when copying source object also copy prototype #7

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuzetsu
Copy link
Owner

@fuzetsu fuzetsu commented Oct 3, 2019

fixes #6

@fuzetsu
Copy link
Owner Author

fuzetsu commented Oct 18, 2019

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.

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

Successfully merging this pull request may close these issues.

consider copying prototype when merging
1 participant