nodejs/lib/internal/process/worker_thread_only.js
Antoine du Hamel 231548b5cf
lib: enforce ASCII order in error code imports
PR-URL: https://github.com/nodejs/node/pull/52625
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-04-23 17:05:38 +00:00

24 lines
433 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,
};