summaryrefslogtreecommitdiff
path: root/cli/tsc.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-09-10 09:57:45 -0400
committerGitHub <noreply@github.com>2020-09-10 09:57:45 -0400
commit7c2e7c660804afca823d60e6496aa853f75db16c (patch)
treeb7746b181c1564c6b1abd2e906662f9e6b008417 /cli/tsc.rs
parent6f70e6e72ba2d5c1de7495adac37c1e4f4e86b24 (diff)
Use gotham-like state for ops (#7385)
Provides a concrete state type that can be dynamically added. This is necessary for op crates. * renames BasicState to OpState * async ops take `Rc<RefCell<OpState>>` * sync ops take `&mut OpState` * removes `OpRegistry`, `OpRouter` traits * `get_error_class_fn` moved to OpState * ResourceTable moved to OpState
Diffstat (limited to 'cli/tsc.rs')
-rw-r--r--cli/tsc.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/cli/tsc.rs b/cli/tsc.rs
index 36a7cf054..77b855dd1 100644
--- a/cli/tsc.rs
+++ b/cli/tsc.rs
@@ -139,15 +139,12 @@ impl CompilerWorker {
startup_data: StartupData,
state: &Rc<State>,
) -> Self {
- let worker = Worker::new(name, startup_data, state);
+ let mut worker = Worker::new(name, startup_data, state);
let response = Arc::new(Mutex::new(None));
- {
- ops::runtime::init(&state);
- ops::errors::init(&state);
- ops::timers::init(&state);
- ops::compiler::init(&state, response.clone());
- }
-
+ ops::runtime::init(&mut worker);
+ ops::errors::init(&mut worker);
+ ops::timers::init(&mut worker);
+ ops::compiler::init(&mut worker, response.clone());
Self { worker, response }
}