1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(ext/node): register node:wasi built-in (#25134)

Fixes https://github.com/denoland/deno/issues/23531

(cherry picked from commit 2531204a34)
This commit is contained in:
Divy Srivastava 2024-08-21 20:33:52 -07:00 committed by crowlkats
parent 3314a0ceb8
commit 1bafcf538e
No known key found for this signature in database
GPG key ID: A82C9D461FC483E8
7 changed files with 13 additions and 3 deletions

View file

@ -594,7 +594,6 @@ deno_core::extension!(deno_node,
"path/mod.ts", "path/mod.ts",
"path/separator.ts", "path/separator.ts",
"readline/promises.ts", "readline/promises.ts",
"wasi.ts",
"node:assert" = "assert.ts", "node:assert" = "assert.ts",
"node:assert/strict" = "assert/strict.ts", "node:assert/strict" = "assert/strict.ts",
"node:async_hooks" = "async_hooks.ts", "node:async_hooks" = "async_hooks.ts",
@ -645,6 +644,7 @@ deno_core::extension!(deno_node,
"node:util/types" = "util/types.ts", "node:util/types" = "util/types.ts",
"node:v8" = "v8.ts", "node:v8" = "v8.ts",
"node:vm" = "vm.js", "node:vm" = "vm.js",
"node:wasi" = "wasi.ts",
"node:worker_threads" = "worker_threads.ts", "node:worker_threads" = "worker_threads.ts",
"node:zlib" = "zlib.ts", "node:zlib" = "zlib.ts",
], ],

View file

@ -75,6 +75,7 @@ generate_builtin_node_module_lists! {
"util/types", "util/types",
"v8", "v8",
"vm", "vm",
"wasi",
"worker_threads", "worker_threads",
"zlib", "zlib",
} }

View file

@ -151,7 +151,7 @@ import util from "node:util";
import v8 from "node:v8"; import v8 from "node:v8";
import vm from "node:vm"; import vm from "node:vm";
import workerThreads from "node:worker_threads"; import workerThreads from "node:worker_threads";
import wasi from "ext:deno_node/wasi.ts"; import wasi from "node:wasi";
import zlib from "node:zlib"; import zlib from "node:zlib";
const nativeModuleExports = ObjectCreate(null); const nativeModuleExports = ObjectCreate(null);

View file

@ -7663,6 +7663,7 @@ fn lsp_completions_node_specifier() {
"node:util/types", "node:util/types",
"node:v8", "node:v8",
"node:vm", "node:vm",
"node:wasi",
"node:worker_threads", "node:worker_threads",
"node:zlib", "node:zlib",
], ],

View file

@ -96,6 +96,7 @@ util::unit_test_factory!(
util_test, util_test,
v8_test, v8_test,
vm_test, vm_test,
wasi_test,
worker_threads_test, worker_threads_test,
zlib_test zlib_test
] ]

View file

@ -0,0 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import wasi from "node:wasi";
import { assertThrows } from "@std/assert";
Deno.test("[node/wasi] - WASI should throw (not implemented)", () => {
assertThrows(() => new wasi.WASI());
});

View file

@ -206,7 +206,7 @@
"node:util/types": "../ext/node/polyfills/util/types.ts", "node:util/types": "../ext/node/polyfills/util/types.ts",
"node:v8": "../ext/node/polyfills/v8.ts", "node:v8": "../ext/node/polyfills/v8.ts",
"node:vm": "../ext/node/polyfills/vm.js", "node:vm": "../ext/node/polyfills/vm.js",
"ext:deno_node/wasi.ts": "../ext/node/polyfills/wasi.ts", "node:wasi": "../ext/node/polyfills/wasi.ts",
"node:worker_threads": "../ext/node/polyfills/worker_threads.ts", "node:worker_threads": "../ext/node/polyfills/worker_threads.ts",
"node:zlib": "../ext/node/polyfills/zlib.ts", "node:zlib": "../ext/node/polyfills/zlib.ts",
"ext:deno_url/00_url.js": "../ext/url/00_url.js", "ext:deno_url/00_url.js": "../ext/url/00_url.js",