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

[0.2] Each method does not copy properties copied via Object.defineProperty #2

Closed
1 task done
20TRIES opened this issue Jul 1, 2016 · 1 comment
Closed
1 task done
Milestone

Comments

@20TRIES
Copy link
Owner

20TRIES commented Jul 1, 2016

This package is used in the js_model package. When .each is used on a collection of models; the accessors defined on the model no longer work on the cloned copies.

A good solution worth trying would be for a collection to default to calling .clone() instead of using the clone package by default.

This was js_model could implement a .clone method which would then take over from the clone package whenever a model is included within a collection.

  • Add check to see whether a .clone method exists on objects that are copied during a call to the collection .each method; if so, use this, otherwise use the clone package.
@20TRIES 20TRIES added this to the 0.2.0 milestone Jul 1, 2016
@20TRIES 20TRIES changed the title Each method does not copy properties copied via Object.defineProperty [0.0] Each method does not copy properties copied via Object.defineProperty Jul 4, 2016
@20TRIES 20TRIES changed the title [0.0] Each method does not copy properties copied via Object.defineProperty [0.2] Each method does not copy properties copied via Object.defineProperty Jul 10, 2016
@20TRIES
Copy link
Owner Author

20TRIES commented Jul 10, 2016

Only enumerable properties will be cloned. If non-enumerable properties need to be cloned, then a .clone method will need to be defined within the items within the collection; this method will then be delegated to when cloning collection items.

@20TRIES 20TRIES closed this as completed Jul 10, 2016
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

No branches or pull requests

1 participant