nstdlib-nightly
Version:
Node.js standard library converted to runtime-agnostic ES modules.
20 lines (13 loc) • 534 B
JavaScript
// Source: https://github.com/nodejs/node/blob/65eff1eb/lib/internal/process/worker_thread_only.js
import { codes as __codes__ } from "nstdlib/lib/internal/errors";
// This file contains process bootstrappers that can only be
// run in the worker thread.
const { ERR_WORKER_UNSUPPORTED_OPERATION } = __codes__;
function unavailable(name) {
function unavailableInWorker() {
throw new ERR_WORKER_UNSUPPORTED_OPERATION(name);
}
unavailableInWorker.disabled = true;
return unavailableInWorker;
}
export { unavailable };