Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for nested dictionaries #23653

Merged
merged 1 commit into from Jun 29, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -4611,7 +4611,8 @@ def complete(self, scope):

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)

This file was deleted.

@@ -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
@@ -78,11 +78,11 @@ fn convert_constraints(js: &BooleanOrMediaTrackConstraints) -> Option<MediaTrack
BooleanOrMediaTrackConstraints::Boolean(true) => Some(Default::default()),
BooleanOrMediaTrackConstraints::MediaTrackConstraints(ref c) => {
Some(MediaTrackConstraintSet {
height: convert_culong(&c.parent.height),
width: convert_culong(&c.parent.width),
aspect: convert_cdouble(&c.parent.aspectRatio),
frame_rate: convert_cdouble(&c.parent.frameRate),
sample_rate: convert_culong(&c.parent.sampleRate),
height: c.parent.height.as_ref().and_then(convert_culong),
width: c.parent.width.as_ref().and_then(convert_culong),
aspect: c.parent.aspectRatio.as_ref().and_then(convert_cdouble),
frame_rate: c.parent.frameRate.as_ref().and_then(convert_cdouble),
sample_rate: c.parent.sampleRate.as_ref().and_then(convert_culong),
})
},
}
@@ -25,8 +25,8 @@ interface DOMQuad {
};

dictionary DOMQuadInit {
DOMPointInit p1;
DOMPointInit p2;
DOMPointInit p3;
DOMPointInit p4;
DOMPointInit p1 = null;
DOMPointInit p2 = null;
DOMPointInit p3 = null;
DOMPointInit p4 = null;
};
@@ -32,7 +32,7 @@ dictionary TestDictionary {
Blob interfaceValue;
any anyValue;
object objectValue;
TestDictionaryDefaults dict;
TestDictionaryDefaults dict = null;
sequence<TestDictionaryDefaults> seqDict;
// Testing codegen to import Element correctly, ensure no other code references Element directly
sequence<Element> elementSequence;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.