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
Expected behavior:
see 42 and then "callback error" in the console
Actual behavior:
console output:
42
completed
Additional information:
In the real world, I've captured this issue with ReactDOM.render method. If you run it with "bad" JSX it will call passed callback first and then throw an error.
I've tried to reproduce this case as a test, but it worked well in the test environment. So maybe there is something with test scheduler or production build
it('should error if callback throws',()=>{constexpected=newError('haha no callback for you');functioncallback(datum,cb){cb(datum);throwexpected;}constboundCallback=Observable.bindCallback(callback,null,rxTestScheduler);boundCallback(42).subscribe((x: number)=>{throw'should not next';},(err: any)=>{expect(err).to.equal(expected);},()=>{throw'should not complete';});rxTestScheduler.flush();});
The text was updated successfully, but these errors were encountered:
olessavluk
changed the title
bindCallback swallow error, that was thrown after callback was executed
bindCallback swallow error if it was thrown after the callback was executed
Mar 29, 2018
benlesh
changed the title
bindCallback swallow error if it was thrown after the callback was executed
bindCallback swallows error if it was thrown after the callback was executed, and the entire function is sycnhronous
Mar 29, 2018
RxJS version:
5.5.8
Code to reproduce:
same for node and browser
Expected behavior:
see 42 and then "callback error" in the console
Actual behavior:
console output:
Additional information:
In the real world, I've captured this issue with
ReactDOM.render
method. If you run it with "bad" JSX it will call passed callback first and then throw an error.I've tried to reproduce this case as a test, but it worked well in the test environment. So maybe there is something with test scheduler or production build
The text was updated successfully, but these errors were encountered: