-
Notifications
You must be signed in to change notification settings - Fork 303
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
Report queueMicrotask errors to the error event #2597
Conversation
// microtasks automatically, we can remove this workaround. | ||
KJ_IF_SOME(context, jsg::AsyncContextFrame::current(js)) { | ||
task = context.wrap(js, task); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For review: Just noting... we no longer need to manually propagate the async context to EnqueueMicrotask()
since v8 finally closed that gap recently. Just hadn't gotten around to removing this previously.
```js globalThis.addEventListener('error', (event) => { console.log(event.error); return true; }) queueMicrotask(() => { throw new Error('sync error throw in microtask'); }); ```
7a48bee
to
a33c3a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int n = 0; n < args.Length(); n++) { | ||
argv.add(args[n]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argv.addAll(args);
// argv.addAll(args.begin(), args.end());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't think that works. args
here does not have a begin()
or end()
as far as I'm aware.
Per the
queueMicrotask(...)
spec... https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuingThe
'error'
event should preserve async context in case the queueMicrotask originates from within a request: