Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
nabetti1720 committed Nov 12, 2024
1 parent d73fed2 commit 2aa3573
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions llrt_core/src/module_loader/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,13 @@ impl CustomLoader {
return (false, false, name, name);
}

// If it starts with CJS_IMPORT_PREFIX, mark as from_cjs_import
if let Some(cjs_path) = name.strip_prefix(CJS_IMPORT_PREFIX) {
if let Some(cjs_path) = cjs_path.strip_prefix(CJS_LOADER_PREFIX) {
return (true, false, cjs_path, cjs_path);
}
// If it starts with CJS_IMPORT_PREFIX, mark as from_cjs_import
return (true, false, name, cjs_path);
}

// If it starts with CJS_LOADER_PREFIX, mark as is_cjs
if let Some(cjs_path) = name.strip_prefix(CJS_LOADER_PREFIX) {
if let Some(cjs_path) = cjs_path.strip_prefix(CJS_IMPORT_PREFIX) {
return (false, true, cjs_path, cjs_path);
}
// If it starts with CJS_LOADER_PREFIX, mark as is_cjs
return (false, true, cjs_path, cjs_path);
}

Expand Down

0 comments on commit 2aa3573

Please sign in to comment.