aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-05-29 19:46:35 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-05-30 11:01:13 +0530
commitf014f15d4eaeb52e38faee15dc9a4d0f700d1d7c (patch)
treee3b42fc81638129ebae332d3f10f4c59c16e8bfe /components/script
parent1a6193703134512b8d09b54a85bf58b3df82a372 (diff)
downloadservo-f014f15d4eaeb52e38faee15dc9a4d0f700d1d7c.tar.gz
servo-f014f15d4eaeb52e38faee15dc9a4d0f700d1d7c.zip
Allow sequence of nullable dictionary items in webidl
of type "sequence<Dict?> x"
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 597e5611f74..de97e2c9ea9 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -1134,7 +1134,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
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))
@@ -6645,7 +6645,10 @@ class CGDictionary(CGThing):
@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)