Filtered Promise#catch

Michał Wadas michalwadas at gmail.com
Wed Oct 11 23:38:23 UTC 2017


It's possible to standardize already existing filtered catch from
SpiderMonkey.

try {
   throw new Error('42');
} catch(e if e.message === 42) {

}

Then Promise.prototype.catch extension can work in very similar manner - by
predicate function and user code can easily adopt pattern-matching in
future.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171012/f03a6ece/attachment.html>


More information about the es-discuss mailing list