From 587deacad92624d3e4a48c81a85551d03f626c36 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 12 May 2021 15:34:29 -0700 Subject: [PATCH] tools: add `Worker` to type-parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/38659 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Gerhard Stöbich --- test/parallel/test-worker-event.js | 3 ++- tools/doc/type-parser.mjs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-worker-event.js b/test/parallel/test-worker-event.js index 9d6056e1091468..01e95ead8316cb 100644 --- a/test/parallel/test-worker-event.js +++ b/test/parallel/test-worker-event.js @@ -4,10 +4,11 @@ const common = require('../common'); const assert = require('assert'); const { Worker, + threadId: parentThreadId, } = require('worker_threads'); process.on('worker', common.mustCall(({ threadId }) => { - assert.strictEqual(threadId, 1); + assert.strictEqual(threadId, parentThreadId + 1); })); new Worker('', { eval: true }); diff --git a/tools/doc/type-parser.mjs b/tools/doc/type-parser.mjs index 3feac3b211c749..090a6820d54943 100644 --- a/tools/doc/type-parser.mjs +++ b/tools/doc/type-parser.mjs @@ -175,6 +175,7 @@ const customTypesMap = { 'vm.SourceTextModule': 'vm.html#vm_class_vm_sourcetextmodule', 'MessagePort': 'worker_threads.html#worker_threads_class_messageport', + 'Worker': 'worker_threads.html#worker_threads_class_worker', 'zlib options': 'zlib.html#zlib_class_options', };