-
Notifications
You must be signed in to change notification settings - Fork 24
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
Waiting for promises might not work correctly if the page messes with its standard objects #45
Comments
Yeah, this whole section is far too wishy-washy... Do you want to try defining it over in Web IDL (#27)? I'd happily pull the section and redirect incoming links over there... |
I'm fine with defining it whereever; I'm just not sure yet how to define it. |
There is also a security concern if an algorithm uses "waiting for all" without protection against re-entrancy. |
It's worth checking what UAs actually do. SpiderMonkey has an API, which Gecko uses, which has the following characteristics:
Looks to me like we use this API in the following spec-related places:
Of those, the former links to https://www.w3.org/2001/tag/doc/promises-guide/#waiting-for-all and the latter does not. |
The spec says:
If the intent is that this actually work reliably, then this is not enough. The output of the initial value of
Promise.all
in this case will depend on the current values of at least the following:Promise[Symbol.species]
,%ArrayPrototype%[Symbol.iterator]
,%ArrayIteratorPrototype%.next
(if no one has changed out the array iterator on you),Promise.resolve
,Promise.prototype.then
(if no one has changed outPromise.resolve
on you).Really, you probably just want a different algorithm here.
The text was updated successfully, but these errors were encountered: