зеркало из https://github.com/mozilla/gecko-dev.git
Bug 837339. Re-disallow nullable dictionary members inside dictionaries. r=khuey
This commit is contained in:
Родитель
f84486996f
Коммит
70ffbcae37
|
@ -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")
|
||||
|
|
Загрузка…
Ссылка в новой задаче