diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-11-25 15:21:27 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-11-26 21:54:33 -0500 |
commit | 7944d9548cdac3eb18e28035378821a17076e2e5 (patch) | |
tree | 31c11c4c55a5c3c6dcc019fdfd63c794b6a1a11f /components/script/init.rs | |
parent | f1aa5d8dbdc32f6f474b09234558652b9bead686 (diff) | |
download | servo-7944d9548cdac3eb18e28035378821a17076e2e5.tar.gz servo-7944d9548cdac3eb18e28035378821a17076e2e5.zip |
script: Ensure JS engine is initialized and deinitialized on the same thread.
Diffstat (limited to 'components/script/init.rs')
-rw-r--r-- | components/script/init.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/init.rs b/components/script/init.rs index 15428f4f3fe..30e01dda74e 100644 --- a/components/script/init.rs +++ b/components/script/init.rs @@ -4,6 +4,7 @@ use crate::dom::bindings::codegen::RegisterBindings; use crate::dom::bindings::proxyhandler; +use crate::script_runtime::JSEngineSetup; use crate::serviceworker_manager::ServiceWorkerManager; use script_traits::SWManagerSenders; @@ -56,7 +57,7 @@ pub fn init_service_workers(sw_senders: SWManagerSenders) { } #[allow(unsafe_code)] -pub fn init() { +pub fn init() -> JSEngineSetup { unsafe { proxyhandler::init(); @@ -66,4 +67,6 @@ pub fn init() { } perform_platform_specific_initialization(); + + JSEngineSetup::new() } |