mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat(compat): inject Node globals in REPL (#12352)
This commit is contained in:
parent
6b43e862fd
commit
c49a057599
2 changed files with 20 additions and 1 deletions
|
@ -821,9 +821,14 @@ async fn format_command(
|
|||
async fn run_repl(flags: Flags, repl_flags: ReplFlags) -> Result<(), AnyError> {
|
||||
let main_module = resolve_url_or_path("./$deno$repl.ts").unwrap();
|
||||
let permissions = Permissions::from_options(&flags.clone().into());
|
||||
let ps = ProcState::build(flags).await?;
|
||||
let ps = ProcState::build(flags.clone()).await?;
|
||||
let mut worker =
|
||||
create_main_worker(&ps, main_module.clone(), permissions, None);
|
||||
if flags.compat {
|
||||
worker
|
||||
.execute_side_module(&compat::get_node_globals_url())
|
||||
.await?;
|
||||
}
|
||||
worker.run_event_loop(false).await?;
|
||||
|
||||
tools::repl::run(&ps, worker, repl_flags.eval).await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue