| Index: src/promise.js
|
| diff --git a/src/promise.js b/src/promise.js
|
| index 27890a7626b37d12af837e73627617d6a94da4f2..41a5f511921dc64760ab0ce6d5717ba3a7c54cc5 100644
|
| --- a/src/promise.js
|
| +++ b/src/promise.js
|
| @@ -192,8 +192,14 @@ function PromiseHandle(value, handler, deferred) {
|
| else
|
| deferred.resolve(result);
|
| } catch(e) {
|
| - // TODO(rossberg): perhaps log uncaught exceptions below.
|
| - try { deferred.reject(e) } catch(e) {}
|
| + if (GET_PRIVATE(deferred.promise, promiseOnReject).length == 0) {
|
| + // There is no reject handler defined (yet). The debugger should know.
|
| + %DebugPendingExceptionInPromise(e, deferred.promise);
|
| + }
|
| + try { deferred.reject(e) } catch(e) {
|
| + // Reject handler threw (must have been a custom one).
|
| + %DebugPendingExceptionInPromise(e, deferred.promise);
|
| + }
|
| }
|
| }
|
|
|
|
|