Yury, ptal Domenic, should "preventDefault" on unhandledrejection also cause rejectionhandled to not log to the ...
4 years, 10 months ago
(2015-06-15 08:46:10 UTC)
#1
Yury, ptal
Domenic, should "preventDefault" on unhandledrejection also cause
rejectionhandled to not log to the console even if that event doesn't have an
handler?
Also, you promised me to translate the io.js test suite to a layout test :)
yurys
lgtm
4 years, 10 months ago
(2015-06-15 09:10:13 UTC)
#2
lgtm
domenic
On 2015/06/15 at 08:46:10, jochen wrote: > Yury, ptal > > Domenic, should "preventDefault" on ...
4 years, 10 months ago
(2015-06-15 15:53:57 UTC)
#3
On 2015/06/15 at 08:46:10, jochen wrote:
> Yury, ptal
>
> Domenic, should "preventDefault" on unhandledrejection also cause
rejectionhandled to not log to the console even if that event doesn't have an
handler?
I'm not sure I quite understand this sentence? I think if you preventDefault on
unhandledrejection then nothing should show up in the console.
> Also, you promised me to translate the io.js test suite to a layout test :)
Yep, that's today's major work item.
jochen (gone - plz use gerrit)
On 2015/06/15 at 15:53:57, domenic wrote: > On 2015/06/15 at 08:46:10, jochen wrote: > > ...
4 years, 10 months ago
(2015-06-15 15:57:54 UTC)
#4
On 2015/06/15 at 15:53:57, domenic wrote:
> On 2015/06/15 at 08:46:10, jochen wrote:
> > Yury, ptal
> >
> > Domenic, should "preventDefault" on unhandledrejection also cause
rejectionhandled to not log to the console even if that event doesn't have an
handler?
>
> I'm not sure I quite understand this sentence? I think if you preventDefault
on unhandledrejection then nothing should show up in the console.
>
Assume you only have a listener for unhandledrejection, and it invokes
preventDefault but then something handles the rejection.
Since there's no listener for rejectionhandled, should we log this to the
console?
> > Also, you promised me to translate the io.js test suite to a layout test :)
>
> Yep, that's today's major work item.
blink-reviews
I do not think we should. The purpose of the logging is to alert developers ...
4 years, 10 months ago
(2015-06-15 16:01:39 UTC)
#5
I do not think we should. The purpose of the logging is to alert developers
to unhandled rejections (especially developers who haven't put telemetry
stuff in place). There's no point logging a message to tell them "it was
handled, even though you didn't care enough to add a listener for that
event."
On Mon, Jun 15, 2015 at 11:58 AM <jochen@chromium.org> wrote:
> On 2015/06/15 at 15:53:57, domenic wrote:
> > On 2015/06/15 at 08:46:10, jochen wrote:
> > > Yury, ptal
> > >
> > > Domenic, should "preventDefault" on unhandledrejection also cause
> rejectionhandled to not log to the console even if that event doesn't have
> an
> handler?
>
> > I'm not sure I quite understand this sentence? I think if you
> > preventDefault
> on unhandledrejection then nothing should show up in the console.
>
>
> Assume you only have a listener for unhandledrejection, and it invokes
> preventDefault but then something handles the rejection.
>
> Since there's no listener for rejectionhandled, should we log this to the
> console?
>
>
>
>
> > > Also, you promised me to translate the io.js test suite to a layout
> > test :)
>
> > Yep, that's today's major work item.
>
>
>
> https://codereview.chromium.org/1179113007/
>
To unsubscribe from this group and stop receiving emails from it, send an email
to blink-reviews+unsubscribe@chromium.org.
jochen (gone - plz use gerrit)
updated. I also rewrote your tests a bit, and added some more. any reason we ...
4 years, 10 months ago
(2015-06-16 12:16:34 UTC)
#6
updated.
I also rewrote your tests a bit, and added some more.
any reason we don't want to expose this on ServiceWorker?
4 years, 10 months ago
(2015-06-16 13:22:32 UTC)
#8
+philipj for webexposed stuff
philipj_slow
Took a quick peek, LGTM with some non-obviousness and IDL nitpickery. https://codereview.chromium.org/1179113007/diff/120001/Source/bindings/core/v8/RejectedPromises.cpp File Source/bindings/core/v8/RejectedPromises.cpp (right): ...
4 years, 10 months ago
(2015-06-16 14:58:04 UTC)
#9
On 2015/06/16 15:31:47, domenic wrote: > On 2015/06/16 at 14:58:04, philipj wrote: > > > ...
4 years, 10 months ago
(2015-06-16 15:36:24 UTC)
#11
On 2015/06/16 15:31:47, domenic wrote:
> On 2015/06/16 at 14:58:04, philipj wrote:
>
> >
>
https://codereview.chromium.org/1179113007/diff/120001/Source/core/events/Pro...
> > Source/core/events/PromiseRejectionEvent.h:29:
> initializer.setCancelable(true);
> > https://github.com/domenic/unhandled-rejections-browser-spec says "Let event
> be a new trusted PromiseRejectionEvent object that does not bubble and is not
> cancelable, and which has the event name unhandledrejection" but also "If
event
> was canceled, then the error is handled. Otherwise, the error is not handled."
> which doesn't seem to add up.
>
> Thanks for the find, fixed in the spec to be cancelable
>
https://github.com/domenic/unhandled-rejections-browser-spec/commit/c8a5f9247...
Jochen, can test that Event.cancelable has the right state for the two events,
especially given that they're not the same? Also for script-created |new
PromiseRejectionEvent()| so that this doesn't fall into the wrong bucket.
domenic
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js File LayoutTests/fast/dom/resources/promise-rejection-events.js (right): https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js#newcode5 LayoutTests/fast/dom/resources/promise-rejection-events.js:5: // You killed all my nice separating newlines :( ...
4 years, 10 months ago
(2015-06-16 15:42:36 UTC)
#12
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js File LayoutTests/fast/dom/resources/promise-rejection-events.js (right): https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js#newcode5 LayoutTests/fast/dom/resources/promise-rejection-events.js:5: // On 2015/06/16 at 15:42:36, domenic wrote: > You ...
4 years, 10 months ago
(2015-06-16 18:08:18 UTC)
#13
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/r...
File LayoutTests/fast/dom/resources/promise-rejection-events.js (right):
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/r...
LayoutTests/fast/dom/resources/promise-rejection-events.js:5: //
On 2015/06/16 at 15:42:36, domenic wrote:
> You killed all my nice separating newlines :(
I blame this on paste... I'll put them back in
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/r...
LayoutTests/fast/dom/resources/promise-rejection-events.js:397:
Promise.resolve().then(function() { f(); });
On 2015/06/16 at 15:42:36, domenic wrote:
> Kind of the point of the microtask tests is to test interaction of other
microtasks with promise microtasks. So this should stick with mutation observers
where possible. I guess in workers there are no other microtask sources so
Promise.resolve is fine.
i'll put them back.
from an implementation point of view, that's a boring distinction, it's the same
microtask queue :)
https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/r...
LayoutTests/fast/dom/resources/promise-rejection-events.js:401: if (ev.promise
=== expectedPromiseGetter()) {
On 2015/06/16 at 15:42:36, domenic wrote:
> This if seems bad. If they mismatch, then the test should fail. Same here and
below.
without this, none of the tests will work, as they all run in a single microtask
run.
if there's a promise that doesn't match any of the listeners, the resp. test
will just timeout.
jochen (gone - plz use gerrit)
all comments addressed https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js File LayoutTests/fast/dom/resources/promise-rejection-events.js (right): https://codereview.chromium.org/1179113007/diff/120001/LayoutTests/fast/dom/resources/promise-rejection-events.js#newcode393 LayoutTests/fast/dom/resources/promise-rejection-events.js:393: setTimeout(function() { f(); }, 0); On ...
4 years, 10 months ago
(2015-06-17 07:57:53 UTC)
#14
Maybe a follow-up if these comments are too late. https://codereview.chromium.org/1179113007/diff/160001/LayoutTests/fast/events/constructors/promise-rejection-event-constructor.html File LayoutTests/fast/events/constructors/promise-rejection-event-constructor.html (right): https://codereview.chromium.org/1179113007/diff/160001/LayoutTests/fast/events/constructors/promise-rejection-event-constructor.html#newcode11 LayoutTests/fast/events/constructors/promise-rejection-event-constructor.html:11: ...
4 years, 10 months ago
(2015-06-17 08:49:16 UTC)
#19
LGTM again, all things cancelable seem to be in order now, tested by fast/dom/promise-rejection-events-console.html and ...
4 years, 10 months ago
(2015-06-17 09:48:28 UTC)
#21
LGTM again, all things cancelable seem to be in order now, tested by
fast/dom/promise-rejection-events-console.html and
fast/events/constructors/promise-rejection-event-constructor.html
jochen (gone - plz use gerrit)
The CQ bit was checked by jochen@chromium.org
4 years, 10 months ago
(2015-06-17 09:49:04 UTC)
#22
Issue 1179113007: Implement onunhandledrejection / onrejectionhandled events
(Closed)
Created 4 years, 10 months ago by jochen (gone - plz use gerrit)
Modified 4 years, 10 months ago
Reviewers: domenic, philipj_slow, yurys
Base URL: svn://svn.chromium.org/blink/trunk
Comments: 19