async/await improvements
C. Scott Ananian
ecmascript at cscott.net
Wed Nov 12 09:18:04 PST 2014
On Wed, Nov 12, 2014 at 12:15 PM, James Long <longster at gmail.com> wrote:
> On Wed, Nov 12, 2014 at 12:11 PM, Jussi Kalliokoski
> <jussi.kalliokoski at gmail.com> wrote:
>> Actually that already works, at least in Chrome, if you execute
>>
>> (function () {
>> return new Promise(function (resolve, reject) {
>> reject(new Error("foo"));
>> });
>> }());
>>
>
> That's a false positive though. It does the same thing with this:
>
> var x = (function () {
> return new Promise(function (resolve, reject) {
> reject(new Error("foo"));
> });
> }());
>
> When you could later on attach an error handler to x. We are starting
> to favor false positives in order to get somewhat immediate error
> logging. Also none of this helps production code unless we also have
> something like onUncaughtPromiseException?
What happens if you attach an error handler to x. Does the console
warning go away? (It should.)
--scott
More information about the es-discuss
mailing list