script: Add can_gc to WebIDL dictionary constructors (#39195)

More progress on can_gc!

Testing: Internal change only, shouldn't change behavior.
Fixes: #38708

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This commit is contained in:
lumiscosity 2025-09-08 11:21:42 +02:00 committed by GitHub
parent 1b9dc3e672
commit 9584b9e57d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 26 additions and 17 deletions

View file

@ -635,12 +635,13 @@ impl PermissionAlgorithm for Bluetooth {
fn create_descriptor(
cx: JSContext,
permission_descriptor_obj: *mut JSObject,
can_gc: CanGc,
) -> Result<BluetoothPermissionDescriptor, Error> {
rooted!(in(*cx) let mut property = UndefinedValue());
property
.handle_mut()
.set(ObjectValue(permission_descriptor_obj));
match BluetoothPermissionDescriptor::new(cx, property.handle()) {
match BluetoothPermissionDescriptor::new(cx, property.handle(), can_gc) {
Ok(ConversionResult::Success(descriptor)) => Ok(descriptor),
Ok(ConversionResult::Failure(error)) => Err(Error::Type(error.into_owned())),
Err(_) => Err(Error::Type(String::from(BT_DESC_CONVERSION_ERROR))),