-
Notifications
You must be signed in to change notification settings - Fork 80
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
Updating prop values of an object with a function property causes an exception #194
Comments
Thank you for the report, I think I get the sense of what the problem and solution is. Can you provide a minimal repro though, I couldn't seem to get it consistently or even at all. |
Here is the test bed: With the devtools, you can notice the class function returning To receive the issue with the After updating the PR repo to the latest |
Describe the bug
When trying to update a value in an object with a function property, if the function is called in the page or component it will throw an exception that the function does not exist. Here is an example updating an object in an array:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The update should succeed and the function should be intact.
Environment
Additional context
This appears to be due, in part, to how objects are cloned for display in the devtools chrome:
https://github.com/sveltejs/svelte-devtools/blob/master/src/client/index.js#L99
Functions need to be turned into a string form. Furthermore, the clone does will not include object functions in serialization if they inherited from a class.
I also noticed this issue if object references such as URL are made in a component:
Updating the component will produce an error because the
url
will no longer have asearchParams
property.The text was updated successfully, but these errors were encountered: