-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Version
5.0.6
Browser and OS info
Chrome 73.0.3683.86 / Windows 10
Steps to reproduce
- Create an object with a method defined in its prototype
- Use it as payload for a commit
- Try to use this method inside mutation callback
See this sandbox for a repro built on class syntactic sugar (I've also added a custom non enumerable property for testing purposes and the property also vanished in vue-devtools payload) : https://codesandbox.io/s/v0x463v235
What is expected?
The prototype (and likely all non enumerable properties) should be available on committed object in payload. It works fine with Vuex and should work fine with vue-devtools as well.
What is actually happening?
It seems vue-devtools only keep enumerable properties of the payload object instead of using the whole object (maybe due to some partial cloning ?).
Therefore, the mutation triggers a not a function TypeError when trying to load state from vue-devtools after the commit
I'm using a kind of ORM with class instances.