Skip to content

Commit

Permalink
fixed CGCollectJSONAttributesMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
shnmorimoto committed Mar 31, 2020
1 parent d8c1dc6 commit 74995a5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2966,18 +2966,16 @@ def __init__(self, descriptor, toJSONMethod):
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(
Expand Down

0 comments on commit 74995a5

Please sign in to comment.