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

showNotification() throwing exceptions #40

Closed
beverloo opened this issue Mar 12, 2015 · 1 comment
Closed

showNotification() throwing exceptions #40

beverloo opened this issue Mar 12, 2015 · 1 comment

Comments

@beverloo
Copy link
Member

(editorial)

https://notifications.spec.whatwg.org/#dom-serviceworkerregistration-shownotification

(1) Let promise be a new promise.
(2) Let notification be the result of creating a notification given title and options. Rethrow any exceptions.
(3) If context object's active worker is null, reject promise with a TypeError exception.

I see that WebIDL defines some additional steps for promises - if a function returning a Promise value throws an exception, rather than throwing the exception it'll reject the promise.

Can we change the showNotification() algorithm to point this out explicitly? I found this rather confusing, and it took me quite a while to figure out where that behavior comes from.

Loosely following the fetch spec's formulation, what about the following amendment to the showNotification() steps?

  1. Let notification be the result of creating a notification given title and options. If that threw an exception, reject promise with that exception.
@annevk
Copy link
Member

annevk commented Mar 12, 2015

Seems okay. Should probably merge the bikeshed thing first.

@annevk annevk closed this as completed in 1f2beec Mar 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants