node/lib/internal/process/worker_thread_only.js
Antoine du Hamel cafc0b2b33
lib: add trailing commas in internal/process
PR-URL: https://github.com/nodejs/node/pull/46687
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-02-18 18:56:43 +01:00

22 lines
426 B
JavaScript

'use strict';
// This file contains process bootstrappers that can only be
// run in the worker thread.
const {
codes: { ERR_WORKER_UNSUPPORTED_OPERATION },
} = require('internal/errors');
function unavailable(name) {
function unavailableInWorker() {
throw new ERR_WORKER_UNSUPPORTED_OPERATION(name);
}
unavailableInWorker.disabled = true;
return unavailableInWorker;
}
module.exports = {
unavailable,
};