securityos/node_modules/@wasmer/wasmfs/lib/node_sync_emit.js

17 lines
441 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const node_1 = require("memfs/lib/node");
// Make emit synchronous
node_1.Node.prototype.emit = function (event, ...args) {
const listeners = this.listeners(event);
for (let listener of listeners) {
try {
listener(...args);
}
catch (e) {
console.error(e);
}
}
return listeners.length > 0;
};