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

fix: useDeprecatedSynchronousErrorThrowing honored for flattened sync sources #5984

Merged

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Jan 26, 2021

fixes #5983

@benlesh benlesh requested a review from cartant January 26, 2021 15:46
// do it's magic in the `_next`, `_error`, and `_complete` methods.
this.destination = {
next: next ? maybeWrapForDeprecatedSyncErrorHandling(next, this) : noop,
error: maybeWrapForDeprecatedSyncErrorHandling(error ? error : defaultErrorHandler, this),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meat of the change is here.

// If we don't have arguments, or the observer passed is already EMPTY_OBSERVER,
// use EMPTY_OBSERVER. This is just to save a little on object allocations.
this.destination = EMPTY_OBSERVER;
if ((observerOrNext || error || complete) && observerOrNext !== EMPTY_OBSERVER) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some thought, I realized that this check, and setting this.destination = EMPTY_OBSERVER was pointless, so that got removed.

It might be better to review this with "ignore whitespace" on.

Copy link
Member

@kwonoj kwonoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh(2).

@benlesh benlesh merged commit abd95ce into ReactiveX:master Jan 26, 2021
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

Successfully merging this pull request may close these issues.

Super gross mode no longer sync throws flattened errors
2 participants