aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-10-05 01:25:58 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-10-06 21:35:55 +0200
commit144dc6257517a81fc96d3783b83fe0c82d502a36 (patch)
treeea4bfaf1a60635764b3e7892469f636b4561fbfc /components/script/dom/bindings/codegen/CodegenRust.py
parent02d38e74e90dd06f9083731a5101ad6b05be20dc (diff)
downloadservo-144dc6257517a81fc96d3783b83fe0c82d502a36.tar.gz
servo-144dc6257517a81fc96d3783b83fe0c82d502a36.zip
Do not use GlobalRoot in CodegenRust anymore
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index b5baf961c57..46285bcf406 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -3168,7 +3168,7 @@ class CGCallGenerator(CGThing):
if isFallible:
if static:
- glob = "global.r().as_global_scope()"
+ glob = "&global"
else:
glob = "&global_scope_from_reflector(this)"
@@ -3386,7 +3386,7 @@ class CGAbstractStaticBindingMethod(CGAbstractMethod):
def definition_body(self):
preamble = CGGeneric("""\
-let global = global_root_from_object(JS_CALLEE(cx, vp).to_object());
+let global = global_scope_from_object(JS_CALLEE(cx, vp).to_object());
""")
return CGList([preamble, self.generate_code()])
@@ -3438,7 +3438,7 @@ class CGStaticMethod(CGAbstractStaticBindingMethod):
nativeName = CGSpecializedMethod.makeNativeName(self.descriptor,
self.method)
setupArgs = CGGeneric("let args = CallArgs::from_vp(vp, argc);\n")
- call = CGMethodCall(["global.r().as_global_scope()"], nativeName, True, self.descriptor, self.method)
+ call = CGMethodCall(["&global"], nativeName, True, self.descriptor, self.method)
return CGList([setupArgs, call])
@@ -3492,7 +3492,7 @@ class CGStaticGetter(CGAbstractStaticBindingMethod):
nativeName = CGSpecializedGetter.makeNativeName(self.descriptor,
self.attr)
setupArgs = CGGeneric("let args = CallArgs::from_vp(vp, argc);\n")
- call = CGGetterCall(["global.r().as_global_scope()"], self.attr.type, nativeName, self.descriptor,
+ call = CGGetterCall(["&global"], self.attr.type, nativeName, self.descriptor,
self.attr)
return CGList([setupArgs, call])
@@ -3545,7 +3545,7 @@ class CGStaticSetter(CGAbstractStaticBindingMethod):
" throw_type_error(cx, \"Not enough arguments to %s setter.\");\n"
" return false;\n"
"}" % self.attr.identifier.name)
- call = CGSetterCall(["global.r().as_global_scope()"], self.attr.type, nativeName, self.descriptor,
+ call = CGSetterCall(["&global"], self.attr.type, nativeName, self.descriptor,
self.attr)
return CGList([checkForArg, call])
@@ -5252,12 +5252,12 @@ class CGClassConstructHook(CGAbstractExternMethod):
def definition_body(self):
preamble = CGGeneric("""\
-let global = global_root_from_object(JS_CALLEE(cx, vp).to_object());
+let global = global_scope_from_object(JS_CALLEE(cx, vp).to_object());
let args = CallArgs::from_vp(vp, argc);
""")
name = self.constructor.identifier.name
nativeName = MakeNativeName(self.descriptor.binaryNameFor(name))
- callGenerator = CGMethodCall(["global.r().as_global_scope()"], nativeName, True,
+ callGenerator = CGMethodCall(["&global"], nativeName, True,
self.descriptor, self.constructor)
return CGList([preamble, callGenerator])
@@ -5500,9 +5500,9 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'dom::bindings::constant::ConstantSpec',
'dom::bindings::constant::ConstantVal',
'dom::bindings::global::GlobalRef',
- 'dom::bindings::global::global_root_from_object',
'dom::bindings::global::global_scope_from_object_maybe_wrapped',
'dom::bindings::global::global_scope_from_reflector',
+ 'dom::bindings::global::global_scope_from_object',
'dom::bindings::interface::ConstructorClassHook',
'dom::bindings::interface::InterfaceConstructorBehavior',
'dom::bindings::interface::NonCallbackInterfaceObjectClass',