aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2024-12-13 18:21:55 -0500
committerGitHub <noreply@github.com>2024-12-13 23:21:55 +0000
commita85241e6353a912b312f45de6e9d4668c67761f8 (patch)
tree7447a7743fb8697b4e95ff6305096783d3c25cf7 /components/script/dom/bindings/codegen
parent2328145c256b816dd9e43a54a56c9be041ce10a3 (diff)
downloadservo-a85241e6353a912b312f45de6e9d4668c67761f8.tar.gz
servo-a85241e6353a912b312f45de6e9d4668c67761f8.zip
Replace unsafe uses of HandleValueArray. (#34588)
* Replace unsafe uses of HandleValueArray. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy lint. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/bindings/codegen')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index fdb01a67a35..e25ed68d3e8 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -8170,7 +8170,10 @@ class CGIterableMethodGenerator(CGGeneric):
rooted!(in(*cx) let arg0 = ObjectValue(arg0));
rooted!(in(*cx) let mut call_arg1 = UndefinedValue());
rooted!(in(*cx) let mut call_arg2 = UndefinedValue());
- let mut call_args = [UndefinedValue(), UndefinedValue(), ObjectValue(*_obj)];
+ rooted_vec!(let mut call_args);
+ call_args.push(UndefinedValue());
+ call_args.push(UndefinedValue());
+ call_args.push(ObjectValue(*_obj));
rooted!(in(*cx) let mut ignoredReturnVal = UndefinedValue());
// This has to be a while loop since get_iterable_length() may change during
@@ -8186,8 +8189,8 @@ class CGIterableMethodGenerator(CGGeneric):
(*this).get_key_at_index(i).to_jsval(*cx, call_arg2.handle_mut());
call_args[0] = call_arg1.handle().get();
call_args[1] = call_arg2.handle().get();
- let call_args = HandleValueArray { length_: 3, elements_: call_args.as_ptr() };
- if !Call(*cx, arg1, arg0.handle(), &call_args,
+ let call_args_handle = HandleValueArray::from(&call_args);
+ if !Call(*cx, arg1, arg0.handle(), &call_args_handle,
ignoredReturnVal.handle_mut()) {
return false;
}