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

Why clone props? #7

Open
matthewwithanm opened this issue Sep 30, 2014 · 0 comments
Open

Why clone props? #7

matthewwithanm opened this issue Sep 30, 2014 · 0 comments

Comments

@matthewwithanm
Copy link

create-error has a pretty naive cloning implementation that seems to prevent you from storing any real objects on the error. For example:

var MyCustomError  = createError('MyCustomError');
new MyCustomError('Bad!', {xhr: xhr});

Assuming that xhr is an instance of XMLHttpRequest, you're actually going to get a new one on your error instance.

I guess this functionality was intended to allow you to add arbitrary simple but nested objects without fear of them being mutated, but it seems very limiting IMO.

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