diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-12-16 17:14:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 17:14:12 +0100 |
commit | 6984b63f2f3c8d0819fe2dced8252a81f3400ae7 (patch) | |
tree | 5201bc962f913927409ae2770aca48ffa3aaaa34 /runtime/web_worker.rs | |
parent | 9fe26f8ca189ac81d9c20c454b9dbfa5e1011c3f (diff) |
refactor: rewrite ops to use ResourceTable2 (#8512)
This commit migrates all ops to use new resource table
and "AsyncRefCell".
Old implementation of resource table was completely
removed and all code referencing it was updated to use
new system.
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r-- | runtime/web_worker.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index db97e3604..c1713f815 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -256,15 +256,16 @@ impl WebWorker { let op_state = js_runtime.op_state(); let mut op_state = op_state.borrow_mut(); + let t = &mut op_state.resource_table; let (stdin, stdout, stderr) = ops::io::get_stdio(); if let Some(stream) = stdin { - op_state.resource_table.add("stdin", Box::new(stream)); + t.add(stream); } if let Some(stream) = stdout { - op_state.resource_table.add("stdout", Box::new(stream)); + t.add(stream); } if let Some(stream) = stderr { - op_state.resource_table.add("stderr", Box::new(stream)); + t.add(stream); } } |