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

fix(ext/node): fix builtin module module (#15904)

This commit is contained in:
Yoshiya Hinosawa 2022-09-17 20:35:32 +09:00 committed by GitHub
parent 5fe660ecd7
commit d7b27ed63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 22 deletions

View file

@ -1,2 +1,4 @@
function
function
function
true

View file

@ -2,4 +2,6 @@ import m1 from "node:module";
import m2 from "module";
console.log(typeof m1.Module);
console.log(typeof m2.Module);
console.log(typeof m2.Module);
console.log(typeof m1);
console.log(m1 === m1.Module);

View file

@ -828,25 +828,7 @@
Module.Module = Module;
const m = {
_cache: Module._cache,
_extensions: Module._extensions,
_findPath: Module._findPath,
_initPaths: Module._initPaths,
_load: Module._load,
_nodeModulePaths: Module._nodeModulePaths,
_pathCache: Module._pathCache,
_preloadModules: Module._preloadModules,
_resolveFilename: Module._resolveFilename,
_resolveLookupPaths: Module._resolveLookupPaths,
builtinModules: Module.builtinModules,
createRequire: Module.createRequire,
globalPaths: Module.globalPaths,
Module,
wrap: Module.wrap,
};
node.nativeModuleExports.module = m;
node.nativeModuleExports.module = Module;
function loadNativeModule(_id, request) {
if (nativeModulePolyfill.has(request)) {
@ -890,7 +872,6 @@
toRealPath,
cjsParseCache,
readPackageScope,
moduleExports: m,
},
};
})(globalThis);

View file

@ -1,4 +1,4 @@
const m = Deno[Deno.internal].require.moduleExports;
const m = Deno[Deno.internal].require.Module;
export const _cache = m._cache;
export const _extensions = m._extensions;
export const _findPath = m._findPath;