ReadableStream: controller.error() causes debugger to pause |
|||
Issue description
To reproduce:
1. Open Chrome's debugger
2. Run the following code (I used the "Snippets" feature to do this):
new ReadableStream({
pull(controller) {
controller.error(new Error('dummy'));
}
}).getReader().read();
Expected behaviour:
Debugger does not pause.
Observed behaviour:
Debugger pauses with "Paused on promise rejection / Error: dummy"
The relevant lines of code in ReadableStream.js are:
rejectPromise(reader[_closedPromise], e);
markPromiseAsHandled(reader[_closedPromise]);
I haven't tried it, but maybe those lines should be the other way around?
,
Feb 2 2018
Actually the call to read() isn't needed at all. Simpler repro:
new ReadableStream({
pull(controller) {
controller.error(new Error('dummy'));
}
}).getReader();
,
Feb 2 2018
Swapping the order of the lines
rejectPromise(reader[_closedPromise], e);
markPromiseAsHandled(reader[_closedPromise]);
in ReadableStreamError doesn't help.
,
Feb 2 2018
I guess we are not triggering the inspector's catch prediction heuristics. Adding some folks who I recall being involved in that work for advice.
,
Feb 5 2018
Unassigning myself since it appears changes within V8 would be needed to fix this. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ricea@chromium.org
, Feb 2 2018Correction, the repro should be: new ReadableStream({ pull(controller) { controller.error(new Error('dummy')); } }).getReader().read().catch(() => {}); ie. there needs to be a catch statement, otherwise there is a legitimately uncaught rejection and so there's no way to tell if it's broken or not. Pasting it into the console is sufficient to reproduce.