[whatwg] How works Promise.any() if it was called with resolved promises?

Hello,

I have questions about DOM Promise.

If we call `Promises.any()` with resolved promises, how does it
execute its fulfillCallback?

The following is sample code:
```
var p1 = new Promise(function(r){
  r = r.resolve("value1");
});
var p2 = new Promise(function(r){
  r = r.resolve("value2");
});
var p3 = new Promise(function(r){
  r = r.resolve("value3");
});

// Pass some promises which have been resolved already.
Promsie.any(p1, p2, p3).then(function(){
  // how will the browser call this function?
});

```

Thank you.

--
Tetsuharu OHZEKI
(a.k.a saneyuki_s)

Received on Friday, 14 June 2013 12:26:03 UTC