From db617e56a308de0db09c93e73a05d7627653ff11 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Mon, 23 Nov 2015 13:41:34 -0800 Subject: [PATCH] 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 --- Libraries/vendor/emitter/EventEmitter.js | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/Libraries/vendor/emitter/EventEmitter.js b/Libraries/vendor/emitter/EventEmitter.js index d8b679214..cb3725ebb 100644 --- a/Libraries/vendor/emitter/EventEmitter.js +++ b/Libraries/vendor/emitter/EventEmitter.js @@ -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) ); } }