Use EventEmitter public methods instead of _events.

This commit is contained in:
Charlie Hess 2017-01-12 17:20:50 -08:00 committed by Kevin Sawicki
parent 45986405b8
commit 63d8137da2

View file

@ -151,13 +151,11 @@ const rendererMissingErrorMessage = (meta, args, callIntoRenderer) => {
`\nFunction provided here: ${meta.location}`
if (args.length === 0) return message
if (!args[0].sender || !args[0].sender._events) return message
if (!args[0].sender || !args[0].sender.eventNames) return message
const eventsAttached = args[0].sender._events
const remoteEvents = Object.keys(eventsAttached).filter((eventName) => {
return Array.isArray(eventsAttached[eventName])
? eventsAttached[eventName].includes(callIntoRenderer)
: eventsAttached[eventName] === callIntoRenderer
const sender = args[0].sender
const remoteEvents = sender.eventNames().filter((eventName) => {
return sender.listeners(eventName).includes(callIntoRenderer);
})
if (remoteEvents.length > 0) {