d at domenic.me (2015-04-14T22:26:24.450Z)
I've just got bitten by
return getError().then(Promise.reject);
where `reject` threw an error that its `this` value was not a Promise constructor.
Would it help to make the `C` constructor (in Promise.resolve, Promise.reject, Promise.all, Promise.race algorithms) default to `Promise` when no `this` value is supplied (throw only if it's there, but not an object and constructor function)?
Or is this considered to be too error-prone with Promise subclassing, where `.then(MyCustomPromise.reject)` would not work as expected (fail silently)?
Hi, I've just got bitten by return getError().then(Promise.reject); where `reject` threw an error that its `this` value was not a Promise constructor. Would it help to make the `C` constructor (in Promise.resolve, Promise.reject, Promise.all, Promise.race algorithms) default to `Promise` when no `this` value is supplied (throw only if it's there, but not an object and constructor function)? Or is this considered to be too error-prone with Promise subclassing, where `.then(MyCustomPromise.reject)` would not work as expected (fail silently)? regards, Bergi