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>
This commit is contained in:
Josh Matthews 2024-12-13 18:21:55 -05:00 committed by GitHub
parent 2328145c25
commit a85241e635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 33 additions and 106 deletions

View file

@ -723,7 +723,7 @@ impl CustomElementDefinition {
{
// Go into the constructor's realm
let _ac = JSAutoRealm::new(*cx, self.constructor.callback());
let args = HandleValueArray::new();
let args = HandleValueArray::empty();
if unsafe { !Construct1(*cx, constructor.handle(), &args, element.handle_mut()) } {
return Err(Error::JSFailed);
}
@ -908,7 +908,7 @@ fn run_upgrade_constructor(
// Go into the constructor's realm
let _ac = JSAutoRealm::new(*cx, constructor.callback());
let args = HandleValueArray::new();
let args = HandleValueArray::empty();
// Step 8.2
if unsafe {
!Construct1(