aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorShinichi Morimoto <shnmorimoto@gmail.com>2020-03-31 09:37:07 +0900
committerShinichi Morimoto <shnmorimoto@gmail.com>2020-03-31 09:37:07 +0900
commit74995a5287dc0af8afe62e9b537db5141b854765 (patch)
tree45d54be725ea81c73107c15a47f42873f0ac7250 /components/script
parentd8c1dc60e8f48f05ecd3ec01fbc91d7743734460 (diff)
downloadservo-74995a5287dc0af8afe62e9b537db5141b854765.tar.gz
servo-74995a5287dc0af8afe62e9b537db5141b854765.zip
fixed CGCollectJSONAttributesMethod
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index ed0e1223e72..96947d83ec7 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2966,18 +2966,16 @@ class CGCollectJSONAttributesMethod(CGAbstractMethod):
self.toJSONMethod = toJSONMethod
def definition_body(self):
- ret = ''
+ ret = """let incumbent_global = GlobalScope::incumbent().expect("no incumbent global");
+let global = incumbent_global.reflector().get_jsobject();\n"""
interface = self.descriptor.interface
-
for m in interface.members:
if m.isAttr() and not m.isStatic() and m.type.isJSONType():
name = m.identifier.name
conditions = MemberCondition(None, None, m.exposureSet)
- ret_conditions = 'vec![' + ",".join(conditions) + "]"
+ ret_conditions = '&[' + ", ".join(conditions) + "]"
ret += fill(
"""
- let incumbent_global = GlobalScope::incumbent().expect("no incumbent global");
- let global = incumbent_global.reflector().get_jsobject();
let conditions = ${conditions};
let is_satisfied = conditions.iter().any(|c|
c.is_satisfied(