Use IDL sequence default value

This commit is contained in:
Kagami Sascha Rosylight 2019-11-04 22:42:10 +09:00
parent 4ad08fff04
commit 01e0b2cb5e
13 changed files with 40 additions and 65 deletions

View file

@ -6388,8 +6388,11 @@ class CGDictionary(CGThing):
def struct(self):
d = self.dictionary
if d.parent:
inheritance = " pub parent: %s::%s,\n" % (self.makeModuleName(d.parent),
self.makeClassName(d.parent))
typeName = "%s::%s" % (self.makeModuleName(d.parent),
self.makeClassName(d.parent))
if type_needs_tracing(d.parent):
typeName = "RootedTraceableBox<%s>" % typeName
inheritance = " pub parent: %s,\n" % typeName
else:
inheritance = ""
memberDecls = [" pub %s: %s," %
@ -6520,10 +6523,7 @@ class CGDictionary(CGThing):
})
def membersNeedTracing(self):
for member, _ in self.memberInfo:
if type_needs_tracing(member.type):
return True
return False
return type_needs_tracing(self.dictionary)
@staticmethod
def makeDictionaryName(dictionary):