w3c / ServiceWorker

Service Workers
https://w3c.github.io/ServiceWorker/
Other
3.63k stars 313 forks source link

Shouldn't `InstallEvent` has a constructor? #1713

Closed skyclouds2001 closed 1 month ago

skyclouds2001 commented 6 months ago

current the definition for InstallEvent does not has a constructor, this is different from other event interfaces and is quite uncommon, should it also define with a constructor, too?

image

relates with https://github.com/mdn/browser-compat-data/pull/22870

skyclouds2001 commented 2 months ago

but interestingly, in browser implement InstallEvent is constructible

image

test in https://worker-playground.glitch.me/

mkruisselbrink commented 1 month ago

Yes, I believe this is an oversight in the spec that was missed when InstallEvent was added in https://github.com/w3c/ServiceWorker/pull/1701. I can't think of any reason why we shouldn't have a constructor.