diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-03-11 02:33:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 02:33:02 +0100 |
commit | 808f797633ba82c0e9198481ddd742284a03cb9c (patch) | |
tree | da54caf98d23d05d855f367c48821b1ece9517b3 /cli/tools/test.rs | |
parent | 8db3a9546b59fdd5e7203f2e63a828e3c5108e7e (diff) |
fix(compat): cjs/esm interop for dynamic imports (#13792)
This commit fixes CJS/ESM interop in compat mode for dynamically
imported modules.
"ProcState::prepare_module_load" was changed to accept a list
of "graph roots" without associated "module kind". That module kind
was always hardcoded to "ESM" which is not true for CJS/ESM interop -
a CommonJs module might be imported using "import()" function. In
such case the root of the graph should have "CommonJs" module kind
instead of "ESM".
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r-- | cli/tools/test.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 61a37c7ff..d3eff1368 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -742,7 +742,7 @@ async fn check_specifiers( if !inline_files.is_empty() { let specifiers = inline_files .iter() - .map(|file| (file.specifier.clone(), ModuleKind::Esm)) + .map(|file| file.specifier.clone()) .collect(); for file in inline_files { @@ -764,7 +764,7 @@ async fn check_specifiers( .iter() .filter_map(|(specifier, mode)| { if *mode != TestMode::Documentation { - Some((specifier.clone(), ModuleKind::Esm)) + Some(specifier.clone()) } else { None } |