Bug 841404. Make sure that we treat dictionaries inside sequence and array members of a dictionary as dependencies for it. r=peterv

This commit is contained in:
Boris Zbarsky 2013-02-17 11:22:11 -05:00
Родитель b2b58ab3d4
Коммит 83a7dcbda5
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -6812,14 +6812,21 @@ class CGDictionary(CGThing):
def makeIdName(name):
return name + "_id"
@staticmethod
def getDictionaryDependenciesFromType(type):
if type.isDictionary():
return set([type.unroll().inner])
if type.isSequence() or type.isArray():
return CGDictionary.getDictionaryDependenciesFromType(type.unroll())
return set()
@staticmethod
def getDictionaryDependencies(dictionary):
deps = set();
if dictionary.parent:
deps.add(dictionary.parent)
for member in dictionary.members:
if member.type.isDictionary():
deps.add(member.type.unroll().inner)
deps |= CGDictionary.getDictionaryDependenciesFromType(member.type)
return deps