script: Return a Result from GlobalScope::evaluate_script_on_global_with_result (#38549)

Make GlobalScope::evaluate_script_on_global_with_result return a Result
instead of a boolean. This is the first step to resolve issue #37810.

Testing: Should not break or fix any existing tests

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2025-08-10 18:51:46 +02:00 committed by GitHub
parent 86c37a380b
commit 4f8731d562
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 45 additions and 28 deletions

View file

@ -31,7 +31,7 @@ pub(crate) fn load_script(head: &HTMLHeadElement) {
Rc::new(DOMString::from_string(user_script.script))
);
let global_scope = win.as_global_scope();
global_scope.evaluate_script_on_global_with_result(
_ = global_scope.evaluate_script_on_global_with_result(
&script_text,
&user_script.source_file.map(|path| path.to_string_lossy().to_string()).unwrap_or_default(),
rval.handle_mut(),