From 6da82b1057afb4dbc94e3eada224dfdb97d6a533 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 3 Feb 2019 02:06:27 -0800 Subject: [PATCH] worker: remove undocumented .onclose property Remove setting of a 'close' event handler on MessagePort through the use of an `.onclose` property. We don't use this convention anywhere else in our codebase for 'close' events, this feature is undocumented, and we don't test it. PR-URL: https://github.com/nodejs/node/pull/25904 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yuta Hiroto Reviewed-By: Ujjwal Sharma --- lib/internal/worker/io.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index ad8056b5b91..9aa8c199588 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -102,12 +102,6 @@ Object.defineProperty(MessagePort.prototype, onInitSymbol, { // This is called after the underlying `uv_async_t` has been closed. function onclose() { - if (typeof this.onclose === 'function') { - // Not part of the Web standard yet, but there aren't many reasonable - // alternatives in a non-EventEmitter usage setting. - // Refs: https://github.com/whatwg/html/issues/1766 - this.onclose(); - } this.emit('close'); }