send fatal error for js exception in eventEmitter

Summary: public

Any uncaught exception inside an event emitter handler was reported as softError, which didn't crash the app, but left the app running in an unknown state. Since there's no way for the app to catch these softerror (to provide a fallback error view, etc), let's change it to report fatal error for uncaught exception for the time being.

Reviewed By: javache

Differential Revision: D2685322

fb-gh-sync-id: 52956d3db20809cc90448bd080795754b899435e
This commit is contained in:
Kevin Gozali 2015-11-23 13:41:34 -08:00 committed by facebook-github-bot-2
parent aad4bc9231
commit db617e56a3

View File

@ -1,16 +1,10 @@
/**
* @generated SignedSource<<494e66dea72a3e90b763a5ec50b1e0ca>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! This file is a check-in of a static_upstream project! !!
* !! !!
* !! You should not modify this file directly. Instead: !!
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
* !! the latest version from upstream. !!
* !! 2) Make your changes, test them, etc. !!
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
* !! static_upstream. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EventEmitter
* @typechecks
@ -164,13 +158,9 @@ class EventEmitter {
// The subscription may have been removed during this event loop.
if (subscription) {
this._currentSubscription = subscription;
ErrorUtils.applyWithGuard(
subscription.listener,
subscription.listener.apply(
subscription.context,
Array.prototype.slice.call(arguments, 1),
null,
'EventEmitter:' + eventType
Array.prototype.slice.call(arguments, 1)
);
}
}