Skip to content

Commit

Permalink
Allow sequence of nullable dictionary items in webidl
Browse files Browse the repository at this point in the history
of type "sequence<Dict?> x"
  • Loading branch information
kunalmohan committed May 30, 2020
1 parent 1a61937 commit f014f15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -1134,7 +1134,7 @@ def wrapObjectTemplate(templateBody, nullValue, isDefinitelyObject, type,

if type.isDictionary():
# There are no nullable dictionaries
assert not type.nullable()
assert not type.nullable() or (isMember and isMember != "Dictionary")

typeName = "%s::%s" % (CGDictionary.makeModuleName(type.inner),
CGDictionary.makeDictionaryName(type.inner))
Expand Down Expand Up @@ -6645,7 +6645,10 @@ def membersNeedTracing(self):

@staticmethod
def makeDictionaryName(dictionary):
return dictionary.identifier.name
if isinstance(dictionary, IDLWrapperType):
return CGDictionary.makeDictionaryName(dictionary.inner)
else:
return dictionary.identifier.name

def makeClassName(self, dictionary):
return self.makeDictionaryName(dictionary)
Expand Down

0 comments on commit f014f15

Please sign in to comment.