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

17 lines
441 B
JavaScript

"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;
};