summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-05-29 17:41:39 -0400
committerGitHub <noreply@github.com>2020-05-29 17:41:39 -0400
commitd4b05dd89e94ed1bba5b24c683da0a895f2ce597 (patch)
tree7e098257f5558a624e1d691f92c4d6d4cef56667 /cli/worker.rs
parent106b00173806e088472e123d04fdc8d260c3820d (diff)
refactor: Split isolate and state using safe get_slot() (#5929)
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 3e338d933..524091422 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -4,6 +4,7 @@ use crate::inspector::DenoInspector;
use crate::ops;
use crate::state::State;
use deno_core::Buf;
+use deno_core::CoreIsolate;
use deno_core::ErrBox;
use deno_core::ModuleId;
use deno_core::ModuleSpecifier;
@@ -86,7 +87,7 @@ fn create_channels() -> (WorkerChannelsInternal, WorkerHandle) {
/// - `WebWorker`
pub struct Worker {
pub name: String,
- pub isolate: Box<deno_core::EsIsolate>,
+ pub isolate: deno_core::EsIsolate,
pub inspector: Option<Box<DenoInspector>>,
pub state: State,
pub waker: AtomicWaker,
@@ -101,7 +102,9 @@ impl Worker {
{
let global_state = state.borrow().global_state.clone();
- isolate.set_js_error_create_fn(move |core_js_error| {
+ let core_state_rc = CoreIsolate::state(&isolate);
+ let mut core_state = core_state_rc.borrow_mut();
+ core_state.set_js_error_create_fn(move |core_js_error| {
JSError::create(core_js_error, &global_state.ts_compiler)
});
}