mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-22 00:45:15 +08:00
80338e775e
1. Refactor the Hippy.on() for multiple event listener handlers. 2. Added Hippy.off() to remove the event handler. 3. Added Hippy.emit() to trigger the specific event.
9 lines
216 B
JavaScript
9 lines
216 B
JavaScript
(function exceptionHandler(eventName, err) {
|
|
if (global.Hippy) {
|
|
global.Hippy.emit('uncaughtException', err);
|
|
} else {
|
|
/* eslint-disable-next-line no-console */
|
|
console.error(eventName, err);
|
|
}
|
|
});
|