summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-25 18:57:48 +0200
committerGitHub <noreply@github.com>2021-04-25 18:57:48 +0200
commitc130cbb7b77f81680686e10e83b7d7dda9f5cf6b (patch)
tree0e7e57fafc715346bcf30cca7db1a1f8d132ea25
parent201185f9fb05c2cc1ab5304abeb04191f9337ab6 (diff)
feat(core): allow async opcalls in snapshots (#10308)
-rw-r--r--core/runtime.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index da8a6d93a..34a83e3f3 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -305,9 +305,7 @@ impl JsRuntime {
if !has_startup_snapshot {
js_runtime.js_init();
}
- if !options.will_snapshot {
- js_runtime.init_recv_cb();
- }
+ js_runtime.init_recv_cb();
js_runtime
}
@@ -432,7 +430,9 @@ impl JsRuntime {
// TODO(piscisaureus): The rusty_v8 type system should enforce this.
state.borrow_mut().global_context.take();
+ // Drop v8::Global handles before snapshotting
std::mem::take(&mut state.borrow_mut().module_map);
+ std::mem::take(&mut state.borrow_mut().js_recv_cb);
let snapshot_creator = self.snapshot_creator.as_mut().unwrap();
let snapshot = snapshot_creator