Bug 837339. Re-disallow nullable dictionary members inside dictionaries. r=khuey

This commit is contained in:
Boris Zbarsky 2013-03-14 15:42:59 -04:00
Родитель f84486996f
Коммит 70ffbcae37
2 изменённых файлов: 21 добавлений и 0 удалений

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

@ -1082,6 +1082,10 @@ class IDLDictionary(IDLObjectWithScope):
return (False, None)
for member in self.members:
if member.type.isDictionary() and member.type.nullable():
raise WebIDLError("Dictionary %s has member with nullable "
"dictionary type" % self.identifier.name,
[member.location])
(contains, locations) = typeContainsDictionary(member.type, self)
if contains:
raise WebIDLError("Dictionary %s has member with itself as type." %

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

@ -425,3 +425,20 @@ def WebIDLTest(parser, harness):
harness.ok(threw, "Member type must not be a Dictionary, one of whose "
"members or inherited members has a type that includes "
"its Dictionary.")
parser = parser.reset();
threw = False
try:
parser.parse("""
dictionary Foo {
};
dictionary Bar {
Foo? d;
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Member type must not be a nullable dictionary")