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

shouldDeleteModernInstanceMethod shouldn’t call get() #71

Open
fionawhim opened this issue Mar 17, 2017 · 2 comments
Open

shouldDeleteModernInstanceMethod shouldn’t call get() #71

fionawhim opened this issue Mar 17, 2017 · 2 comments

Comments

@fionawhim
Copy link

The shouldDeleteModernInstanceMethod assumes that if prototypeDescription.get exists, that get() will return something. When using MobX’s @action, the decorator creates a get that returns undefined, which causes an exception when accessing length on line 31.

I’m not sure if a get() result of undefined should be treated like a length of 0 or get not existing in the first place. (Or if this issue really belongs to MobX.)

@fionawhim fionawhim changed the title shouldDeleteModernInstanceMethod broken by MobX decorators shouldDeleteModernInstanceMethod shouldn’t call get() Mar 17, 2017
@fionawhim
Copy link
Author

Digging deeper into this, I think that it’s actually a bug that get() is called. Does the code intend to just call get.length in the code below, since get(), as the property’s getter, would actually return the property value?

  if (prototypeDescriptor.get().length !== component[name].length) {
    // The length doesn't match, bail out
    return false;
  }

@jeffijoe
Copy link

Running into this as well, I also use MobX.

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

2 participants