refactor(service-worker): Format comments and add additional test (#25860)

- Format JSDoc for notificationClicks
- Add comment on why handleClick does not use hasOwnProperty
- Add additional test that uses handleClick without action

PR Close #25860
This commit is contained in:
joostme
2018-10-03 16:02:14 +02:00
committed by Kara Erickson
parent 4a01ada291
commit aca8ea9c0b
3 changed files with 26 additions and 11 deletions

View File

@ -309,6 +309,8 @@ export class Driver implements Debuggable, UpdateSource {
notification.close();
const options: {-readonly[K in keyof Notification]?: Notification[K]} = {};
// The filter uses `name in notification` because the properties are on the prototype so
// hasOwnProperty does not work here
NOTIFICATION_OPTION_NAMES.filter(name => name in notification)
.forEach(name => options[name] = notification[name]);