Reject promise if resolver function throws an exception

```javascript
var promise = new Promise(function() {
  throw 'error';
});

promise.then(null, function(reason) {
  // rejection callback is called
  reason === 'error'; // true
});
```