electron/spec/fixtures/module/preload-eventemitter.js

11 lines
440 B
JavaScript

(function () {
const { EventEmitter } = require('events');
const emitter = new EventEmitter();
const rendererEventEmitterProperties = [];
let currentObj = emitter;
do {
rendererEventEmitterProperties.push(...Object.getOwnPropertyNames(currentObj));
} while ((currentObj = Object.getPrototypeOf(currentObj)));
const { ipcRenderer } = require('electron');
ipcRenderer.send('answer', rendererEventEmitterProperties);
})();