Open Bug 766078 Opened 12 years ago Updated 2 years ago

Provide some help for detecting bad uses of promises

Categories

(Core :: General, defect)

defect

Tracking

()

People

(Reporter: Yoric, Unassigned)

References

Details

In some debug conditions that remain to be determined, I would like to:
- log attempts to resolve/reject a promise more than once;
- log rejected promises that have no onReject handler;
- log resolved promises that have no onResolve handler.

We may wish to keep this specific to some promises (i.e. introduce another constructor similar to |defer|).
Of course, given the asynchronous nature of promises, detecting whether a onReject or onResolve handler is present cannot be done exactly. However, what can be done is something along the lines of:
- if |then| does not find an appropriate handler, start a timeout;
- once the timeout has fired, if there is still no handler, log a warning.
As per bug 902866 comment 2, I think the error case in particular should be done as a matter of urgency.
Blocks: 895548
OS: Mac OS X → All
Hardware: x86 → All
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.