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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
445 B
JavaScript
Raw Normal View History

(function () {
const { EventEmitter } = require('node: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);
})();