fix: properly hide relaySignal from process.listeners()
Closes https://github.com/privatenumber/tsx/issues/742
A past commit (https://github.com/privatenumber/tsx/commit/a88289d70dacdec8d6ed99c27d0d35dfb22975fb) broke [the comparison](https://github.com/privatenumber/tsx/blob/20b91c44bbb00006f182fee3b0bcfc55aaec6e44/src/preflight.cts#L44) in the monkey-patched `process.listeners()`.
The passed `handler` is not directly attached as a listener anymore, but only called in an anonymous listener. So the reference comparison is broken.
To fix this, store the listeners in a map, then compare against the stored listeners.
合并状态:未合并 关闭于 2025-09-26 1 条评论