You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
fionawhim
changed the title
shouldDeleteModernInstanceMethod broken by MobX decorators
shouldDeleteModernInstanceMethod shouldn’t call get()
Mar 17, 2017
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;
}
fionawhim
pushed a commit
to CityOfBoston/311
that referenced
this issue
Mar 17, 2017
The
shouldDeleteModernInstanceMethod
assumes that ifprototypeDescription.get
exists, thatget()
will return something. When using MobX’s@action
, the decorator creates aget
that returnsundefined
, which causes an exception when accessinglength
on line 31.I’m not sure if a
get()
result ofundefined
should be treated like a length of 0 orget
not existing in the first place. (Or if this issue really belongs to MobX.)The text was updated successfully, but these errors were encountered: