diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/flags.rs | 25 | ||||
-rw-r--r-- | cli/lib.rs | 7 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 5 | ||||
-rw-r--r-- | cli/tokio_util.rs | 13 |
4 files changed, 1 insertions, 49 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index eaf9b7fc5..d7a95d79e 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -85,8 +85,6 @@ pub struct DenoFlags { pub cached_only: bool, pub seed: Option<u64>, pub v8_flags: Option<Vec<String>>, - // Use tokio::runtime::current_thread - pub current_thread: bool, pub bundle_output: Option<String>, @@ -438,10 +436,6 @@ fn run_test_args_parse(flags: &mut DenoFlags, matches: &clap::ArgMatches) { flags.cached_only = true; } - if matches.is_present("current-thread") { - flags.current_thread = true; - } - if matches.is_present("seed") { let seed_string = matches.value_of("seed").unwrap(); let seed = seed_string.parse::<u64>().unwrap(); @@ -755,11 +749,6 @@ fn run_test_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> { .help("Require that remote dependencies are already cached"), ) .arg( - Arg::with_name("current-thread") - .long("current-thread") - .help("Use tokio::runtime::current_thread"), - ) - .arg( Arg::with_name("seed") .long("seed") .value_name("NUMBER") @@ -1874,20 +1863,6 @@ mod tests { } #[test] - fn current_thread() { - let r = flags_from_vec_safe(svec!["deno", "--current-thread", "script.ts"]); - assert_eq!( - r.unwrap(), - DenoFlags { - subcommand: DenoSubcommand::Run, - argv: svec!["deno", "script.ts"], - current_thread: true, - ..DenoFlags::default() - } - ); - } - - #[test] fn allow_net_whitelist_with_ports() { let r = flags_from_vec_safe(svec![ "deno", diff --git a/cli/lib.rs b/cli/lib.rs index fe20cd135..7a0d66cf5 100644 --- a/cli/lib.rs +++ b/cli/lib.rs @@ -378,7 +378,6 @@ fn run_repl(flags: DenoFlags) { } fn run_script(flags: DenoFlags) { - let use_current_thread = flags.current_thread; let (mut worker, state) = create_worker_and_state(flags); let maybe_main_module = state.main_module.as_ref(); @@ -416,11 +415,7 @@ fn run_script(flags: DenoFlags) { js_check(worker_.execute("window.dispatchEvent(new Event('unload'))")); }; - if use_current_thread { - tokio_util::run_on_current_thread(main_future); - } else { - tokio_util::run(main_future); - } + tokio_util::run(main_future); } fn format_command(files: Option<Vec<String>>, check: bool) { diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 501ff1713..b8103fd76 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -320,11 +320,6 @@ itest!(_036_import_map_fetch { output: "036_import_map_fetch.out", }); -itest!(_037_current_thread { - args: "run --current-thread --reload 034_onload/main.ts", - output: "034_onload.out", -}); - itest!(_038_checkjs { // checking if JS file is run through TS compiler args: "run --reload --config 038_checkjs.tsconfig.json 038_checkjs.js", diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs index 017013b3b..df14d11e4 100644 --- a/cli/tokio_util.rs +++ b/cli/tokio_util.rs @@ -15,16 +15,3 @@ where .expect("Unable to create Tokio runtime"); rt.block_on(future); } - -pub fn run_on_current_thread<F>(future: F) -where - F: Future<Output = ()> + Send + 'static, -{ - let mut rt = runtime::Builder::new() - .basic_scheduler() - .enable_all() - .thread_name("deno") - .build() - .expect("Unable to create Tokio runtime"); - rt.block_on(future); -} |