diff options
author | AbhishekSharma102 <20724848+AbhishekSharma102@users.noreply.github.com> | 2020-07-13 06:04:00 +0000 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-07-21 16:20:51 -0400 |
commit | 1119dd119ed335b6d6e448290b56e0eeab6de25f (patch) | |
tree | c1d2ae2b369a20923cfe8e24496193896c4ad473 /components/script/devtools.rs | |
parent | bfb7bea704340e19583b04fb02b444fadd35e9e1 (diff) | |
download | servo-1119dd119ed335b6d6e448290b56e0eeab6de25f.tar.gz servo-1119dd119ed335b6d6e448290b56e0eeab6de25f.zip |
Added off thread compilation
Co-authored-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Abhishek Sharma <20724848+AbhishekSharma102@users.noreply.github.com>
Diffstat (limited to 'components/script/devtools.rs')
-rw-r--r-- | components/script/devtools.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs index cb5dfa27b7f..04c35755b89 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -14,6 +14,7 @@ use crate::dom::bindings::str::DOMString; use crate::dom::document::AnimationFrameCallback; use crate::dom::element::Element; use crate::dom::globalscope::GlobalScope; +use crate::dom::htmlscriptelement::SourceCode; use crate::dom::node::{window_from_node, Node, ShadowIncluding}; use crate::realms::enter_realm; use crate::script_module::ScriptFetchOptions; @@ -25,6 +26,7 @@ use js::jsval::UndefinedValue; use js::rust::wrappers::ObjectClassName; use msg::constellation_msg::PipelineId; use std::ffi::CStr; +use std::rc::Rc; use std::str; use uuid::Uuid; @@ -35,8 +37,9 @@ pub fn handle_evaluate_js(global: &GlobalScope, eval: String, reply: IpcSender<E let cx = global.get_cx(); let _ac = enter_realm(global); rooted!(in(*cx) let mut rval = UndefinedValue()); + let source_code = SourceCode::Text(Rc::new(DOMString::from_string(eval))); global.evaluate_script_on_global_with_result( - &eval, + &source_code, "<eval>", rval.handle_mut(), 1, |