mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
CanGc fixes in errorevent.rs (#33960)
* CanGc fixes in errorevent.rs Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Allow too_many_arguments to avoid lint error Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
@@ -44,7 +44,12 @@ use crate::script_runtime::CanGc;
|
||||
use crate::script_thread::Documents;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn handle_evaluate_js(global: &GlobalScope, eval: String, reply: IpcSender<EvaluateJSReply>) {
|
||||
pub fn handle_evaluate_js(
|
||||
global: &GlobalScope,
|
||||
eval: String,
|
||||
reply: IpcSender<EvaluateJSReply>,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
// global.get_cx() returns a valid `JSContext` pointer, so this is safe.
|
||||
let result = unsafe {
|
||||
let cx = GlobalScope::get_cx();
|
||||
@@ -58,6 +63,7 @@ pub fn handle_evaluate_js(global: &GlobalScope, eval: String, reply: IpcSender<E
|
||||
1,
|
||||
ScriptFetchOptions::default_classic_script(global),
|
||||
global.api_base_url(),
|
||||
can_gc,
|
||||
);
|
||||
|
||||
if rval.is_undefined() {
|
||||
|
||||
Reference in New Issue
Block a user