Improve support for nested dictionaries

This commit is contained in:
Manish Goregaokar 2019-06-27 17:35:20 -07:00
parent 9e12b4175e
commit 3c7ceff46d
6 changed files with 12 additions and 24 deletions

View file

@ -4611,7 +4611,8 @@ class IDLArgument(IDLObjectWithIdentifier):
if ((self.type.isDictionary() or
self.type.isUnion() and self.type.unroll().hasDictionaryType()) and
self.optional and not self.defaultValue and not self.variadic):
self.optional and not self.defaultValue and not self.variadic and
not self.dictionaryMember):
# Default optional non-variadic dictionary arguments to null,
# for simplicity, so the codegen doesn't have to special-case this.
self.defaultValue = IDLNullValue(self.location)

View file

@ -1,12 +0,0 @@
--- WebIDL.py
+++ WebIDL.py
@@ -4570,8 +4570,7 @@ class IDLArgument(IDLObjectWithIdentifier):
if ((self.type.isDictionary() or
self.type.isUnion() and self.type.unroll().hasDictionaryType()) and
- self.optional and not self.defaultValue and not self.variadic and
- not self.dictionaryMember):
+ self.optional and not self.defaultValue and not self.variadic):
# Default optional non-variadic dictionary arguments to null,
# for simplicity, so the codegen doesn't have to special-case this.
self.defaultValue = IDLNullValue(self.location)

View file

@ -5,7 +5,6 @@ patch < pref-main-thread.patch
patch < callback-location.patch
patch < union-typedef.patch
patch < inline.patch
patch < undo-dictionary-optional.patch
wget https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/ -O tests.tar.gz
rm -r tests