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

Error occured if trying to call a method on an object with prototype provided as payload #953

Closed
liqueurdetoile opened this issue Apr 4, 2019 · 0 comments
Labels

Comments

@liqueurdetoile
Copy link

Version

5.0.6

Browser and OS info

Chrome 73.0.3683.86 / Windows 10

Steps to reproduce

  1. Create an object with a method defined in its prototype
  2. Use it as payload for a commit
  3. 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.

This issue may be related to #935 and #945

@Akryum Akryum added the bug label Apr 4, 2019
@Akryum Akryum closed this as completed in 6f947cb Apr 4, 2019
simsim0709 pushed a commit to simsim0709/vue-devtools that referenced this issue May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants