codegen: use FromJSValConvertible trait for Promise (#36966)

Before it was only used when converting to a `Record`, using it all the
times allow us to remove two methods.
Plus added a helper method in CodegenRust.py to avoid repeated code.

Testing: a successful build and existing tests should cover the changes.
Fixes: #36410

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24 2025-05-12 13:05:46 +02:00 committed by GitHub
parent d780fb7695
commit c37d5572fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 118 deletions

View file

@ -3562,10 +3562,6 @@ impl GlobalScopeHelpers<crate::DomTypeHolder> for GlobalScope {
GlobalScope::from_reflector(reflector, realm)
}
unsafe fn from_object_maybe_wrapped(obj: *mut JSObject, cx: *mut JSContext) -> DomRoot<Self> {
GlobalScope::from_object_maybe_wrapped(obj, cx)
}
fn origin(&self) -> &MutableOrigin {
GlobalScope::origin(self)
}