summaryrefslogtreecommitdiff
path: root/ext/node/ops/require.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-07 09:56:06 -0500
committerGitHub <noreply@github.com>2023-11-07 09:56:06 -0500
commit9201198efd6fb116585d4c26111669f4c1006e5d (patch)
tree746b2283da7edb457cea5eced2bc6cd7b42b8067 /ext/node/ops/require.rs
parent50e4806a2db66be289aa123a0bfd8dd8688712ba (diff)
fix(node): inspect ancestor directories when resolving cjs re-exports during analysis (#21104)
If a CJS re-export can't be resolved, it will check the ancestor directories, which is more similar to what `require` does at runtime.
Diffstat (limited to 'ext/node/ops/require.rs')
-rw-r--r--ext/node/ops/require.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs
index ceb771bf9..8010558c5 100644
--- a/ext/node/ops/require.rs
+++ b/ext/node/ops/require.rs
@@ -209,7 +209,7 @@ pub fn op_require_is_deno_dir_package(
#[string] path: String,
) -> bool {
let resolver = state.borrow::<NpmResolverRc>();
- resolver.in_npm_package_at_path(&PathBuf::from(path))
+ resolver.in_npm_package_at_file_path(&PathBuf::from(path))
}
#[op2]
@@ -484,7 +484,7 @@ where
let permissions = state.borrow::<P>();
let pkg_path = if npm_resolver
- .in_npm_package_at_path(&PathBuf::from(&modules_path))
+ .in_npm_package_at_file_path(&PathBuf::from(&modules_path))
&& !uses_local_node_modules_dir
{
modules_path