summaryrefslogtreecommitdiff
path: root/runtime/js/98_global_scope_shared.js
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /runtime/js/98_global_scope_shared.js
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'runtime/js/98_global_scope_shared.js')
-rw-r--r--runtime/js/98_global_scope_shared.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/js/98_global_scope_shared.js b/runtime/js/98_global_scope_shared.js
index 7a2723899..f8e76b7ce 100644
--- a/runtime/js/98_global_scope_shared.js
+++ b/runtime/js/98_global_scope_shared.js
@@ -32,6 +32,8 @@ import { DOMException } from "ext:deno_web/01_dom_exception.js";
import * as abortSignal from "ext:deno_web/03_abort_signal.js";
import * as imageData from "ext:deno_web/16_image_data.js";
import process from "node:process";
+import Buffer from "node:buffer";
+import { clearImmediate, setImmediate } from "node:timers";
import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
import { unstableIds } from "ext:runtime/90_deno_ns.js";
@@ -300,4 +302,15 @@ unstableForWindowOrWorkerGlobalScope[unstableIds.net] = {
unstableForWindowOrWorkerGlobalScope[unstableIds.webgpu] = {};
+unstableForWindowOrWorkerGlobalScope[unstableIds.nodeGlobals] = {
+ Buffer: core.propWritable(Buffer),
+ setImmediate: core.propWritable(setImmediate),
+ clearImmediate: core.propWritable(clearImmediate),
+ global: {
+ enumerable: true,
+ configurable: true,
+ get: () => globalThis,
+ },
+};
+
export { unstableForWindowOrWorkerGlobalScope, windowOrWorkerGlobalScope };