mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -3960,7 +3960,7 @@ class CGCallGenerator(CGThing):
|
|||
if static:
|
||||
glob = "global.upcast::<D::GlobalScope>()"
|
||||
else:
|
||||
glob = "&this.global()"
|
||||
glob = "&this.global_(InRealm::already(&AlreadyInRealm::assert_for_cx(cx)))"
|
||||
|
||||
self.cgRoot.append(CGGeneric(
|
||||
"let result = match result {\n"
|
||||
|
@ -8454,7 +8454,8 @@ class CGIterableMethodGenerator(CGGeneric):
|
|||
return
|
||||
CGGeneric.__init__(self, fill(
|
||||
"""
|
||||
let result = ${iterClass}::new(this, IteratorType::${itrMethod});
|
||||
let realm = AlreadyInRealm::assert_for_cx(cx);
|
||||
let result = ${iterClass}::new(this, IteratorType::${itrMethod}, InRealm::already(&realm));
|
||||
""",
|
||||
iterClass=iteratorNativeType(descriptor, True),
|
||||
ifaceName=descriptor.interface.identifier.name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue