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:
tanishka 2024-10-22 15:38:55 +05:30 committed by GitHub
parent 575e885529
commit 7015e0fb5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 79 additions and 51 deletions

View file

@ -27,7 +27,7 @@ use crate::dom::paintworkletglobalscope::{PaintWorkletGlobalScope, PaintWorkletT
use crate::dom::testworkletglobalscope::{TestWorkletGlobalScope, TestWorkletTask};
use crate::dom::worklet::WorkletExecutor;
use crate::script_module::ScriptFetchOptions;
use crate::script_runtime::JSContext;
use crate::script_runtime::{CanGc, JSContext};
use crate::script_thread::MainThreadScriptMsg;
#[dom_struct]
@ -114,7 +114,7 @@ impl WorkletGlobalScope {
}
/// Evaluate a JS script in this global.
pub fn evaluate_js(&self, script: &str) -> bool {
pub fn evaluate_js(&self, script: &str, can_gc: CanGc) -> bool {
debug!("Evaluating Dom in a worklet.");
rooted!(in (*GlobalScope::get_cx()) let mut rval = UndefinedValue());
self.globalscope.evaluate_js_on_global_with_result(
@ -122,6 +122,7 @@ impl WorkletGlobalScope {
rval.handle_mut(),
ScriptFetchOptions::default_classic_script(&self.globalscope),
self.globalscope.api_base_url(),
can_gc,
)
}