You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getNotifications manipulates ES arrays in parallel steps #113
https://notifications.spec.whatwg.org/#dom-serviceworkerregistration-getnotifications is manipulating and ES array in parallel steps. It says things like "push that object to objects". How is that supposed to work? Is that using Array.prototype.push? If so, is it using the initial value of that? Even if it does, that can be affected by accessor properties on Array.prototype and in particular can run arbitrary script, which is not OK in parallel.
It also doesn't queue a step to resolve the promise... (Although promises in general are underdefined I suppose.)
I think what this should do instead is to just build up a list and resolve the promise with that and let the IDL layer take care of converting the list to a new Array.
Activity
annevk commentedon Dec 5, 2017
It also doesn't queue a step to resolve the promise... (Although promises in general are underdefined I suppose.)
I think what this should do instead is to just build up a list and resolve the promise with that and let the IDL layer take care of converting the list to a new
Array.annevk commentedon Dec 5, 2017
Using https://infra.spec.whatwg.org/ terminology to make such a list this should be relatively straightforward.
getNotifications() needs to do work on the "main thread"
getNotifications() needs to do work on the "main thread"
Modernize promise-returning methods