diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-08-24 14:54:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 14:54:20 +0200 |
commit | 5268fa0e0f34571f0fc615eb665747863aca311e (patch) | |
tree | 3c23531d8484e4821662bc822634eabb9862dd57 /ext/node/02_require.js | |
parent | f3bde1d53b4710fb526286e27af29a55f5da18c7 (diff) |
fix(unstable): various resolution bugs for npm: specifiers (#15546)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'ext/node/02_require.js')
-rw-r--r-- | ext/node/02_require.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/node/02_require.js b/ext/node/02_require.js index d71ea611a..f2b42da53 100644 --- a/ext/node/02_require.js +++ b/ext/node/02_require.js @@ -40,6 +40,9 @@ const cjsParseCache = new SafeWeakMap(); function pathDirname(filepath) { + if (filepath == null || filepath === "") { + throw new Error("Empty filepath."); + } return ops.op_require_path_dirname(filepath); } @@ -470,6 +473,7 @@ if (isMain) { node.globalThis.process.mainModule = module; + mainModule = module; module.id = "."; } @@ -884,6 +888,7 @@ cjsParseCache, readPackageScope, bindExport, + moduleExports: m, }, }; })(globalThis); |