1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 08:39:09 -05:00

fix(ext/node): Add "module" to builtinsModule (#23242)

Fixes https://github.com/denoland/deno/issues/22731
This commit is contained in:
Divy Srivastava 2024-04-05 17:08:00 +05:30 committed by GitHub
parent 7446b0163d
commit f4b11db072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -218,6 +218,7 @@ function setupBuiltinModules() {
"internal/util/inspect": internalUtilInspect, "internal/util/inspect": internalUtilInspect,
"internal/util": internalUtil, "internal/util": internalUtil,
net, net,
module: Module,
os, os,
"path/posix": pathPosix, "path/posix": pathPosix,
"path/win32": pathWin32, "path/win32": pathWin32,

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { createRequire, isBuiltin, Module } from "node:module"; import { builtinModules, createRequire, isBuiltin, Module } from "node:module";
import { assert, assertEquals } from "@std/assert/mod.ts"; import { assert, assertEquals } from "@std/assert/mod.ts";
import process from "node:process"; import process from "node:process";
import * as path from "node:path"; import * as path from "node:path";
@ -83,3 +83,8 @@ Deno.test("[node/module isBuiltin] recognizes node builtins", () => {
// deno-lint-ignore no-explicit-any // deno-lint-ignore no-explicit-any
assert(!isBuiltin(undefined as any)); assert(!isBuiltin(undefined as any));
}); });
// https://github.com/denoland/deno/issues/22731
Deno.test("[node/module builtinModules] has 'module' in builtins", () => {
assert(builtinModules.includes("module"));
});