diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-12-29 14:30:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 14:30:08 +0100 |
commit | 42081994902bab89e24c5f7cd9adf12a158ed5f5 (patch) | |
tree | c12facbabb6973063ebe4877fcdea574d96ce5a7 /cli/standalone.rs | |
parent | 6d017d42aaa5a04002af4c224dc8c3997e39293a (diff) |
cleanup(cli): use op Extensions (#13223)
Enabling op-middleware for overrides in lieu of imperative .replace_op() etc...
Impacts #13219, #12938, #13122
Diffstat (limited to 'cli/standalone.rs')
-rw-r--r-- | cli/standalone.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cli/standalone.rs b/cli/standalone.rs index c7a5b2c14..f135e9946 100644 --- a/cli/standalone.rs +++ b/cli/standalone.rs @@ -249,7 +249,7 @@ pub async fn run( ts_version: version::TYPESCRIPT.to_string(), unstable: metadata.unstable, }, - extensions: vec![], + extensions: ops::cli_exts(ps.clone(), true), user_agent: version::get_user_agent(), unsafely_ignore_certificate_errors: metadata .unsafely_ignore_certificate_errors, @@ -272,17 +272,6 @@ pub async fn run( permissions, options, ); - // TODO(@AaronO): move to a JsRuntime Extension passed into options - { - let js_runtime = &mut worker.js_runtime; - js_runtime - .op_state() - .borrow_mut() - .put::<ProcState>(ps.clone()); - ops::errors::init(js_runtime); - ops::runtime_compiler::init(js_runtime); - js_runtime.sync_ops_cache(); - } worker.execute_main_module(&main_module).await?; worker.dispatch_load_event(&located_script_name!())?; worker.run_event_loop(true).await?; |