mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script: Expose new methods for obtaining a global that require a realm. (#36116)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
73e7d38a8d
commit
1df1ba58d6
7 changed files with 42 additions and 19 deletions
|
@ -33,6 +33,18 @@ pub(crate) enum InRealm<'a> {
|
|||
Entered(&'a JSAutoRealm),
|
||||
}
|
||||
|
||||
impl<'a> From<&'a AlreadyInRealm> for InRealm<'a> {
|
||||
fn from(token: &'a AlreadyInRealm) -> InRealm<'a> {
|
||||
InRealm::already(token)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a JSAutoRealm> for InRealm<'a> {
|
||||
fn from(token: &'a JSAutoRealm) -> InRealm<'a> {
|
||||
InRealm::entered(token)
|
||||
}
|
||||
}
|
||||
|
||||
impl InRealm<'_> {
|
||||
pub(crate) fn already(token: &AlreadyInRealm) -> InRealm {
|
||||
InRealm::Already(token)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue