Skip to content

Commit

Permalink
feat: update to node 22.x
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 2, 2024
1 parent 5b17bcd commit bb28cac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
22.11.0
7 changes: 7 additions & 0 deletions src/runtime/node/process/internal/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ const channel: Process["channel"] = {
};
const throwDeprecation: Process["throwDeprecation"] = false;

export const finalization: Process["finalization"] = {
register() {},
unregister() {},
registerBeforeExit() {},
};

// --- Undocumented internals ---

export const assert = notImplemented("process.assert");
Expand Down Expand Up @@ -302,6 +308,7 @@ export const process = {
execArgv,
execPath,
exit,
finalization,
features,
getBuiltinModule,
getegid,
Expand Down
7 changes: 7 additions & 0 deletions src/runtime/node/worker_threads/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MessageChannel } from "./internal/message-channel";
import { MessagePort } from "./internal/message-port";
import { Worker } from "./internal/worker";
import { Serializable } from "node:worker_threads";
import { notImplemented } from "../../_internal/utils";

export { BroadcastChannel } from "./internal/broadcast-channel";
export { MessageChannel } from "./internal/message-channel";
Expand Down Expand Up @@ -51,6 +52,11 @@ export const threadId: typeof worker_threads.threadId = 0;

export const workerData: typeof worker_threads.workerData = null;

// https://nodejs.org/api/worker_threads.html#workerpostmessagetothreadthreadid-value-transferlist-timeout
export const postMessageToThread = notImplemented(
"worker_threads.postMessageToThread",
);

export default <typeof worker_threads>{
BroadcastChannel,
MessageChannel,
Expand All @@ -67,6 +73,7 @@ export default <typeof worker_threads>{
receiveMessageOnPort,
resourceLimits,
setEnvironmentData,
postMessageToThread,
threadId,
workerData,
};

0 comments on commit bb28cac

Please sign in to comment.