script: Modify ModuleObject::handle() to return a handle with a lifetime (#42071)

Changed the return type of `ModuleObject::handle()` to the original type
of its contained handle by removing `.into()` call, as requested in the
linked issue.

Additional changes are due to temporary borrows now sharing lifetime
with returned handle reference.

Testing: No new tests needed, as the code is functionally the same after
the changes. Verified with running `./mach test-build` and `./mach
test-unit` successfully.
Fixes: https://github.com/servo/servo/issues/42051

Signed-off-by: Krzysztof Biedroń <arkendil@gmail.com>
This commit is contained in:
Krzysztof Biedroń
2026-01-25 01:13:32 +01:00
committed by GitHub
parent e040960366
commit 17e3061ecd
3 changed files with 24 additions and 23 deletions

View File

@@ -1060,8 +1060,7 @@ impl HTMLScriptElement {
if let Some(record) = record {
rooted!(in(*GlobalScope::get_cx()) let mut rval = UndefinedValue());
let evaluated =
module_tree.execute_module(global, record, rval.handle_mut().into(), can_gc);
let evaluated = module_tree.execute_module(global, record, rval.handle_mut(), can_gc);
if let Err(exception) = evaluated {
module_tree.set_rethrow_error(exception);