Closed svbatalov closed 10 years ago
@svbatalov Technically, there is no Promises/A+ specification for the Promise
constructor. These tests are designed only to test then()
's compliance with http://promisesaplus.com. So, even though the test suite does require some way of creating promises in order to test then
, I think this particular case is outside the scope of the tests. IOW, since your implementation passes the tests, it is Promises/A+ compliant :)
In practice, as you observed, most libraries that implement a Promise
constructor do catch those exceptions and reject the newly constructed promise. The ES6 Promise spec requires that as well. So I'd def say, though, that adding a try/catch and rejecting would be the way to go.
Thanks!
Thanks a lot for the clarification @briancavalier - we've fixed it
@Rich-Harris Cool, and no problem at all.
Ractive.Promise promises implementation pass all tests, but fails to convert exceptions to rejections. Here is the test code:
Other three implementations (commented-out in code above) reject the promise, which I believe is correct.
So, should Ractive.Promise fail compliance test?