mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
The island host replaced process.on, process.addListener and process.prependListener with separate wrappers, and process.emit with its own, as own enumerable properties of process. Island code could see the difference: Object.keys(process) listed the four, process.on was no longer process.addListener, prependListener was named addListener, and each was an own property where Node inherits it. One wrapper now serves on and addListener, and prependListener and emit keep their names. They are defined on process's own prototype, which Node gives process below EventEmitter.prototype, with EventEmitter.prototype's attributes. process has no own property for them, so Object.keys, Object.hasOwn and for...in see what they see in Node. for...in lists a prototype's keys before its parent's, so the keys EventEmitter.prototype lists before the wrapped ones (_events, _eventsCount, _maxListeners, setMaxListeners, getMaxListeners) are defined there too, with the same values, in their order. 6891 compares the identities, names, lengths, own-ness, Object.keys and for...in over process against Node.