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
Early on, I made a decision that when a handler returned undefined, the previous promise value should be forwarded through to the next promise. That's convenient in some cases, as it allows reusing and writing handlers that have no return statement.
However, it means that it's easy to get into trouble when doing things like this:
In cases like that, where the first handler legitimately needs to return undefined, and we want handleProperty to receive undefined, it will instead receive result, which is just plain wrong. Right now, the workaround is:
which is ok, but probably would cause someone a real headache trying to figure it out, and means that handleProperty receives null instead of undefined.
The text was updated successfully, but these errors were encountered:
An initial version of this is in the dev-20 branch. You can track that to see if this breaks your code. The thing to look for to know if this has broken your code is suddenly seeing undefined being passed into some callbacks or errbacks.
The way to fix it is to find promise callbacks or errbacks where you aren't explicitly returning a value, and return something. In many of those cases, simply returning the callback's input param will fix the problem, but it's best to take a few seconds to evaluate each situation to make sure that's the right thing.
Early on, I made a decision that when a handler returned undefined, the previous promise value should be forwarded through to the next promise. That's convenient in some cases, as it allows reusing and writing handlers that have no
return
statement.However, it means that it's easy to get into trouble when doing things like this:
In cases like that, where the first handler legitimately needs to return
undefined
, and we wanthandleProperty
to receiveundefined
, it will instead receiveresult
, which is just plain wrong. Right now, the workaround is:which is ok, but probably would cause someone a real headache trying to figure it out, and means that
handleProperty
receivesnull
instead ofundefined
.The text was updated successfully, but these errors were encountered: